MR3 Document¶
What is MR3 ?¶
MR3 (Meta-Model Management based on RDFs Revision Reflection) is an editing tool of RDF-based contents developed for managing a relationship between RDF (Resource Description Framework) and RDFS (RDF Schema) contents.
Introduction¶
The Semantic Web is one of the most promised candidates as the Web tomorrow, whose basis is on RDF and RDF Schema recommended by the World Wide Web Consortium. The purpose of the idea is to make the data on the Web available not only for displaying but also for automation, integration and reuse of data across various applications. At the moment, a number of supporting environment have been developed as the adopted tools of traditional knowledge engineering based ontologies. These products are mostly concentrating on creating ontologies and managing ontology-based semantic markup. From the standpoint of a significance of information lifecycle on the Semantic Web, in this work, an editing tool of RDF-based contents is developed for managing a relationship between RDF and RDFS contents.
Features¶
MR3 provides the three main functions to edit and to manage the several sorts of relationship among RDF and RDFS contents as follows.
- Graphical Editing of RDF Descriptions
- Based on the semantics of RDF data model, the tool supports to edit the resource-property-value relation.
- Graphical Editing of RDFS Descriptions
- Based on the semantics of RDF Schema model, the tool supports to edit the class-subclass relation and to add the information of properties such as range, domain, sub-property, and so on.
- Meta-Model Management Facilities
- In order to reflect the change of RDF or RDFS contents on the other, the tool supports the correspondence between them.
The above function consisted of the following sub-functions.
- Importing an RDF(S) document and editing the RDF(S) data model graphically.
- Exporting an RDF(S) data model as an RDF(S) document based on various formats such as Turtle, JSONLD, RDF/XML, and N-Triples.
- Reflecting changes of RDFS class to RDF resource type.
- Reflecting changes of RDFS property to RDF property.
- Reflecting the change of RDF resource type to the RDFS class and domains and ranges of RDFS property.
- Reflecting changes of RDF property to RDFS property.
Installation¶
Requirements¶
MR3 is implemented by Java language. JRE (Java Runtime Environment) 11 or later is required to execute. In ver. 2019.05_1, JRE 11 is embedded, so there is no need to install a JRE.
We confirmed MR3 following environemnt.
- MS Windows 10 + openjdk version “11.0.3” 2019-04-16
- Mac OS 10.14.3 + openjdk version “11.0.3” 2019-04-16
How to Install¶
- Download the file from Download Page
- For Windows: mrcube-2019.05_1_win.zip
- For macos: mrcube-2019.05_1_mac.zip
- Extract the file and execute mrcube.bat (Windows) or mrcube (macos) in the bin folder.
How to Uninstall¶
- Remove the extracted folder.
Used libraries¶
MR3 uses the following libraries:
Key concepts¶
Contents
Model and Ontology¶
In this section, we describe model and ontology in MR3 .
Model¶
Models are essential machine readable contents described by RDF and these are exclued trivial information from web contentns. Specifically, models include RDF triples and the subjects of the triples belong to one or more classes in RDFS. Models consist of elements provided by ontologies. The elements are types of resources and RDF properties. In the Semantic Web, the model is equivalent to RDF content (facts in OWL).
Ontology¶
Ontologies are classes, properties, and relationships between classes or properties. In the Semantic Web, ontologies are equivalent to RDFS or OWL contents. Types of resources are defined by RDFS classes and RDF properties are defined by RDFS properties. Relationships among Web resources, models, and ontologies are shown in Fig. 1.
RDF data models are built from Web resources. RDF data models are described by RDF/XML format as RDF contents. Domain ontologies or general ontologies (WordNet [Miller95], EDR [Yokoi95], etc) are used to build RDF data models. Same domain ontologies can be used when multiple web resources belong to same domain. For example, two RDF models that belong to Domain B use an RDFS domain ontology in Fig. 1 .
Concept of Meta-Model Management¶
This section discusses our concept of a meta-model and meta-model management. In our research, meta-model is defined as a model expressing the components of models, especially the type of an RDF resource and RDF property. RDFS class is a model expressing the type of RDF resource. RDFS property is a model expressing an RDF property.
Since RDF and RDFS descriptions are described with the same RDF syntax, there is no clear distinction between RDF and RDFS parts. This forces us to observe the type of resources in order to pick up only an RDF part or only an RDFS part. Although the recent trend of Semantic Web languages, including Web Ontology Language (OWL), tries to capture the advanced concept of ontologies in a single framework, there is no clear support to manage the correspondence between RDF and RDFS.
Since RDF and RDFS can be regarded as the relationship between a model and a meta-model, in the concept of meta-model management, RDF and RDFS can be managed separately and maintain their relationship automatically. In some of the logical frameworks described above, the meta-model concept seems to capture the above RDF and RDFS relationship. Such a logical framework reminds us to distinguish RDF and RDFS clearly, and can be expected to bring (semi-)automated support of the consistency between RDF and RDFS.
As a key concept in our research, we focus on the meta-model management, which is defined as the appropriate management of the correspondence between a model and its meta-model: especially, the management of the RDFS class and RDFS property in a meta-model, and the type of an RDF resource and RDF property in a model. Fig. 2 sketches the concept of meta-model management.
Meta-Model Management Scenarios¶
From our experience, we consider that the actual construction of meta-models and models in RDFS/OWL are performed from two different views. Meta-models are constructed considering a conceptualization which is separated from a real object world. On the other hand, models are constructed considering a real object world. Some modifications in models will cause the modifications of the meta-models, and vice versa. Moreover, in order to construct appropriate meta-models and models, modelers need to modify models and meta-models repeatedly. In such situation, since the modifications are made so often in both models and meta-models, these refinement costs are quite expensive. The graphical editing functions of MR3 will help modelers manage the model and the meta-model from a panoramic view. The meta-model management facilities will help modelers concentrate on editing and evaluating models or meta-models without frequently switching the editing modes between a model and a meta-model. The aim of our research is to provide such functions and facilities that will reduce the refinement cost of models and meta-models by the reflective processes.
Fig. 3 shows an example of meta-model management process. The upper part of Fig. 3 shows a meta-model modification process. The lower part of Fig. 3 shows a model modification process. C1, C2, and C3 in the meta-model depict RDFS classes. P1 in the meta-model depicts an RDFS property. R1 and R2 in the model depict RDF resources. C2 and C3 which are depicted the upper right of RDF resources in the model depict type of RDF resources. P1 in the model depicts an RDF property. In Fig. 3, at the beginning, P1 in the meta-model is modified to P1’ by a user. Along with that, corresponding the RDF property in the model is also modified by a meta-model management facility automatically. Next, C2 which is the type of RDF resource R1 in the model is modified to C2’ by a user. Along with that, corresponding the RDFS class in the meta-model is also modified by a meta-model management facility semi-automatically.
References¶
[Miller95] | G.A.Miller, “WordNet: A Lexical Database for English,” Commun. ACM, vol.38, no.11, pp.39.41, 1995. |
[Yokoi95] |
|
Functions¶
Contents
- Functions
Overview of MR3 functions¶
Fig. 4 shows a functional outline of MR3 . The goal of MR3 is to represent complicated models in a form that is as easy as possible for users to understand. MR3 provides three main functions: (1) graphical editing of RDF descriptions, (2) graphical editing of RDFS descriptions, and (3) meta-model management facilities, allowing several types of relationships in an RDF and RDFS description to be manipulated and managed. Here, the RDF elements considered are the RDF resource, RDF property and RDF literal, and the RDFS elements are the RDFS class and RDFS property. In the definition of these functions, a data graph refers to any visual expression of the data model.
The details of each function are described below.
Graphical Editing of RDF Descriptions¶
Function (1) in Fig. 4, which represents the graphical editing of RDF descriptions, supports the manipulation of the resource-property-value relation as defined by the semantics of the RDF data model. This function consists of the following sub-functions:
- Transformation of RDF resources into an RDF data graph
- Transformation of an RDF data graph into RDF resources
Graphical Editing of RDFS Descriptions¶
Function (2) in Fig. 4, which represents the graphical editing of RDFS descriptions, supports the manipulation of the attributes of classes such as the class-subclass relation and the attributes of properties such as rdfs:domain, rdfs:range, and the property-subproperty relation, as defined by the semantics of the RDF Schema model. This function consists of the following sub-functions:
- Transformation of RDFS resources into an RDFS data graph
- Transformation of an RDFS data graph into RDFS resources
Meta-Model Management Facilities¶
Function (3) in Fig. 4, which represents meta-model management facilities, is defined in this context as the checking of the consistency of classes and properties. The consistency checking mechanism consists of several facilities, as detailed below.
Meta-model management facilities are categorized as O→M or M→O. O→M is the facility to reflect the change in an ontology (RDFS class and property) in a model (the type of an RDF resource and RDF property). M→O is the facility to reflect the change in a model in an ontology. Manipulation of RDFS Class and Manipulation of RDFS Property are O→M facilities. Replace the Type of an RDF Resource and Replace RDF Property are M→O facilities.
O→M: Manipulation of an RDFS Class¶
The manipulation function of an RDFS class is operated by the meta-model management facility, and consists of replacing and removing an RDFS class.
- Replace RDFS Class
- When a URI of an RDFS class is replaced, the type of the RDF resource (URI), which refers to the replaced RDFS class, is also replaced at the same time.
- Removal of RDFS Class
- When an RDFS class is removed, MR3 shows the list of RDF resources, which includes the removed RDFS class as a type. The user can choose (or empty) other RDFS classes as a type of RDF resource.
Replace URI of RDFS Class¶
when a URI of an RDFS class is replaced, the type of the RDF resource (URI), which refers to the replaced RDFS class, is also replaced at the same time. Fig. 5 shows an example of replacing a URI of an RDFS class. The left part of Fig. 5 shows the state before replacing ex:Book class and the right part of Fig. 5 shows the state after replacing ex:Book to schema:Book class.
In the RDFS part in the following figures, green ellipses represent RDFS classes, red ellipses represent RDFS properties, arrows represent rdfs:subClassOf or rdfs:subPropertyOf properties. In the RDF part in the following figures, ellipses represent RDF resources, arrows represent RDF properties, and labels at the upper left of ellipses represent types of RDF resources.
ex:The-Emotion-Machine and ex:The-Society-of-Mind are RDF resources that have ex:Book as their type. If the users replace the URI of ex:Book to schema:Book, the type of RDF resource, which refers to ex:Book class, is also replaced at the same time. In this case, the types of ex:The-Emotion-Machine and ex:The-Society-of-Mind (ex:Book class) are replaced with schema:Book class.
Removal of RDFS Class¶
When an RDFS class is removed, MR3 shows the list of RDF resources, which includes the removed RDFS class as a type. The user can choose (or empty) other RDFS classes as a type of RDF resource.
Fig. 6 shows an example of removal of an RDFS class. When the users remove ex:Book class, it can not be maintained consistency beween RDF contents and RDFS contents. Because exBook class is types of ex:The-Emotion-Machine and ex:The-Society-of-Mind resources. In Fig. 6, the users select empty as their type to maintain the consistency.
Note
If a type of an RDF resource is empty, the type of the RDF resource become implicitly rdfs:Resource.
O→M: Manipulation of an RDFS Property¶
The manipulation function of an RDFS property is operated by the meta-model management facility, and consists of replacing and removing an RDFS property.
- Replace URI of RDFS Property
- When a URI of an RDFS property is replaced, the RDF property, which refers to the replaced RDFS property, is also replaced at the same time.
- Removal of RDFS Property
- When an RDFS property is removed, MR3 shows the list of the RDF properties which refer to the removed RDFS property. A user can choose other RDFS properties (or the default property – mr3:nil ) as a property of the RDF resources.
Replace URI of RDFS Property¶
When a URI of an RDFS property is replaced, the RDF property, which refers to the replaced RDFS property, is also replaced at the same time. Fig. 7 shows an example of replacing a URI of an RDFS property. The left part of Fig. 7 shows the state before replacing ex:author property and the right part of Fig. 7 shows the state after replacing ex:author to dc:creator property. ex:The-Emotion-Machine and ex:The-Society-of-Mind resources have the ex:author property. If the users replace the ex:author property with the dc:creator property, the corresponding RDF properties are also replaced. In this case, The ex:author property that ex:The-Emotion-Machine and ex:The-Society-of-Mind resources have are automatically replaced with the dc:creator property|
Removal of RDFS Property¶
When an RDFS property is removed, MR3 shows the list of the RDF properties which refer to the removed RDFS property. A user can choose other RDFS properties (or the default property – mr3:nil) as a property of the RDF resources.
Fig. 8 shows an example of removal of an RDFS property. When the users remove ex:author property in the Property editor, it can not be maintained consistency between the RDF contents and the RDFS contents. Because ex:The-Emotion-Machine and ex:The-Society-of-Mind resources have the ex:author property. Here, in order to maintain the consistency, the users replace ex:author property with the default property ( mr3:nil ).
Note
In MR3 , mr3:nil is the default property. If any RDFS properties are not defined and the users create a statement, the property between resources in the statement become mr3:nil.
M→O: Replacing the Type of an RDF Resource¶
When it is not clear which RDFS class corresponds to the type of an RDF resource replaced by the user, the meta-model management facility is applied. When the type of an RDF resource replaced by the user is defined by the RDFS class, MR3 matches the type of the RDF resource and the RDFS class corresponding to the type of RDF resource. In addition, if the class is not defined, the user can choose one of the following:
- Replacing a URI of an RDFS class with that referred to before the user replaced the type of the RDF resource.
- Creating an RDFS class that has yet to be defined.
Fig. 9 and Fig. 10 show examples of replacing a type of an RDF resource.
Replacing a URI of an RDFS class¶
In Fig. 9, although dc:BibliographicResource class is not defined in the Class editor, the users replace the type of ex:The-Society-of-Mind ( ex:Book class) with schema:Book class. Here, in order to maintain the consistency, the users select replacing a URI of an RDFS class. In this case, the users replace ex:Book class with schema:Book class. Therefore, the type of ex:The-Emotion-Machine ( ex:Book ) is automatically replaced with schema:Book class.
Creating an RDFS class¶
In Fig. 10, schema:Book class is not defined and the users replace the type of ex:The-Society-of-Mind ( ex:Book ) with schema:Book class. Here, the users select to create schema:Book class to maitain consistency.
M→O: Replacing the RDF Property¶
When it is not clear which RDF property corresponds to the RDFS property replaced by a user, the meta-model management facility is applied. When the RDF property which the user replaced is defined by the RDFS property, MR3 matches the RDF property and the RDFS property corresponding to the RDF property. If the property is not defined, the user can choose one of the following:
- Replace the RDFS property name with that referred to before the user replaced the RDF property.
- Create an RDFS property that has yet to be defined.
Fig. 11 and Fig. 12 shows examples of replacing an RDF property.
Replacing a URI of an RDFS property¶
In Fig. 11, although ex:author property is not defined in the Property editor, the users replace ex:author property that ex:The-Society-of-Mind resource has with dc:creator property. In order to maintain the consistency, the users select replacing a URI of an RDFS property. In this case, the users replace ex:author property with dc:creator property. Therefore, ex:author property that ex:The-Emotion-Machine has is automatically replaced with dc:creator property.
Creating an RDFS property¶
In Fig. 12, dc:creator property is not defined and the users replace the ex:author property that ex:The-Society-of-Mind resource has with dc:creator. Here, the users select to create dc:creator property to maintain consistency.
Other functions¶
Importing an RDF Document¶
When importing an RDF document, the type of RDF resource or an RDF property may not be defined as an RDFS class or an RDFS property. In this case, in order to maintain consistency, a type of RDF resource which is not defined as an RDFS class is created as a sub class of the rdfs:Resource class. In the same way, an RDF property which is not defined as an RDFS property is created.
Fig. 13 shows an example of importing an RDF document. The left side of Fig. 13 depicts the state before importing the RDF document. The right side of Fig. 13 depicts the state after importing the RDF document. ex:Book, with the type of ex:The_Emotion_Machine and ex:The_Society_of_Mind, is not defined as an RDFS class. Also ex:author in the RDF model is not defined as an RDFS property. In order to maintain consistency, MR3 creates a ex:Book class and ex:author property in the RDFS data graph automatically.
Keeping Element Names Unique¶
This function prevents RDF and RDFS from overlapping other element names when a user renames and creates an RDF or RDFS element. If duplication of an RDFS element name is allowed, consistency cannot be maintained.
Replacing namespace with prefix or URI with label¶
MR3 has a function to replace namespaces of resources with the corresponding prefixes that are defined in the Namespace Table. MR3 also has a function to replace URIs of resources with the value of rdfs:label property that the resources have.
Setting a Meta Class and Property¶
A user can set meta classes and properties in MR3 . This function controls whether to consider a resource of a certain type as a class or a property. For example, if a user sets owl:Class as a meta class and owl:ObjectProperty and owl:DatatypeProperty as meta properties, MR3 can import the class and property hierarchy in OWL. The default meta class is rdfs:Class and the default meta property is rdf:Property.
Validation¶
When constructing an RDF model, MR3 doesn’t check rdfs:domain and rdfs:range in the RDFS properties. However, MR3 can perform validation of an RDF model using vOWLidator. This function indicates the resources that don’t match the rdfs:domain and rdfs:range in the RDFS properties.
Note
In ontology based tools, the users must define domains and ranges of RDFS properties before using the RDFS properties to build RDF contents. In MR3 , the users can use RDFS properties without defining the domains and the ranges of the property to build RDF contents.
User manual¶
Contents
- User manual
- Implementation architecture
- System overview
- Overview of the Graphical Modeler
- RDF Editor
- Class Editor
- Property Editor
- Resource Search Dialog
- Namespace Table
- Remove Dialog
- Import Dialog
- Export Dialog
- Option Dialog
- RDF Source Code Viewer
- SPARQL Query Dialog
- Validator
- Project Info
- History Manager
- Log Console
- About MR^3
- Menu
- Toolbar
- Shortcut keys
Implementation architecture¶
Fig. 14 shows the system architecture of MR3 from the aspect of system implementation. MR3 is implemented in Java language, using the Java Swing user interface. MR3 uses JGraph for RDF(S) graph visualization, and Apache Jena for enabling the use of Semantic Web standards such as RDF, RDFS, and OWL. The Parser and Generator in MR3 are implemented using Jena APIs. By using these libraries, MR3 is implemented as an environment for graphical representation of Semantic Web descriptions.
System overview¶
Fig. 15 shows the system overview of MR3 . MR3 consists of the Parser, Generator, RDF(S) Management, and Graphical Modeler. The Graphical Modeler mainly consists of the RDF Editor, Class Editor, and Property Editor. The user edits the RDFs description visually via the Graphical Modeler. The input and output of MR3 are RDFs documents. The Parser analyzes input RDFs documents and makes further operations possible by transforming the RDFs document into a Jena model. Then, the Parser changes the Jena model into an internal data expression, and RDF(S) management is performed. The Generator changes the internal data expression into a Jena model. Finally, the Jena model is changed into an RDFs document.
Overview of the Graphical Modeler¶
Fig. 16 shows a typical screen showing the Graphical Modeler of MR3 . The Graphical Modeler consists of RDF Editor, Class Editor, Property Editor, Attribute Dialog, Namespace Table, Remove Dialog, Find Resource Dialog, Import Dialog, and Export Dialog.
The details of the Graphical Modeler are shown in the following sections.
RDF Editor¶
The RDF Editor allows the user to express the relationship between an RDF resource, RDF property, and RDF literal using a directed graph, and also allows the attributes of each element to be edited. The attributes of an RDF resource consist of a URI, the URI type, and the RDF resource type. The RDF resource type can be chosen using the Class Editor. The URI type can be chosen from either a URI or can be set as anonymous.
As shown in Fig. 17, RDF resources are represented as ellipses, RDF properties are represented as arrows, and RDF literals are represented as rectangles in the RDF editor. Types of RDF resources are shown at the upper left part of the RDF resources.
Toolbar in the RDF Editor¶
Icons in the toolbar in the RDF Editor and the corresponding functions are shown in the following table.
Icon | Function |
---|---|
![]() |
Insert an RDF resource |
![]() |
Insert an RDF literal |
![]() |
Copy nodes |
![]() |
Cut nodes |
![]() |
Paste nodes |
![]() |
Remove nodes |
![]() |
Undo |
![]() |
Redo |
![]() |
Save the RDF graph as image file |
![]() |
Automatically layout the RDF graph |
![]() |
Open a selected RDF resource |
Editing attributes of RDF resources¶
When users select an RDF resource in the RDF Editor*, the attributes of the RDF resource are shown in the **Attribute Dialog ( Fig. 20 to Fig. 25 ). The attributes of RDF resources are URI, rdf:type, blank node or not, rdfs:label, and rdfs:comment. Here the blank nodes are RDF resources that are not named by URIs. Blank nodes can not be acceced from external documents. However, the blank nodes can be subjects or objects of statements. They are used to represent RDF resources that are difficult to name or structure RDF contents.
If users would like to set a URI of an RDF resource, they should select URI from the left side menus in the Attribute Dialog as shown in Fig. 20. Prefixes that are registered in the Namespace Table are shown in the [Prefix] combo box. When users select one of the prefixes in the combo box, the corresponding namespace is shown in the [RDF Resource] text field. The users can input any URI in the text field. If the users would like to set an RDF resource as a blank node, the users should check the [blank node] checkbox.
If the users would like to set a type to an RDF resource, the users should select the [Resource Type] from the left side menu in the Attribute Dialog as shown in Fig. 21. The [Resource Type] checkbox should be checked when the users input the type of an RDF resource. If the users would like to empty the type of an RDF resource, they should uncheck the [Resouce Type] checkbox.
When the users click the [Select Type] button, [Select Resource Type Dialog] are shown as shown in Fig. 22. The class hierarchy that is build in the Class Editor is shown in the [Select Resource Type Dialog]. When the users select an RDFS class in the dialog, the namespace and ID of the selected class are set in the Attribute Dialog.
When the users input a URI that is not defined in the [Class Editor], [RDF(S) contents management] dialog is shown as shown in Fig. 23. In the RDF(S) contents management dialog, the users can select Rename or Create.
When the users click the [ClassEdit] button, the type of an RDF resource is selected and the attributes of the type of the RDF resource are shown in the Attribute Dialog.
If the users would like to define the rdfs:label of an RDF resource, the users should select [Label] in the left side menu in the Attribute Dialog as shown in Fig. 24. After inputting language in the [Lang] text field and label in the [Label] text field, the language and the label are added in the table in the Attribute Dialog. If the users select a line in the table and click Remove button, the selected label is removed.
If the users would like to define the rdfs:comment of an RDF resource, the users should select [Comment] in the left side menu in the Attribute Dialog as shown in Fig. 25. After clicking the [Add] button, the [Edit Comment Dialog] is shown.
First input language in the [Lang] text field and comment in the [Comment] text area. Then, click [OK] button. After that, the language and the label are added in the table in the Attribute Dialog. If the users select a line in the table and click [Edit] button, the users can edit the selected comment and the language. In the same way, if the user select a line in the table and click [Remove] button, the selected label is removed.
Editing attributes of RDF properties¶
If the users select an RDF property in the RDF Editor, the attributes of the RDF property are shown in the Attribute Dialog (Fig. 26). The users can edit the URI of the selected RDF property.
When the users input a URI which is not defined in the Property Editor, [RDF(S) contents management] dialog is shown as shown in Fig. 23. In the [RDF(S) contents management] dialog, the users can select rename the RDFS property or create an RDFS property.
When the users select one of the prefixes in the dialog, IDs of RDFS properties that are defined in the Property Editor and the namespace is correspond to the selected prefix are shown in the [Property ID] list.
When the users select one of the Property IDs and click [RDFSPropertyEdit] button, the RDFS property is selected and the attributes of the RDFS property are shown in the Attribute Dialog.
Editing attributes of RDF literals¶
When the users select an RDF literal in the RDF Editor, the attributes of the RDF literal are shown in the Attribute Dialog. (Fig. 27) The users can edit the contents of the literal, the attribute of language (xml:lang), and the data type of the literal. In the [Literal] text are, the users can input the contents of the literal. The users can also input language in the [Lang] text field. If the users set the data type of the literal, the users should check [Data type] checkbox and select one of the types in the combobox. Language attribute and data type attribute are exclusive and the users only select one of them.
Class Editor¶
The Class Editor allows the users to edit the attributes of RDFS classes and the relationships between the classes.
Fig. 28 shows a screenshot of the Class Editor.
Toolbar in the Class Editor¶
Icons in the toolbar in the Class Editor and the corresponding functions are shown in the following table.
Icon | Function |
---|---|
![]() |
Insert an RDFS class |
![]() |
Copy nodes |
![]() |
Cut nodes |
![]() |
Paste nodes |
![]() |
Remove nodes |
![]() |
Undo |
![]() |
Redo |
![]() |
Save the class graph as an image file |
![]() |
Automatically layout the class graph (lef to right) |
![]() |
Automatically layout the class graph (up to down) |
![]() |
Open a selected RDFS class |
Editing attributes of the Class editor¶
When the users select an RDFS class in the Class Editor, the attributes of the RDFS class are shown in the Attribute Dialog (Fig. 31 to Fig. 33). The users can edit the attributes of an RDFS class by selecting Base, Label, Comment, Instances, or SuperClasses items from the left side menu in the Attribute Dialog.
When the users select the [Base] item, the type of an RDFS class and the URI can be edited (Fig. 31). The [Resource Type] can be defined by [Class Class List] in the Option Dialog. When the users select the [Label] item, the value of rdfs:label property can be edited. When the users select the [Comment] item, the value of rdfs:comment property can be edited. The methods for editing rdfs:label and rdfs:comment are same as RDF resource. When the users select the [Instances] item, the instances of the selected RDFS class are shown in the list (Fig. 32). When the users select the one of the items in the list, corresponding RDF resource is selected and the attributes of the RDF resource are shown in the Attribute Dialog. When the users select the *[SuperClasses] item, the super classes of the selected RDFS class are shown in the list (Fig. 33).
Property Editor¶
The Property Editor allows the users to edit the attributes of RDFS properties and the relationships between the properties.
Fig. 34 shows a screenshot of the Property Editor.
Toolbar in the Property Editor¶
Icons in the toolbar in the Property Editor and the corresponding functions are shown in the following table.
Icon | Function |
---|---|
![]() |
Insert an RDFS property |
![]() |
Copy nodes |
![]() |
Cut nodes |
![]() |
Paste nodes |
![]() |
Remove nodes |
![]() |
Undo |
![]() |
Redo |
![]() |
Save the property graph as an image file |
![]() |
Automatically layout the RDFS property graph (left to right) |
![]() |
Automatically layout the RDFS property graph (up to down) |
![]() |
Open a selected RDFS property |
Editing attributes of the Property editor¶
When the users select an RDFS property in the Property Editor, the attributes of the RDFS property are shown in the Attribute Dialog (Fig. 37 and Fig. 38). The users can edit the attributes of an RDFS property by selecting [Base], [Label], [Comment], [Domain/Range], [Instances], or [SuperProperties] items in the left side menu of the Attribute Dialog. [Base], [Label], and [Comment] items are same as RDFS Class. The [Resource Type] list in the [Base] item can be defined by the [Property Class List] in the Option Dialog. When the users select [Domain/Range] item, domains and ranges of the selected RDFS property can be edited (Fig. 37). When the users select [Instances] item, RDF resource list that have the selected RDFS property is shown in the Attribute Dialog (Fig. 38). When the users select the one of the items in the list, the RDF resource is selected and the attributes of the RDF resource are shown in the Attribute Dialog. When the users select [SuperProperties] item, super properties of the selected RDFS property are shown in the list.
Resource Search Dialog¶
The users can find resources (RDF resources, RDF properties, RDFS classes, and RDFS properties) by using Resource Search Dialog. Fig. 39 shows a screenshot of the Resource Search Dialog. When the users enter a string in the [Keyword] text field, the corresponding resource list is displayed in the [Find Result] list at the bottom of Fig. 39. The serach targets are URIs, labels, and comments of RDFS classes, properties, and RDF resources. When the users select the one of the items in the list, corresponding resource is selected and the attributes of the resource are shown in the Attribute Dialog.
Namespace Table¶
The users can register perfixes and the corresponding namespaces in the Namespace Table. Fig. 40 shows a screenshot of the Namespace Table. When the users set a prefix in the [Prefix] text field, set a namespace in the [NameSpace] text field, and click [Add] button, the prefix and the namespace are added in the table in the Namespace Table. If the users would like to remove the prefix and the corresponding namespace, select the line in the table and click [Remove] button. If the users check the available checkbox, namespaces of resources in each editor are replaced with the corresponding prefix (This function is only available when the View->URI menu is selected.). When the users set a URI of an resource, the Namespace Table is referred and the users can select the registered prefixes in the Attribute Dialog. When the users select one of the prefixes, the corresponding namespace is shown in the [Namespace] label or [RDF Resource] text field.
Remove Dialog¶
If an RDFS class is referred by a type of a resource or a domain or a range of a property, it is inconsistency when the RDFS class is removed. If an RDFS property is reffered in the RDF editor, it is inconsistency when the RDFS property is removed. In these cases, when the users remove those RDFS classes or properties, the Remove Dialog as shown in Fig. 41 is shown before removing them actually.
Removed RDFS classes or properties are shown in the upper part of Fig. 41. RDF resources that referred the removed RDFS classes as their type are shown in the [RDF Editor] tab in the lower part of Fig. 41. RDF properties that referred the removed RDFS properties are also shown in the [RDF Editor] tab. RDFS properties that refer removed RDFS classes as their domains or ranges are shown in the [Property Editor] tab in the lower part of Fig. 41.
If the users check the [Delete Check] Checkboxes and click [Apply] button, RDF resources, RDF properties, and RDFS properties that listed in the lower part of the Remove Dialog stop referring to the removed RDFS classes or RDFS properties. Then, the RDFS classes and RDFS properties are actually removed.
If the users select one of the RDF resources, RDF properties, or RDFS properties, attributes of the selected resource are shown in the Attribute Dialog. Then, the users can edit the attributes to maintain consistency.
Import Dialog¶
The users can import RDF(S) documents described as Turtle, JSONLD, RDF/XML, N-Triples, or mr3 format to MR3 by using Import Dialog. Fig. 42 shows a screenshot of the Import Dialog. The users can open Import Dialog by clicking [Open] sub menu in the [File] menu or clicking icon in the Toolbar.
First, select a file that the users want to open. Then, select a file format from the [Files of Type]. Finally, select [Open] button.
If the users select [All Files] from the [Files of Type], the file format is automatically detected from the extension of the file. The correspondence between the extension and the file format is shown below.
Extension | File format |
---|---|
ttl | Turtle |
jsonld | JSONLD |
n3 | N-Triples |
rdf | RDF/XML |
mr3 | MR^3 project |
Export Dialog¶
The users can export RDF(S) data graphs in MR3 to an RDF(S) document as Turtle, JSONLD, RDF/XML, N-Triples, or mr3 syntax by using the Export Dialog. Fig. 43 shows a screenshot of the Export Dialog. The users can open Export Dialog by clicking [Save As] sub menu in the [File] menu or clicking icon in the Toolbar.
First, select a file that the users want to save. Then, select a file format from the [Files of Type]. Finally, select [Save] button. If the users select [All Files] from the [Files of Type], the file format is automatically detected from the extension of the file.
Option Dialog¶
The users can set configurations about [Base], [Meta Class], [Layout], and [Rendering] in the Option Dialog.
Base¶
When the users select the [Base] item as shown in Fig. 44, language, UI language, base URI, work directory, and proxy can be set. If a resource has many multilingual labels, the users should select the prior language. The prior language of labels can be set in the [Lang] text field. Labels with prior language are shown in each resource when the user select View->label menu. Language of UI such as menu can be set in the [UILang] combobox. The users can select ja (Japanese), en (English), or zh (Chinsese) from the [UILang] combobox. Default namespace is set based on the [Base URI]. The work directory is a directory that is opened firstly when the users import an RDF(S) document. When the users check [Proxy] checkbox, a host name and a port number of a proxy server can be set. This configuration is necessary to import an RDF(S) document from a URI when the user’s environment is under a proxy server.
Meta Class¶
When the users select the [Meta Class] item as shown in Fig. 45, [Class Class] and [Property Class] can be set. If the users set a Class Class, MR3 regards resources that have the Class Class as their type as classes. If the users set a Property Class, MR3 regards resources that have the Property Class as their type as properties. These classes and properties are imported in the Class Editor or Property Editor.
In the initial setting, rdfs:Class is defined in Class Class and rdf:Property is defined in Property Class. If the users would like to import OWL classes and properties, owl:Class must be set as Class Class, owl:ObjectProperty and owl:DatatypeProperty must be set as Property Class.
Layout¶
When the users select the [Layout] item as shown in Fig. 46, methods for layout for each editor can be set.
Rendering¶
When the users select the [Rendering] item as shown in Fig. 47, the colors (text display color, background color, selected background color, line color, and selected line color) for the data graph components (RDF resources, RDF properties, RDF literals, classes, properties, editors) in each editor can be set. Check the [Black-and-White] checkbox to change all colors to black and white. Check [Antialias] to make jaggies (pixel jagged) less noticeable. You can reset the colors of all elements to their initial values by pressing the [Set Default Colors] button.
RDF Source Code Viewer¶
When the users select [RDF Source Code Viewer] sub menu in the [Tool] menu, the dialog as shown in Fig. 48 is shown. The [RDF Source Code Viewer] can output the RDF model constructed by each editor with the specified syntax. The syntax can be selected from Turtle, JSONLD, XML, or N-Triples.
SPARQL Query Dialog¶
When the users select [SPARQL Query Dialog] sub menu in the [Tool] menu, the dialog as shown in Fig. 49 is shown. In the [SPARQL Query Dialog], enter the SPARQL SELECT query in the [SPARQL Query] text area and press the [Run Query] button to display the search results of the variable specified in [Query Results]. Selecting a resource or literal in the the [Query Results] selects the corresponding resource or literal on each graph.
Validator¶
When the users select [Validator] sub menu in the [Tool] menu, the dialog as shown in Fig. 50 is shown. MR3 uses Apache Jena’s validation API (org.apache.jena.reasoner.ValidityReport ) and it is enabled to check if the data type of literals are defined based on a range of property.
Project Info¶
When the users select [Project Info] sub menu in the [Tool] menu, the dialog as shown in Fig. 51 is shown. The current project name, the number of RDF resources, the number of RDF literals, the number of RDF statements, the number of classes, the number of properties, the number of all resources, the number of all literals, the number of all statements are shown in the dialog.
History Manager¶
When the users select Show [History Manager] sub menu in the [Tool] menu, the dialog as shown in Fig. 52 is shown. In [History Manager], the operation history performed on each editor is displayed. The users can restore the selected history by selecting one of the history and press the [Open History] button.
Log Console¶
When the users select Show [Log Console] sub menu in the [Tool] menu, the dialog as shown in Fig. 53 is shown. The users can confirm the standard output and the standard error in the dialog.
About MR^3¶
When the users select About [MR^3] sub menu in the [Help] menu, the dialog as shown in Fig. 54 is shown. The developer, version, license, project web site, contact, and libraries used in MR3 are shown in the dialog.
Toolbar¶
Icon | Function |
---|---|
![]() |
New MR3 project |
![]() |
Open MR3 project file |
![]() |
Save MR3 project file |
![]() |
Save as MR3 project file |
![]() |
Show Resource Search Dialog |
![]() |
Show RDF Editor Overview to the front |
![]() |
Show Class Editor Overview to the fornt |
![]() |
Show Property Editor Overview to the front |
![]() |
Show Attribute Dialog to the front |
![]() |
Show Namespace Table to the front |
![]() |
Show Class, Property, and RDF editors |
![]() |
Show Class and RDF editors |
![]() |
Show Property and RDF editors |
![]() |
Show RDF source codes |
![]() |
Validate RDFs contents |
![]() |
Show Project Information |
![]() |
Show History Manager |
![]() |
Show Log Console |
![]() |
Show Option Dialog |
![]() |
Show about MR3 |
Shortcut keys¶
Shortcut keys that can be used in MR3 ¶
Shortcut keys | Description |
---|---|
Ctrl + N | Command + N | Create new MR3 project. The users should select save the current project or delete it. |
Ctrl + O | Command + O | Open MR3 project file. |
Ctrl + S | Command + S | Save MR3 project file. |
Ctrl + Shift + S | Command + Shift + S | Save as MR3 project file. |
Ctrl + Q | Command + Q | Quit MR3 . |
Ctrl + Shift + A | Command + Shift + A | Show the Attribute Dialog. |
Ctrl + Shift + N | Command + Shift + N | Show the Namespace Table. |
Ctrl + 1 | Command + 1 | Show Class, Property, and RDF editors. |
Ctrl + 2 | Command + 2 | Show Class and RDF editors. |
Ctrl + 3 | Command + 3 | Show Property and RDF editors. |
Ctrl + R | Command + R | Show the RDF Source Code Viewer. |
Ctrl + F | Command + F | Show the Find Resource Dialog. |
Ctrl + Shift + F | Command + Shift + F | Show the SPARQL Query Dialog. |
Ctrl + Shift + V | Command + Shift + V | Validate RDF graphs. |
Ctrl + Shift + M | Command + Shift + M | Show the Project Information Dialog. |
Ctrl + Shift + L | Command + Shift + L | Show the Log console. |
Ctrl + Shift + H | Command + Shift + H | Show the History Manager. |
Ctrl + Shift + O | Command + Shift + O | Show the Option Dialog. |
F1 | Show about MR3 . |
Shortcut keys that can be used in editors¶
Shortcut key | Description |
---|---|
Ctrl + I | Command + I | Insert an resource. |
Ctrl + L | Command + L | Insert a literal. |
Ctrl + A | Command + A | Select all of the nodes in a editor. |
Delete | Delete selected nodes in a editor. |
Ctrl + C | Command + C | Copy selected nodes in a editor. |
Ctrl + X | Command + X | Cut selected nodes in a editor. |
Ctrl + V | Command + V | Paste nodes that are copied or cut. |
Tutorial¶
Contents
Overview¶
In this tutorial, we build an RDF(S) document that is introduced in RDF Primer by using MR3 .
There are two ways to build RDF(S) documents by using MR3 . One is a top down method. In the top down method, the users firstly build RDFS contents and then build RDF contents by using classes and properties defined in the RDFS contents. The users can also use an existing RDFS document by importing the document into MR3 .
The other is a bottom up method. In the bottom up method. the users can create RDFS classes and properties when they build RDF contents by using RDF(S) contents management facilities.
In this tutorial, we introduce how to build up the RDF(S) document shown below using top down and bottom up methods. You can also check how to build the RDF(S) document from the videos page in the MR3 web site.
BASE <http://example.org/>
PREFIX bob: <http://example.org/bob#>
PREFIX alice: <http://example.org/alice#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX schema: <http://schema.org/>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX wd: <http://www.wikidata.org/entity/>
bob:me
a foaf:Person ;
foaf:knows alice:me ;
schema:birthDate "1990-07-04"^^xsd:date ;
foaf:topic_interest wd:Q12418 .
wd:Q12418
dcterms:title "Mona Lisa" ;
dcterms:creator <http://dbpedia.org/resource/Leonardo_da_Vinci> .
<http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619>
dcterms:subject wd:Q12418 .
Building an RDF(S) document by the top down method¶
1. Registering prefixes and namespaces that are used in the RDF(S) document¶
At the begininng, the users should register prefixes and the corresponding namespaces in the [Namespace Table] to build the RDF(S) document. The [Namespace Table] can be shown by selecting icon in the toolbar or selecting [Namespace Table] sub menu in the [Window] menu. Fig. 55 shows the correspondence between the namespace prefixes and the namespaces shown below registered in the [Namespace Table]. The namespace prefixes mr3, rdf, rdfs and owl are registered in the initial state.
When the users input a prefix in the [Prefix] text field, input a namespace in the [NameSpace] textfield, and select [Add] button, they are registered in the [Namespace Table]. Prefixes and namespaces can be used to create resources (RDF resources, RDF properties, RDFS classes, and RDFS properties).
Prefix | Namespace |
---|---|
mr3 | http://mrcube.org# |
rdf | http://www.w3.org/1999/02/22-rdf-syntax-ns# |
rdfs | http://www.w3.org/2000/01/rdf-schema# |
owl | http://www.w3.org/2002/07/owl# |
foaf | http://xmlns.com/foaf/0.1/ |
schema | http://schema.org/ |
dcterms | http://purl.org/dc/terms/ |
wd | http://www.wikidata.org/entity/ |
bob | http://example.org/bob# |
alice | http://example.org/alice# |
2. Inserting an RDFS class¶
In this step, we insert foaf:Person class in the Class editor.
First, when the users click a right mouse button in the Class Editor, a popup menu is shown (Fig. 56). An RDFS class can be iserted by selecting [Insert Class] menu in the popup menu.
In the example RDF(S) document, foaf:Person class is the type of bob:me resource. In MR3 , a type of an RDF resource can be selected from classes in the Class editor. Therefore, in order to select the type of the RDF resource, foaf:Person class must be defined before creating the RDF resource by the top down method.
After selecting [Insert Class] menu, [Insert Class] dialog is shown (Fig. 57). The RDFS class (foaf:Person) is inserted by selecting foaf prefix from the [Prefix] combobox, inputting Person in the [ID] text field, and selecting the [OK] button.
3. Inserting RDFS properties¶
In this step, insert RDFS properties in the example RDF(S) document (foaf:knows, schema:birthDate, foaf:topic_interest, dcterms:title, dcterms:creator, dcterms:subject).
When the users click a right mouse button in the Property Editor, a popup menu is shown. After selecting [Insert Proerty] menu, the [Insert Property] dialog is shown (Fig. 58). An RDFS property is inserted by selecting a prefix from the [Prefix] combobox, inputting id in the [ID] text field, and selecting the [OK] button.
In MR3 , an RDF property can be selected from the properties in the Property Editor. Therefore in order to select an RDF property, the corresponding RDFS property must be defined before using the RDF property by the top down method.
Fig. 58 shows a dialog when the users insert foaf:knows property in the Property Editor.
Fig. 59 shows a screenshot after inserting foaf:Person class in the Class Editor, and foaf:knows, schema:birthDate, foaf:topic_interest, dcterms:title, dcterms:creator, dcterms:subject properties in the Property Editor.
4. Inserting RDF resources¶
In the following steps, we build RDF contents based on the RDFS class and the RDFS properties built by above steps.
First, insert an RDF resource in the RDF Editor. When the users click a right mouse button in the RDF Editor, a popup menu is shown. Fig. 60 shows a screenshot showing the popup menu.
After selecting [Insert RDF Resource] menu, the [Insert RDF Resource] dialog is shown (Fig. 61). A type of an RDF resource can be selected from [Resource Type] combobox. Types of RDF resources can be selected from RDFS classes in the Class Editor. Here, select foaf:Person class as a type of an RDF resource. Then, input http://example.org/bob#me in the [RDF Resource] text field. The RDF resource is inserted after selecting the type of the RDF resource, inputting the URI of the RDF resource, and select the [OK] button.
In the same way, insert alice:me, wd:Q12418, http://dbpedia.org/resource/Leonardo_da_Vinci, http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619 as RDF resources in the RDF Editor. Select empty as the type of resources.
5. Inserting RDF literals¶
In this step, insert “1990-07-04”^^xsd:date と “Mona Lisa” RDF literals in the RDF Editor.
When the users click a right mouse button in the RDF Editor and select [Insert Literal] menu in the popup menu (Fig. 62), the [Insert Literal] dialog is shown.
Fig. 63 shows the [Insert Literal] dialog. An RDF literal is inserted after inputting strings in the [Literal] text area and selecting [OK] button. When the users check the [Data type] checkbox, a data type of a literal can be selected from the [Data type[ combobox. Here, select http://www.w3.org/2001/XMLSchema#date (xsd:date) as the data type of “1990-07-04” literal.
6. Inserting RDF properties¶
In this step, insert RDF properties in the RDF Editor. First, move the mouse cursor to the center of a source (subject) RDF resource. At that time, the shape of mouse cursor changes from arrow to cross. After that, drag the mouse cursor to the center of a target (object) RDF resource or RDF literal. When the shape of mouse cursor changes from arrow to cross, drop the mouse cursor. Then, two nodes are connected with an RDF property. If the users do not select one of the RDFS properties in the Property Editor, the RDF property becomes mr3:nil which is the default RDF property in MR3 . If the users select one of the RDFS properties, the selected RDFS property is used for the RDF property.
Here, connect bob:me RDF resource and alice:me RDF resource with foaf:knows RDF property. Fig. 64 shows the screenshot of connecting these nodes.
In the same way,connect bob:me RDF resourcre and “1990-07-04” literal with schema:birthDate property. Connect bob:me RDF resource and wd:Q12418 RDF resource with foaf:topic_interest property. Connect wd:Q12418 RDF resource and http://dbpedia.org/resource/Leonardo_da_Vinci RDF resource with dcterms:creator property. Connect wd:Q12418 RDF resource and “Mona Lisa” literal with dcterms:title property. http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619 RDF resource and wd:Q12418 RDF resource with dcterms:subject property.
In order to edit an RDF property, the [Attribute Dialog] is used. The [Attribute Dialog] is shown by clicking icon in the toolbar or selecting [Attribute Dialog] menu in the popup menu in the RDF Editor.
Fig. 65 shows a screenshot of the [Attribute Dialog] when the users select foaf:knows RDF property. An RDF property can be edited by selecting a prefix from the [Prefix] combobox, selecting an id from [Property ID] list, and selecting [Apply] button.
7. Exporting the RDF contents as an RDF(S) document¶
Finally, export the RDF contents as an RDF(S) document.
As a result, the following RDFS classes, RDFS properties, and an RDF model are created in each editor (Fig. 66).
To see how the RDF(S) contents you created is output, show the RDF Source Code Viewer. Fig. 67 shows a screenshot of the RDF Source Code Viewer. The [RDF Source Code Viewer] is shown by clicking icon in the toolbar or selecting [RDF Source Code Viewer] sub menu on the Tools menu. The users can select Turtle, JSONLD, XML, and N-Triples formats as the syntax from the radio button. Selecting the radio button will display the RDF source code with the specified syntax.
If the users want to output the created RDF(S) content to a file, select the [Save As] button on the [File] menu. Then, [Save] dialog is shown (Fig. 68). Select the folder the users want to save, select an RDF format from [Files of Type] combobox, and press the [Save] button, the RDF(S) content will be saved to the file in the specified format. Here, select [Turtle(*.ttl)] to save the RDF(S) content as Turtle format.
Building an RDF(S) document by the bottom up method¶
1. Registering prefixes and namespaces that are used in the RDF(S) document¶
This step is same as the step1 in the top down method.
2. Inserting RDF resources and creating an RDFS class¶
This step is almost same as the step4 in the top down method.
The difference is the type of bob:me resource is not defined in the Class Editor at this time. In the bottom up method, the users can create an RDFS class while editing an RDF resource.
The attributes of bob:me resource are shown in the [Attribute Dialog] by selecting the resource and showing the [Attribute Dialog]. Then, select [Resource Type] item in the left side list. After that, [Resource Type] checkbox, select foaf from the [Prefix] combobox, and input Person in the [Resource Type ID] text field. If the selected class is defined in the Class Editor, the selected class can be set as a type of the RDF resource. In this case, since the selected class (foaf:Person) is not defined in the Class Editor, the selected class can not be set as the type of the RDF resource in this state. In this situation, MR3 performs an RDF(S) management facility to maintain consistency. When the users click [Apply] button in the [Attribute Dialog], the [RDF(S) management] dialog is shown (Fig. 69).
If the users click the [Yes] button in the [RDF(S) management] dialog, foaf:Person class is created in the Class Editor as shown in Fig. 70.
3. Inserting RDF literals¶
This step is same as the step5 in the top down method.
4. Inserting RDF properties¶
This step is almost same as the step6 in the top down method.
The difference is RDFS properties are not defined in the Property Editor at this time. In the bottom up method, the users can create an RDFS property while editing an RDF property. Here, we would like to explain how to create foaf:knows property by the bottom up method.
First, select the RDF property which connects bob:me and alice:me RDF resources and show the Attribute Dialog. At this time, the RDF property is mr3:nil property.
Then, select foaf prefix in the [Prefix] combobox. Since there are no Ids in the [Property ID] list, input knows in the [ID] text field and click [Apply] button. Then, the [RDF(S) management] dialog is shown to maintain the consistency. Fig. 71 shows a screenshot when the users input knows in the [ID] text field and click the [Apply] button.
If the users click the [Yes] button in the [RDF(S) management] dialog, foaf:knows property is created in the Property Editor as shown in Fig. 72.
Create schema:birthDate, foaf:topic_interest, dcterms:title, dcterms:creator, and dcterms:subject properties in the same way.
5. Exporting the RDF(S) contents as an RDF(S) document¶
This step is same as the step7 in the top down method.