Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Person-with-address Example Context Ontology"

m (Example Context Ontology moved to Person-with-address Example Context Ontology)
(No difference)

Revision as of 17:54, 29 September 2006

Let's imagine a Context whose domain involved things (or more precisely Digital Subjects) called Persons. Each Person has a surname, first name and a postal address. And let's say that this postal address is something that could be described in XML schema as:

<xsd:complexType name="postalAddress">

 <xsd:sequence>
  <xsd:element name="streetAddress" type="xsd:string" />
  <xsd:element name="city" type="xsd:string" />
  <xsd:element name="state" type="xsd:string" />
  <xsd:element name="postalCode" type="xsd:integer" minOccurs="0" />
  <xsd:element name="country" type="xsd:string" minOccurs="0" />
 </xsd:sequence>
</xsd:complexType>

For the sake of simplicity, we are going to side-step best practice and not model what in IdAS is called the "source" of these attributes. As far as we are concerned these attributes came out of thin air.

The first thing a Context Provider needs to do is declare the ontology that will provide the language in which to describe instances of Persons along with their associated simple attributes (surname and first name) and compound attributes (postal address). The OWL file that does this is called "jim2.owl" here. You'll notice that like all Context ontologies, it includes near the top an "import" statement that imports the required base higgins.owl ontology. This "jim" ontology is so long and tedious, that instead of including it inline, we show a couple of pretty pictures:

Jim dot owl.jpg

Jim dot owl 2.jpg

Context Providers are also responsible for being able to export the Contexts they manage. Here is an example of an export to RDF of a Context that contains one Person (Jim Sermersheim) and conforms to the jim.owl ontology. (In real usage the "file:///" shown below would be a URL):

<?xml version="1.0"?> <!DOCTYPE rdf:RDF [

   <!ENTITY higgins "http://www.eclipse.org/higgins/ontologies/2006/5/higgins">
   <!ENTITY owl "http://www.w3.org/2002/07/owl#">
   <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#">
   <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#">
   <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#">
   <!ENTITY jim "http://www.novell.com/jim#">

]> <rdf:RDF xmlns:higgins="http://www.eclipse.org/higgins/ontologies/2006/5/higgins#" xmlns:jim="http://www.novell.com/jim#" xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">

   <rdf:Description rdf:about="urn:unnamed-1">
       <rdf:type>
           <rdf:Description rdf:about="&owl;Ontology"/>
       </rdf:type>
       <owl:imports>
           <rdf:Description rdf:about="file:///c:/jim.owl"/>
       </owl:imports>
   </rdf:Description>
   <rdf:Description rdf:about="urn:jim-sermersheim">
       <jim:firstname>Jim</jim:firstname>
       <jim:surname>Sermersheim</jim:surname>
       <jim:hasPostalAddress>
           <rdf:Description rdf:about="urn:jims-address"/>
       </jim:hasPostalAddress>
       <rdf:type>
           <rdf:Description rdf:about="&jim;Person"/>
       </rdf:type>
   </rdf:Description>
   <rdf:Description rdf:about="urn:jims-address">
       <jim:city>Provo</jim:city>
       <jim:postalCode>84605</jim:postalCode>
       <jim:state>Utah</jim:state>
       <jim:streetAddress>123 main street</jim:streetAddress>
       <rdf:type>
           <rdf:Description rdf:about="&jim;PostalAddress"/>
       </rdf:type>
   </rdf:Description>

</rdf:RDF>

Back to the top