There seems to be a bug in pretty-xml.  It's not puting the right
contents in parsetype=Collection lists.

For example, using rdflib-2.4.0 I got this output in n3:

================================================================
@prefix _5: <http://example.com#>.
@prefix owl: <http://www.w3.org/2002/07/owl#>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.

 _5:A a owl:Class;
     owl:unionOf ( _5:B ). 

 _5:B a owl:Class;
     rdfs:subClassOf [ a owl:Restriction;
             owl:allValuesFrom _5:C;
             owl:onProperty _5:p1],
         _5:A. 

 _5:C a owl:Class. 

 _5:p1 a owl:ObjectProperty. 
================================================================

And in nt:

================================================================
<http://example.com#C> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 
<http://www.w3.org/2002/07/owl#Class>.
<http://example.com#B> <http://www.w3.org/2000/01/rdf-schema#subClassOf> 
_:fIYNVPxd4.
<http://example.com#B> <http://www.w3.org/2000/01/rdf-schema#subClassOf> 
<http://example.com#A>.
<http://example.com#B> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 
<http://www.w3.org/2002/07/owl#Class>.
<http://example.com#p1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 
<http://www.w3.org/2002/07/owl#ObjectProperty>.
<http://example.com#A> <http://www.w3.org/2002/07/owl#unionOf> _:fIYNVPxd3.
<http://example.com#A> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 
<http://www.w3.org/2002/07/owl#Class>.
_:fIYNVPxd4 <http://www.w3.org/2002/07/owl#allValuesFrom> 
<http://example.com#C>.
_:fIYNVPxd4 <http://www.w3.org/2002/07/owl#onProperty> <http://example.com#p1>.
_:fIYNVPxd4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 
<http://www.w3.org/2002/07/owl#Restriction>.
_:fIYNVPxd3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> 
<http://example.com#B>.
_:fIYNVPxd3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> 
<http://www.w3.org/1999/02/22-rdf-syntax-ns#nil>.
================================================================

and this output in pretty-xml:

================================================================
<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF
  xmlns:owl='http://www.w3.org/2002/07/owl#'
  xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
  xmlns:rdfs='http://www.w3.org/2000/01/rdf-schema#'
>
  <owl:Class rdf:about="http://example.com#C"/>
  <owl:Class rdf:about="http://example.com#B";>
    <rdfs:subClassOf>
      <owl:Restriction>
        <owl:allValuesFrom rdf:resource="http://example.com#C"/>
        <owl:onProperty rdf:resource="http://example.com#p1"/>
      </owl:Restriction>
    </rdfs:subClassOf>
    <rdfs:subClassOf>
      <owl:Class rdf:about="http://example.com#A";>
        <owl:unionOf rdf:parseType="Collection"/>
      </owl:Class>
    </rdfs:subClassOf>
  </owl:Class>
  <owl:ObjectProperty rdf:about="http://example.com#p1"/>
</rdf:RDF>
================================================================

Note the empty parseType="Collection", which should have #B in it.

This bug caused many hours of pain because, of course, I assumed the
error was in other parts of the system.  (in this case, some OWL logic.)

       -- Sandro

_______________________________________________
Dev mailing list
Dev@rdflib.net
http://rdflib.net/mailman/listinfo/dev

Reply via email to