semantic web - How to describe a property including inverseOf to an instance in OWL-RDF/XML syntax? -
i have object properties named employ , employedby inverse of each other. how give these properties instance? employ property:
<owl:objectproperty rdf:id="employ"> <rdf:type rdf:resource="http://rdf.pozitron.com/organizations/" /> <rdfs:domain rdf:resource="http://rdf.pozitron.com/organizations/"/> <rdfs:range rdf:resource="http://rdf.pozitron.com/people/"/> </owl:objectproperty> my employedby property:
<owl:objectproperty rdf:id="employedby"> <rdf:type rdf:resource="http://rdf.pozitron.com/people/" /> <owl:inverseof rdf:resource="#employ" /> <rdfs:domain rdf:resource="http://rdf.pozitron.com/people/"/> <rdfs:range rdf:resource="http://rdf.pozitron.com/organizations/"/> </owl:objectproperty> now how describe employ , employedby in instance? assume pozitron employs john , john employed pozitron.
<rdf:description rdf:about="http://rdf.pozitron.com/people/john"> <rdf:type rdf:resource="http://rdf.pozitron.com/people/"/> <person:personname>john</person:personname> <organization:organizationname>pozitron</organization:organizationname> </rdf:description>
it's easier author rdf in syntax turtle rdf/xml. data you've provided isn't enough work (e.g., base uri undefined). here's complete rdf/xml document data (note ex namespace):
<rdf:rdf xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:person="http://rdf.pozitron.com/people/" xmlns:organization="http://rdf.pozitron.com/organizations/" xml:base="http://example.org/" xmlns:ex="http://example.org/#"> <owl:objectproperty rdf:id="employ"> <rdf:type rdf:resource="http://rdf.pozitron.com/organizations/" /> <rdfs:domain rdf:resource="http://rdf.pozitron.com/organizations/"/> <rdfs:range rdf:resource="http://rdf.pozitron.com/people/"/> </owl:objectproperty> <owl:objectproperty rdf:id="employedby"> <rdf:type rdf:resource="http://rdf.pozitron.com/people/" /> <owl:inverseof rdf:resource="#employ" /> <rdfs:domain rdf:resource="http://rdf.pozitron.com/people/"/> <rdfs:range rdf:resource="http://rdf.pozitron.com/organizations/"/> </owl:objectproperty> <rdf:description rdf:about="http://rdf.pozitron.com/people/john"> <rdf:type rdf:resource="http://rdf.pozitron.com/people/"/> <person:personname>john</person:personname> <organization:organizationname>pozitron</organization:organizationname> </rdf:description> </rdf:rdf> in turtle, following, , several problems revealed:
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix ex: <http://example.org/#> . @prefix person: <http://rdf.pozitron.com/people/> . @prefix organization: <http://rdf.pozitron.com/organizations/> . @prefix owl: <http://www.w3.org/2002/07/owl#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . ex:employedby person: , owl:objectproperty ; rdfs:domain person: ; rdfs:range organization: ; owl:inverseof ex:employ . person:john person: ; organization:organizationname "pozitron" ; person:personname "john" . ex:employ owl:objectproperty , organization: ; rdfs:domain organization: ; rdfs:range person: . the problems here that:
employedby's inverseemploy, there's no property name,employ;- the property
employorganization - the property
employedbyperson johnhasorganizationname- there no organization
pozitron.
these easy fix in syntax. can add triples john employedby pozitron , pozitron employ john while we're doing this. end with:
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix ex: <http://example.org/#> . @prefix person: <http://rdf.pozitron.com/people/> . @prefix organization: <http://rdf.pozitron.com/organizations/> . @prefix owl: <http://www.w3.org/2002/07/owl#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . ex:employedby owl:objectproperty ; rdfs:domain person: ; rdfs:range organization: ; owl:inverseof ex:employ . organization:pozitron organization: ; organization:organizationname "pozitron" ; ex:employ person:john . person:john person: ; person:personname "john" ; ex:employedby organization:pozitron . ex:employ owl:objectproperty ; rdfs:domain organization: ; rdfs:range person: . we can see looks in rdf/xml converting back:
<rdf:rdf xmlns:ex="http://example.org/#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:person="http://rdf.pozitron.com/people/" xmlns:organization="http://rdf.pozitron.com/organizations/" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" > <rdf:description rdf:about="http://example.org/#employedby"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#objectproperty"/> <rdfs:domain rdf:resource="http://rdf.pozitron.com/people/"/> <rdfs:range rdf:resource="http://rdf.pozitron.com/organizations/"/> <owl:inverseof rdf:resource="http://example.org/#employ"/> </rdf:description> <rdf:description rdf:about="http://rdf.pozitron.com/organizations/pozitron"> <rdf:type rdf:resource="http://rdf.pozitron.com/organizations/"/> <organization:organizationname>pozitron</organization:organizationname> <ex:employ rdf:resource="http://rdf.pozitron.com/people/john"/> </rdf:description> <rdf:description rdf:about="http://rdf.pozitron.com/people/john"> <rdf:type rdf:resource="http://rdf.pozitron.com/people/"/> <person:personname>john</person:personname> <ex:employedby rdf:resource="http://rdf.pozitron.com/organizations/pozitron"/> </rdf:description> <rdf:description rdf:about="http://example.org/#employ"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#objectproperty"/> <rdfs:domain rdf:resource="http://rdf.pozitron.com/organizations/"/> <rdfs:range rdf:resource="http://rdf.pozitron.com/people/"/> </rdf:description> </rdf:rdf> if you're using owl reasoner can handle inverse properties, don't need write both john employedby pozitron and pozitron employ john; can write 1 , reasoner infer other.
Comments
Post a Comment