On 9/17/07, Sandro Hawke <[EMAIL PROTECTED]> wrote: > > There seems to be a bug in pretty-xml. It's not puting the right > contents in parsetype=Collection lists.
Hello, Sandro. Thanks for the test content. This was also the cause of trouble for me with programmable APIs for OWL/RDF/XML. The problem was the recursive reference in that snippet of OWL/RDF/XML: <owl:Class rdf:about="http://example.com#B"> <rdfs:subClassOf rdf:nodeID="fIYNVPxd4"/> <rdfs:subClassOf> <owl:Class rdf:about="http://example.com#A"> <owl:unionOf rdf:parseType="Collection"> <rdf:Description rdf:about="http://example.com#B"/> </owl:unionOf> </owl:Class> </rdfs:subClassOf> </owl:Class> The serializer skipped B because it had "already been serialized." I added an additional collection of Collection items (these are forcibly serialized during the construction of rdf:parseType="Collection" statements. In addition, it uses the native rdflib.Collection library now. A test was checked in: trunk/test/rdf_lists.py It has to be run repeatedly, since there is no deterministic way to render it uniformly in RDF/XML. Eventually, you come across the combination which was exposing the bug, for which i now get: <?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:ObjectProperty rdf:about="http://example.com#p1"/> <owl:Restriction rdf:nodeID="fIYNVPxd4"> <owl:allValuesFrom> <owl:Class rdf:about="http://example.com#C"/> </owl:allValuesFrom> <owl:onProperty rdf:resource="http://example.com#p1"/> </owl:Restriction> <owl:Class rdf:about="http://example.com#B"> <rdfs:subClassOf rdf:nodeID="fIYNVPxd4"/> <rdfs:subClassOf> <owl:Class rdf:about="http://example.com#A"> <owl:unionOf rdf:parseType="Collection"> <rdf:Description rdf:about="http://example.com#B"/> </owl:unionOf> </owl:Class> </rdfs:subClassOf> </owl:Class> <rdf:Description rdf:about="http://example.com#B"/> <rdf:Description rdf:about="http://example.com#B"/> </rdf:RDF> Does this fix your problem? -- Chimezie _______________________________________________ Dev mailing list Dev@rdflib.net http://rdflib.net/mailman/listinfo/dev