Saturday, September 13, 2014

Explorations with Simple-Part Whole Relations


Following the link at http://www.w3.org/2001/sw/BestPractices/OEP/
SimplePartWhole/
simple-part-whole-relations-v1.3.html
we see that in section 3 we have a structure that represents 
faults in a car.
 
 
The structure is represented in the document in Turtle (*.ttl) as:

@prefix : <http: example.org="" stuff=""> .
@prefix rdf: <http: rdf-syntax-ns="" www.w3.org="">.
@prefix owl: <http: owl="" www.w3.org="">.

:Fault_in_car
  a  owl:Class ;
  owl:equivalentClass
    [ a  owl:Class ;
      owl:intersectionOf (:Fault [ a  owl:Restriction ;
         owl:onProperty :hasLocus ;
         owl:someValuesFrom
           [ a  owl:Class ;
             owl:unionOf (:Car [ a  owl:Restriction ;
               owl:onProperty :partOf ;
               owl:someValuesFrom :Car
            ])
         ]
       ])
    ] . 
Using the logic presented by tobyink in the IRC chat on #swig 
(http://chatlogs.planetrdf.com/swig/2014-09-06.html
we can parse the individual parts. We can look at the Turtle 
recommendation to understand the Turtle syntax  at  
http://www.w3.org/TR/turtle/
aand expand our understanding of the data structure using 
http://www.w3.org/TR/rdf-schema/ . We can convert .ttl to .owl 
using 
the comparisons given in the owl 2 primer
 http://www.w3.org/TR/2012/PER-owl2-primer-20121018/ .


An automated way that we can  convert the turtle (.ttl) file 
to owl (.owl) is by using the software
http://www.l3s.de/~minack/rdf2rdf/
We obtain: 

XML/RDF Node-Arc Graph in OWL (*.owl):

<rdf:rdf xmlns:owl="http://www.w3.org/2002/07/owl" xmlns:rdf=
"http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns=
"http://example.org/stuff/1.0/">

<rdf:description rdf:about="http://example.org/stuff/1.0/
Fault_in_car">
 <rdf:type rdf:resource="http://www.w3.org/2002/07/owlClass">
</rdf:type></rdf:description>

<rdf:description rdf:nodeid="node191bjrqejx1">
 <rdf:type rdf:resource="http://www.w3.org/2002/07/owlClass">
</rdf:type></rdf:description>

<rdf:description rdf:nodeid="node191bjrqejx2">
 <rdf:first rdf:resource="http://example.org/stuff/1.0/
Fault">
 <rdf:rest rdf:nodeid="node191bjrqejx3">
</rdf:rest></rdf:first></rdf:description>

<rdf:description rdf:nodeid="node191bjrqejx4">
 <rdf:type rdf:resource="http://www.w3.org/2002/07/
owlRestriction">
 <owlonproperty rdf:resource="http://example.org/stuff/1.0/
hasLocus" xmlns="http://www.w3.org/2002/07/">
</owlonproperty></rdf:type></rdf:description>

<rdf:description rdf:nodeid="node191bjrqejx5">
 <rdf:type rdf:resource="http://www.w3.org/2002/07/
owlClass">
</rdf:type></rdf:description>

<rdf:description rdf:nodeid="node191bjrqejx6">
 <rdf:first rdf:resource="http://example.org/stuff/1.0/
Car">
 <rdf:rest rdf:nodeid="node191bjrqejx7">
</rdf:rest></rdf:first></rdf:description>

<rdf:description rdf:nodeid="node191bjrqejx8">
 <rdf:type rdf:resource="http://www.w3.org/2002/07/
owlRestriction">
 <owlonproperty rdf:resource="http://example.org/stuff/
1.0/partOf" 
xmlns="http://www.w3.org/2002/07/">
 <owlsomevaluesfrom rdf:resource="http://example.org/stuff/
1.0/Car" 
xmlns="http://www.w3.org/2002/07/">
</owlsomevaluesfrom></owlonproperty></rdf:type>
</rdf:description>

<rdf:description rdf:nodeid="node191bjrqejx7">
 <rdf:first rdf:nodeid="node191bjrqejx8">
 <rdf:rest rdf:resource="http://www.w3.org/1999/02/
22-rdf-syntax-ns#nil">
</rdf:rest></rdf:first></rdf:description>

<rdf:description rdf:nodeid="node191bjrqejx5">
 <owlunionof rdf:nodeid="node191bjrqejx6" 
xmlns="http://www.w3.org/2002/07/">
</owlunionof></rdf:description>

<rdf:description rdf:nodeid="node191bjrqejx4">
 <owlsomevaluesfrom rdf:nodeid="node191bjrqejx5" 
xmlns="http://www.w3.org/2002/07/">
</owlsomevaluesfrom></rdf:description>

<rdf:description rdf:nodeid="node191bjrqejx3">
 <rdf:first rdf:nodeid="node191bjrqejx4">
 <rdf:rest rdf:resource="http://www.w3.org/1999/02/
22-rdf-syntax-ns#nil">
</rdf:rest></rdf:first></rdf:description>

<rdf:description rdf:nodeid="node191bjrqejx1">
 <owlintersectionof rdf:nodeid="node191bjrqejx2" 
xmlns="http://www.w3.org/2002/07/">
</owlintersectionof></rdf:description>

<rdf:description rdf:about="http://example.org/stuff/
1.0/Fault_in_car">
 <owlequivalentclass rdf:nodeid="node191bjrqejx1" 
xmlns="http://www.w3.org/2002/07/">
</owlequivalentclass></rdf:description>

</rdf:rdf> 

When we import this XML/RDF into the RDF validator we 
obtain for a node-arc graph the following 
diagram.  
 
 
 



 
 



 
 



 



 
 



 
 
 



 
 



 



 



 
 



 



 


 





 



 
 



 
 



 



 
 



 
 
 



 
 



 



 



 
 



 



 


 

1 comment:

  1. I was able to produce a visual representation of the graph, but I was unable to produce valid XML for the validator. So I cheated and used RDF2RDF to get correct input for the validator. My graph matched except that the validator was clever about using nodes like owl:class only once and then pointing multiple predicates to it. (http://www.w3.org/RDF/Validator/)

    ReplyDelete