CC

RDF-G: An Extension Package of DLG2 for RDF/RDFS

by Xiaoshu Wang, Jonas S. Almeida

Overview

RDF-G is a default extension package of DLG2. This package is designed to simplify the graphical presentation of vocabularies specified in RDF and RDF Schema (RDFS). Please note that the purpose of this documentation is to define the graphic notation in DLG2 but not to redefine the semantics of the RDF vocabulary. As a general principle, the document do not descuss the semantics of RDF/RDFS term, for which users are encourage to read appropriateW3C's online documentations.

The rdf:type

Notation

rdf:type

RDF-G Definition 1: Symbol for rdf:type.

An rdf:type property is simplified as line with an open arrow head without any text label. (see RDF-G Definition 1)

Rationale

Please note the difference of the arrow head between the labeled edge and unlabeled type symbol. The difference seems not very obvious. An open arrow head is choosen over other shapes, such as a square or a diamond etc., is because of its simplicity. Also, under most circumstances, a rdf:type always points to a class definition.

The rdfs:Class

Notation

rdfs:Class

RDF-G Definition 2: Symbol for rdfs:Class.

An instance of an rdfs:Class is shown as a rectangle with double-line border. The URI or QName of the Class shall be placed inside the rectangle. (see RDF-G Definition 2)

An alternative representation of rdfs:Class is shown as a two compartmented rectangle. The top compartment is used to label the URI of the Class; The bottom compartment will be used for indicating its super class and instance. The usage is described in RDF-G Definition 7. If the superclass or type is unknown, the bottom compartment is left empty as shown above.

The rdf:Property

Notation

rdf:Property

RDF-G Definition 3: Symbol for rdf:Property

A property is shown as a wedge (see RDF-G Definition 3). The sides of a rdf:Property symbol was divided into range side and domain side (see the Figure 1). The domain side must be at the opposite side of range side. As a general rule, the longer side of the two opposite sides are the range side and the shorter side is the domain side (see Figure 1). By definition, the value of both rdfs:domain and rdfs:range must be an rdfs:Class. Since it is illegal in RDF to allow an rdf:Property to have property. Thus, if other description needed to be made about the property, it will be self-obvious.

Domain and Range side of Property Symbol

Figure 1: Property symbol.

Example

The following example is synthesized from from RDF Primer:

ex:Person rdf:type rdfs:Class .
ex:author rdf:type rdf:Property .
ex:author rdfs:range ex:Person .
ex:Book rdf:type rdfs:Class .
ex:author rdfs:domain ex:Book .

The above RDF code (in Notation-3) states that the property ex:author has domain of ex:Book and its range is ex:Person. It is worth to note that an rdf:Property can have more than one range class. If that is the case, the leagle range will be the intersection of all the range.

Note
Changes has been made on the division of domain and range side since last version. Previous version only has one domain side but three range side. However, real world experience shows that it is sometime inconvenient to draw the graph especially for the vertical arrangement of diagram.
Example of using Property Symbol

Figure 2: An example of using property symbol

Presentation Option

There are alternative property notations that will be discussed in RDF-G Definition 8.

Individual

There is no special RDF definition for the concept of an individual, just like there is no RDF-definition of resource. Although the concepts of individual is not defined in RDF, it is nevertheless a very important conceptualization for RDF. The separation between individual and Class, i.e., if an individual is as well a Class, affects the tractability of reasoning against the RDF models. In the world of OWL-Lite and OWL-DL, for instance, the universe of discourse for owl:Class must be distinct from that of individual. Hence it is worth to give "individual" a special notation.

Notation

Symbols for individual

RDF-G Definition 4: Symbols for Individual in RDF.

An individual is represented as a two compartmented solid outlined rectangle with round corners. The top compartment is for placing the individual's URI; the bottom compartment, which is mandatory in order to avoid confusion with the shape of ellipse, is used to enter the type information. If the type compartment is empty, it is assumed to be an instance of rdfs:Resource.

Generalization

The concept of generalization is familar to those who are familar with the object oriented (OO) technology. Here we will adopt the UML's subclass symbol. It is worth to note, however, the semantic of rdfs:subClassOf in RDF and that in UML (Unified Modelling Language) is different. OO's concept of subClass is functional. It is based on the perspective of property and method inheritance. Although the RDF's subClass also implies the inheritence of property, its perspective is however based on model-theoretic semantics.

Notation

Symbols for subClassOf

RDF-G Definition 5: Generalization symbol for rdfs:subClassOf

Symbols for subPropertyOf

RDF-G Definition 6: Generalization symbol for rdfs:subPropertyOf

The generalization symbol is shown as a line with one end empty and the other with an emptied triangle arrowhead. The symbol is used to indicate both rdfs:subClassOf and rdfs:subPropertyOf. The empty end always connected to the entity being subsumed whereas the arrow head connects to the entity that subsumes.

Examples

The figure 18 of the RDF Primer can be simplified in DLG2 as shown in Figure 3.

Example of using generalization

Figure 3: An example showing the vehicle class hierarchy

Alternative Notation

Alternative subClassOf

RDF-G Definition 7: Alternative Class notation

Alternative subPropertyOf

RDF-G Definition 8: Alternative Notation for Property

The above two alternative definition is devised to shorthand the general representation of Class and Property. In addition to super Class or super Property information, the rdf:type information can also be shorthanded to place within a pair of angle braces in the bottom compartment.

Please note the different shape of the second compartment between a Class and a Property. It is designed in such to make consistent use of symbol. Think it in this way, the notation of the second compartment is still a Class and a Property, respectively. Therefore, the plain string should be the URI of a property as well. The type information however must be treated differently. Angle bracket is used because it is conventionally used to note the datatype.

If more than one superClass or type needs to be entered, the URI or QName shall be separated by comma. Using comma separated list is consistent with the use of comma in Notation 3, i.e., they only differ in the "object" of the statement. For instance, the ex:MiniVan shown in the earlier example can be represented by Figure 4.

Example ex:MiniVan

Figure 4: Simple generalization

Alternative presentation options

Note the text pad rule defined DLG2 always applies. A text pad can be attached to the Class symbol for text based description in Notation-3. The definition of rdfs:Class itself can be expressed in three different notations shwon in Figure 5.

Examples of rdfs:Class definition

Figure 4: Definition of rdfs:Class.

The semantics of all the above three representations are same. The difference is the emphasize. The first two notation are intended to express the subsume relation whereas the last one for type information.

Reification

Notation

Notation for Reification

RDF-G Definition 9: Reification

An RDF Reification is shown as a dashed line connecting an rdf:Statement to the object of rdfs:predicate with the end crossed by a line. The cross end shall be connected to the statement resource (see RDF-G Definition 9). Please note the object of rdf:subject, rdf:predicate and rdf:object are labeled with dashed outline instead of the usual solid lines. The reason for such a design is due to the fact that RDF has no way to associate a reification statement to an instance of a triple in an RDF document (See RDF Primer section 4.3). Therefore, it is possible that an rdf:Statement is made to say s-p-o while there is an assertion for the same statement. In the later case, we need to make the statement related resource's outline solid to indicate the difference.

Rationale

The introduced notation doesn't seem to simplify the presentation to a great extent. But the semantics is now much more obvious than the original notation. Also, by following the same convention as the s-p-o triple, all user-customized notation can also be used as part of reification. For instance, a reification statement of the follow:

ex:triple1 rdf:type rdf:Statement

ex:triple1 rdf:subject ex:Truck

ex:triple1 rdf:predicate rdf:type

ex:triple1 rdf:object rdfs:Class

can be denoted graphically as shown in Figure 6.

Reification Example

Figure 6: Example reification

Structured value

Notation

Notation for structured value

RDF-G Definition 10: Structured data with rdf:value

As discussed in Section 4.4 of RDF primer, there are often needs to describe structured data with a main value which is often labeled with an rdf:value. However, under most circumstances we don't want to assign a URI to an annoymous entity which sole purpose is to create an association. Hence, in RDF/XML a syntax of rdf:parseType="Resource can be used as an attribute to shorthand the description. Here we also devised a shorthand notation by using an ellipse divided in half (see RDF-G Definition 10). The left half is used to write the literal value with proper datatype. The right half is used to write other property value such as "unit" etc. To indicate the property type, we follow the same convention as N3, so the property is indicated by "^" to indicate a backward traversal.

Examples

The following example is from example 21 of RDF primer

<?xml version="1.0"?>
<!DOCTYPE rdf:RDF [<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#">]>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:exterms="http://www.example.org/terms/">
  <rdf:Description rdf:about="http://www.example.com/2002/04/products#item10245">
    <exterms:weight rdf:parseType="Resource">
      <rdf:value rdf:datatype="&xsd;decimal">2.4</rdf:value>
      <exterms:units rdf:resource="http://www.example.org/units/kilograms"/>
    </exterms:weight>
>  </rdf:Description> </rdf:RDF>

can be described as shown in Figure 7

Structured data example

Figure 7: Structured value

List symbols

List is an often used construct with a very verbose presentation syntax. It is therefore very necessary to define a short hand for it.

Notation

RDF-G Definition 11: List symbol

RDF-G Definition 12

An instance of rdf:List is represented as the combination of a rectangle with a square (see RDF-G Definition 11). The rectangle is used to enter the URI of this list and the square is used to put some arbitrary letters as a label. The list elements are connected with an open arrowed line with arrow place in the middle, but not at the end of line. Each line is labeled with the same label in the box (see RDF-G Definition 12)

An alternative presentation is to draw lines directly from list to its member. But since rdf:List is by default an ordered list, we therefore must label the order of element. The convention employed in RDF-G is to label the lines with sequential number starting from 1 (see RDF-G Definition 12). If the author thinks the order of the list is not important, the number can be omitted.

Rationale

The reason to introduce a list label is to avoid confusions when an element is used by more than one list. For instance, without a list label, the example shown in Figure 8 will cause confusion regarding the membership of e4 and e5.

Figure 8: Hypothetical example that two lists share same resource as members.

Describing List with Text Pad

If to follow the RDF/XML syntax exactly, the list is always a bit of clumpsy to represent in diagram. This is actually the ideal case when text is simpler and much more straight forward than diagram. The simplest way to represent a list is to use a Text Pad. The list syntax for the notation-3 is to use a space delimited list within a parenthesis. For instance, the Figure 16 of RDF Primer can be simply represented as Figure 9

Figure 9

The rdfs:label

Notation

RDF-G definition 13

RDF-G Definition 13: Label

The value of rdfs:label is included in the URI compartment and placed behind the URI within a pair of parenthesis.

The rdfs:comments

Notation

Notation for rdfs:comment

RDF-G Definition 14: Comments

The notation of an RDF comment is the same as UML's comments. It is placed within a note symbol and connected to the resource via a dashed line.