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"

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, firstname 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">
Line 11: Line 11:
 
  </xsd:complexType>
 
  </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.
+
Note: 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).  
+
For this example we've created: http://www.eclipse.org/higgins/ontologies/person-with-address.owl The first part of the file is the ontology, the last part is the instance data.  
  
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 need 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). In this case the provider a person-with-address.owl ontology.
  
 +
You'll notice that like all Context ontologies, it includes near the top an "import" statement that imports the required base higgins.owl ontology.
  
 
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.  
 
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.  
Line 27: Line 28:
 
   <pwa:streetAddress>123 Main St.</pwa:streetAddress>
 
   <pwa:streetAddress>123 Main St.</pwa:streetAddress>
 
  </pwa:PostalAddress>
 
  </pwa:PostalAddress>
+
 
 
  <pwa:Person rdf:about="urn:mary">
 
  <pwa:Person rdf:about="urn:mary">
   <pwa:postalAdress>
+
   <pwa:postalAdress rdf:resource="urn:address"/>
    <rdf:Description rdf:about="urn:address"/>
+
  <pwa:firstname rdf:resource="urn:mary-firstname"/>
   </pwa:postalAdress>
+
   <pwa:surname rdf:resource="urn:mary-surname"/>
 
  </pwa:Person>
 
  </pwa:Person>
 +
 +
<higgins:NormalizedStringSimpleAttribute rdf:about="urn:mary-firstname">
 +
  <higgins:normalizedStringSimpleValue
 +
    rdf:datatype="&xsd;normalizedString">Mary</higgins:normalizedStringSimpleValue>
 +
</higgins:NormalizedStringSimpleAttribute>
 +
 +
<higgins:NormalizedStringSimpleAttribute rdf:about="urn:mary-surname">
 +
  <higgins:normalizedStringSimpleValue
 +
    rdf:datatype="&xsd;normalizedString">Ruddy</higgins:normalizedStringSimpleValue>
 +
</higgins:NormalizedStringSimpleAttribute>

Revision as of 18:24, 29 September 2006

Let's imagine a Context whose domain involved things (or more precisely Digital Subjects) called Persons. Each Person has a surname, firstname 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>

Note: 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 this example we've created: http://www.eclipse.org/higgins/ontologies/person-with-address.owl The first part of the file is the ontology, the last part is the instance data.

Context Providers need 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). In this case the provider a person-with-address.owl ontology.

You'll notice that like all Context ontologies, it includes near the top an "import" statement that imports the required base higgins.owl ontology.

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.

<pwa:PostalAddress 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>
</pwa:PostalAddress>
 
<pwa:Person rdf:about="urn:mary">
  <pwa:postalAdress rdf:resource="urn:address"/>
  <pwa:firstname rdf:resource="urn:mary-firstname"/>
  <pwa:surname rdf:resource="urn:mary-surname"/>
</pwa:Person>

<higgins:NormalizedStringSimpleAttribute rdf:about="urn:mary-firstname">
  <higgins:normalizedStringSimpleValue
    rdf:datatype="&xsd;normalizedString">Mary</higgins:normalizedStringSimpleValue>
</higgins:NormalizedStringSimpleAttribute>

<higgins:NormalizedStringSimpleAttribute rdf:about="urn:mary-surname">
  <higgins:normalizedStringSimpleValue
    rdf:datatype="&xsd;normalizedString">Ruddy</higgins:normalizedStringSimpleValue>
</higgins:NormalizedStringSimpleAttribute>

Back to the top