Disjoint Classes with InfixOWL

26 views
Skip to first unread message

John Thompson

unread,
Dec 18, 2012, 5:25:20 PM12/18/12
to fuxi-di...@googlegroups.com
I have some code where I create some InfixOWL classes and then declare them mutually disjoint.  It looks something like this:

from rdflib.Graph import Graph
from rdflib.Collection import Collection
from FuXi.Syntax.InfixOWL import Class
from RDFClosure.AxiomaticTriples import AllDisjointClasses, members

g = Graph()
Class.factoryGraph = g

# do a loop where I create some InfixOWL Classes and put them in a list called "disjoint_classes"

anode = BNode()
bnode = BNode()
tp_coll = Collection(g, anode, disjoint_classes)
g.add( ( bnode, RDF.type, AllDisjointClasses ) )
g.add( ( bnode, members, anode ) )


Then I do g.serialize(format="pretty-xml").
Now, the problem I have is that it creates a bunch of lists in the OWL XML, like:

 <rdf:Description rdf:nodeID="xRosKEXD963">
    <rdf:first rdf:resource="http://www.example.com/ontology#SomeClass1"/>
    <rdf:rest rdf:parseType="Collection">
      <rdf:Description rdf:about="http://www.example.com/ontology#SomeClass2"/>
      ...

I didn't need all these list items enumerated.  I just wanted the part that says:

<owl:AllDisjointClasses>
    <owl:members rdf:parseType="Collection">
    ...

Why do I get all this extra stuff that I don't need, making my OWL XML file much more huge than it needs to be?


Chime Ogbuji

unread,
Dec 20, 2012, 8:37:59 PM12/20/12
to fuxi-di...@googlegroups.com
Hey John.

The issue is with the rdflib library you are using FuXi with, not FuXi itself.  How did you install the rdflib library you are using in your code below?  
-- 
Chime Ogbuji
Sent with Sparrow

John Thompson

unread,
Dec 22, 2012, 12:49:47 PM12/22/12
to fuxi-di...@googlegroups.com
I used easy_install like this:

easy_install -U "rdflib<3a"
Reply all
Reply to author
Forward
0 new messages