Back to DAML homepage

DAML Instances

Contents

Setting Up Namespaces

A namespace in DAML+OIL referes to a schema or ontology, where terms associated with this namespace are defined. We introduce namespaces with XML elements, since XML entities can also be used in XML attribute values.

Thus, our example begins with an XML document tag and several XML entitties definitions

<?xml version='1.0' encoding='ISO-8859-1'?>
<!DOCTYPE rdf:RDF [
<!ENTITY rdf 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'>
<!ENTITY rdfs 'http://www.w3.org/2000/01/rdf-schema#'>
<!ENTITY dc 'http://purl.org/dc/elements/1.1/'>
<!ENTITY xsd 'http://www.w3.org/2000/10/XMLSchema#'>
<!ENTITY daml 'http://www.daml.org/2001/03/daml+oil#'> <!ENTITY dex 'http://www.daml.org/2001/03/daml+oil-ex#'>
<!ENTITY exd 'http://www.daml.org/2001/03/daml+oil-ex-dt#'> <!ENTITY swrc 'http://www.semanticweb.org/ontologies/swrc-onto-2000-09-10.daml#'> <!ENTITY stanfordksl 'http://www.ksl.stanford.edu/projects/DAML/ksl-daml-desc.daml#'> <!ENTITY shoepers 'http://www.cs.umd.edu/projects/plus/DAML/onts/personal1.0.daml#'>
<!ENTITY l 'http://www.daml.org/2001/03/daml+oil-ex#'>
]>

 

Our RDF Code itself starts with the usual rdf:RDF tag and the XML namspace declarations. The abbreviations following the ampersand (&) are replaced with the full namespace by the XML parser parsing the RDF document.

<rdf:RDF 
xmlns:rdf="&rdf;"
xmlns:rdfs="&rdfs;"
xmlns:dc="&dc;" xmlns:xsd="&xsd;" xmlns:daml="&daml;" xmlns:dex="&dex;" xmlns:exd="&exd;" xmlns:stanfordksl="&stanfordksl;" xmlns:shoepers="&showpers;" xmlns:swrc="&swrc;"
xmlns:l="&l;">

Please note that namespaces are just grouping identifiers for sets of vocabularies. It is not necessarily the case, the a namespace points to an ontology or schema defining the vocabulary of a certain namespace - although this is certainly a good practice to put a defining schema at the location defined by the namespace.

The namespaces introduced above in detail:

If you look at the bottom of this document, you'll see the matching closing tag, </rdf:RDF>

Defining Instances

Now we are ready to use the ontologies to define some data and knowledge.
At first we define a certain entity with a specific identifier and a certain set of properties.

Lets say, we are defining a person and some properties of a person. As every object in our universe, the object has an object identifier. An object identity means, every object with the same identifier is necessarily identical to the defined object. Lets first define a person. That means we would like to create a serialization of the graph below:

 

It contains a one node representing the object we are describing, labeled with urn:234253453452423, and another node representing typing information for the object, labeld with dex:Person.

The RDF code necessary to do this:

<dex:Person rdf:about="urn:234253453452423"/>

Now we are adding information to our example. Lets say we want to express, that the person has a specific email address. What we would like to achieve is the following graph:

 

There are multiple ways to create this graph. The simplest is to repeat the information we already stated, as in

<dex:Person rdf:about="urn:234253453452423">
	<swrc:email>jhendler@darpa.mil></swrc:email>
<dex:Person>

The above definition adds an swrc:email arc. However, this puts some redundancy to the definition. If we want to avoid the redundancy we also can reference the above mentioned definition.


   <rdf:description rdf:about="urn:234253453452423">
		<swrc:email>jhendler@darpa.mil></swrc:email>
   </rdf:description>
 

An more sophisticated graph is:

The RDF necessary to create the graph before is:

<dex:Person rdf:about="urn:234253453452423"> 
	<swrc:email>jhendler@darpa.mil></swrc:email>
	<shoepers:child>
		<swrc:Person>
			<swrc:homepage rdf:resource="http://www.cs.umd.edu/users/hendler/sharon.html"/>
    	<swrc:Person> 
	</shoepers:child>
</dex:Person>