Closed balhoff closed 13 years ago
Interesting, as I've done a lot of OWL generation as well, and hadn't noticed the problem.
Indeed, processors should tolerate extra triples, as it's not unusual for processors to generate extra triples, however, I don't see why this one would be generated. It must be a problem with accounting for blank nodes consumed during hierarchical output.
Thanks for the bug report!
This is fixed in 0.3.1, which I just pushed to RubyGems. I did more refactoring of predicate writing.
Thanks for the quick fix! I wrote a small test file to check the results and now I'm seeing an exception during serialization. However I get the same error when using 0.3.0, so I opened a new issue (#6).
I am trying to create some OWL content using RDF.rb. When I output using rdf-rdfxml, extra blank nodes are left behind. I think this is the result of conversion of RDF lists to parseType="Collection". The RDF output is valid but the unneeded blank nodes cause a problem for the Java OWL-API parser. Perhaps it should be more lenient, but I wondered if it was a bug in rdf-rdfxml that these blank nodes are left behind. Here are N-triples for a test graph followed by the output from rdf-rdfxml (the extra blank node is ):
N-triples: http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://www.w3.org/2002/07/owl#Class . :g2189674740 http://www.w3.org/1999/02/22-rdf-syntax-ns#rest :g2189669720 . :g2189674740 http://www.w3.org/1999/02/22-rdf-syntax-ns#first . :g2189674740 http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://www.w3.org/1999/02/22-rdf-syntax-ns#List . http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://www.w3.org/2002/07/owl#Class . :g2189669720 http://www.w3.org/1999/02/22-rdf-syntax-ns#rest http://www.w3.org/1999/02/22-rdf-syntax-ns#nil . :g2189669720 http://www.w3.org/1999/02/22-rdf-syntax-ns#first . :g2189669720 http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://www.w3.org/1999/02/22-rdf-syntax-ns#List . :g2189589100 http://www.w3.org/2002/07/owl#intersectionOf :g2189588440 . :g2189589100 http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://www.w3.org/2002/07/owl#Class . :g2189588440 http://www.w3.org/1999/02/22-rdf-syntax-ns#rest :g2189583420 . :g2189588440 http://www.w3.org/1999/02/22-rdf-syntax-ns#first . :g2189588440 http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://www.w3.org/1999/02/22-rdf-syntax-ns#List . :g2189609980 http://www.w3.org/2002/07/owl#someValuesFrom . :g2189609980 http://www.w3.org/2002/07/owl#onProperty .
:g2189609980 http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://www.w3.org/2002/07/owl#Class .
:g2189609980 http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://www.w3.org/2002/07/owl#Restriction .
:g2189583420 http://www.w3.org/1999/02/22-rdf-syntax-ns#rest http://www.w3.org/1999/02/22-rdf-syntax-ns#nil .
:g2189583420 http://www.w3.org/1999/02/22-rdf-syntax-ns#first :g2189609980 .
:g2189583420 http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://www.w3.org/1999/02/22-rdf-syntax-ns#List .
:g2189675400 http://www.w3.org/2002/07/owl#intersectionOf :g2189674740 .
_:g2189675400 http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://www.w3.org/2002/07/owl#Class .