Vocabulary File Structure

A vocabulary declared in RDF/XML format is made up of three sections: the prolog, the content header, and the content itself.

This page discusses:

Prolog

The prolog includes information that applies to the whole document such as the XML version, the character encoding and the document structure.

  • The XML version must be the first line in the document and no other content or white space can precede it.
  • The encoding declaration must appear immediately after the version information in the XML declaration.
  • The DOCTYPE declaration allows to identify the root element of the document and the related document type definition (DTD) by referencing an external file, through direct declarations, or both. A DOCTYPE declaration can contain:
    • The name of the root element. This is required if the DOCTYPE declaration is used.
    • A subset of DTD direct declarations listed between brackets ([ ]). Each declaration is an ENTITY definition with a prefix (string) of a namespace that refers to an external vocabulary content. The terms (or elements) of such external vocabulary is intended to be reused in the current vocabulary (acts like a C/C++ #include statement).

Example



Vocabulary Header

The vocabulary header starts with the root element <rdf: RDF> and a list of namespace declarations to be used with their prefixes.

In the example below, the following items are declared:

Example



In the above example:

  • The following items are declared:
    • all the prefixes of external vocabularies namespaces to be used in the defined vocabulary. Some are from standards like RDF and OWL, and one from DS, the ds6w vocabulary.
    • The base namespace of the defined vocabulary.
  • ds6w: Prefix used in the vocabulary to reference resources from the ds6w vocabulary.
  • http:**www.3ds.com/vocabularies/pno/: Namespace of the vocabulary.
  • pno: Short name of the vocabulary (pno) also used as prefix.

Vocabulary Content

The vocabulary content is defined as an ontology. The <owl:ontology> element must be used to declare a new vocabulary. Some attributes must also have been declared.

The following attributes must be declared for the new ontology:

  • rdf:about to specify the unique name of the vocabulary by giving its URI. The URI fragment is also used to give a human-readable name to the vocabulary. This name must be the same as the prefix declared in the header. In the example below, the short name of the vocabulary defined is pno.
  • rdfs:label to specify the NLS translation name of the vocabulary for a given language.
  • rdfs:comment to give a short description of the vocabulary.
  • owl:versionInfo to specify the release number of the vocabulary.


In the above example:

  • My Testing Vocabulary: A human-readable name for the vocabulary.
  • http:/www.3ds.com/vocabularies/sdm/: URI of this vocabulary (unique name). Must be ended with /.
  • sdm: Name of the vocabulary which will be used as the namespace prefix. It is recommended that you choose a short name.
  • 2015x: Version number of this vocabulary.
  • This ontology aims at testing: Short description of the vocabulary.
Tip: Use short names and lower-case letters when assigning a name to the vocabulary.

Predicate

This topic explains how to define a predicate (or property).

There are different constructs to define a predicate (or property):

  • In RDF, use rdf:Property to link an individual (instance or a class) to another individual or a data value (or a literal).
  • In OWL, two types of properties must be distinguished:
    • owl:ObjectProperty to link individuals to individuals.
    • owl:DatatypeProperty to link individuals to data values (literal)


If you do not know if the property is of data or object type, it is recommended that you use rdf:Property. Otherwise a specialized property class from OWL is more appropriate depending on the object type (individual or literal).

In all cases, a P2 property can derive from another P1 through the property rdfs:subPropertyOf to state that all resources related by P2 are also related by P1. The 6WTags predicates are structured by deriving all predicates from the 6W root predicates.

Example 1



In this example a ds6w property is defined as the instance of the rdf:Property class. This property is the sub-property of another one. In the above example:

  • originator: Local name of the predicate. URI is then ds6w:representedBy.
  • Originator: Human-readable name of the predicate.
  • rdfs:subPropertyOf: Used for predicates taxonomy.

Tips:
  • Use lower-case characters for predicate names (camel if many words), for example representedBy.
  • Use a verb to name ObjectProperty (for example implements) and a noun for DatatypeProperty (for example status)

Example 2



In the above example, &ds6w;what is the predicate that derives from the who basic predicate that is defined in the ds6w vocabulary.