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)
Line 1: Line 1:
 
Let's imagine a Context whose domain involved things (or more precisely [[Digital Subject]]s) 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:
 
Let's imagine a Context whose domain involved things (or more precisely [[Digital Subject]]s) 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:complexType name="postalAddress">
 
   <xsd:sequence>
 
   <xsd:sequence>
 
   <xsd:element name="streetAddress" type="xsd:string" />
 
   <xsd:element name="streetAddress" type="xsd:string" />
Line 13: Line 13:
 
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.
 
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" [http://spwiki.editme.com/files/ExampleContextOntology/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:
+
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).  
  
[[Image:jim dot owl.jpg]]
+
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 "person-with-address" ontology is so long and tedious, that instead of including it inline, we show a couple of pretty pictures:
  
[[Image: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):
+
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 (Mary) and conforms to the person-with-address ontology.  
  
<?xml version="1.0"?>
+
<rdf:Description rdf:about="urn:address">
<!DOCTYPE rdf:RDF [
+
  <pwa:city>Provo</pwa:city>
    <!ENTITY higgins "http://www.eclipse.org/higgins/ontologies/2006/5/higgins">
+
  <pwa:country>USA</pwa:country>
    <!ENTITY owl "http://www.w3.org/2002/07/owl#">
+
  <pwa:postalCode>12345</pwa:postalCode>
    <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+
  <pwa:state>Utah</pwa:state>
    <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#">
+
  <pwa:streetAddress>123 Main St.</pwa:streetAddress>
    <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#">
+
  <rdf:type>
    <!ENTITY jim "http://www.novell.com/jim#">
+
    <rdf:Description rdf:about="#PostalAddress"/>
]>
+
  </rdf:type>
<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:Description rdf:about="urn:unnamed-1">
+
<rdf:Description rdf:about="urn:mary">
        <rdf:type>
+
  <pwa:postalAdress>
            <rdf:Description rdf:about="&owl;Ontology"/>
+
    <rdf:Description rdf:about="urn:address"/>
        </rdf:type>
+
  </pwa:postalAdress>
        <owl:imports>
+
  <rdf:type>
            <rdf:Description rdf:about="file:///c:/jim.owl"/>
+
    <rdf:Description rdf:about="#Person"/>
        </owl:imports>
+
  </rdf:type>
    </rdf:Description>
+
</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>
+

Revision as of 18:03, 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).

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 "person-with-address" ontology is so long and tedious, that instead of including it inline, we show a couple of pretty pictures:


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 (Mary) and conforms to the person-with-address ontology.

<rdf:Description rdf:about="urn:address">
 <pwa:city>Provo</pwa:city>
 <pwa:country>USA</pwa:country>
 <pwa:postalCode>12345</pwa:postalCode>
 <pwa:state>Utah</pwa:state>
 <pwa:streetAddress>123 Main St.</pwa:streetAddress>
 <rdf:type>
   <rdf:Description rdf:about="#PostalAddress"/>
 </rdf:type>
</rdf:Description>
<rdf:Description rdf:about="urn:mary">
  <pwa:postalAdress>
    <rdf:Description rdf:about="urn:address"/>
  </pwa:postalAdress>
  <rdf:type>
    <rdf:Description rdf:about="#Person"/>
  </rdf:type>
</rdf:Description>

Back to the top