I have some code where I create some InfixOWL classes and then declare them mutually disjoint. It looks something like this:
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:rest rdf:parseType="Collection">
...
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?