You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//> using scala 2.13
//> using dep "net.sourceforge.owlapi:owlapi-distribution:4.5.25"
import org.semanticweb.owlapi.model._
import org.semanticweb.owlapi.apibinding.OWLManager
import org.semanticweb.owlapi.formats.TurtleDocumentFormat
import org.semanticweb.owlapi.formats.RioTurtleDocumentFormat
import scala.jdk.CollectionConverters._
import java.io.File
val factory = OWLManager.getOWLDataFactory()
val manager = OWLManager.createOWLOntologyManager()
val r = factory.getOWLObjectProperty(IRI.create("http://example.org/r"))
val A = factory.getOWLClass(IRI.create("http://example.org/A"))
val B = factory.getOWLClass(IRI.create("http://example.org/B"))
val C = factory.getOWLClass(IRI.create("http://example.org/C"))
val restriction = factory.getOWLObjectSomeValuesFrom(r, B)
val equiv = factory.getOWLEquivalentClassesAxiom(A, factory.getOWLObjectIntersectionOf(C, restriction))
val subClassOf = factory.getOWLSubClassOfAxiom(
A, restriction,
Set(factory.getOWLAnnotation(factory.getRDFSComment(), factory.getOWLLiteral("comment"))).asJava)
val ontology = manager.createOntology(Set[OWLAxiom](equiv, subClassOf).asJava)
manager.saveOntology(ontology, new TurtleDocumentFormat(), IRI.create(new File("test.ttl")))
manager.saveOntology(ontology, new RioTurtleDocumentFormat(), IRI.create(new File("test-rio.ttl")))
The shared node is referenced in three places in the output - two axioms, one of them with annotations. The annotation triggers reification, which is where the third reference appears.
The node triples are outputted twice - same in turtle as in rdf/xml.
This is redundant but, at the RDF level, it's just a repetition of the same triples (setting aside for a moment the impact on serialized histories).
It shouldn't make a difference to the parser. In fact, the rdf/xml parser copes with it. However, the Turtle parser doesn't like it - it doesn't expect an inline description with an id. Hard to change, as it's a JavaCC generated parser.
However, the solution needs to be that the extra triples aren't outputted. The fact that they're outputted twice, and not three times, suggests that the mechanism for deciding if the id gets generated and the one for deciding if the triples are outputted are getting tangled.
The text was updated successfully, but these errors were encountered:
Problem was not the desharing of nodes; rather, when a node is referred in multiple places but should be output only once, the renderer 'defers' it. The node in question, _:genid4, was being deshared and deferred correctly. However, the renderer was not checking for deferment when rendering list objects - i.e., the list of arguments to the intersecionOf expression.
So, we had a test covering this already, but it didn't cover shared nodes as part of lists.
Same issue in RDF/XML, however the same fix doesn't seem to work. The two renderers are almost structurally identical. Almost.
Test provided by @balhoff in ontodev/robot#1129
The shared node is referenced in three places in the output - two axioms, one of them with annotations. The annotation triggers reification, which is where the third reference appears.
The ontology looks like this:
The node triples are outputted twice - same in turtle as in rdf/xml.
This is redundant but, at the RDF level, it's just a repetition of the same triples (setting aside for a moment the impact on serialized histories).
It shouldn't make a difference to the parser. In fact, the rdf/xml parser copes with it. However, the Turtle parser doesn't like it - it doesn't expect an inline description with an id. Hard to change, as it's a JavaCC generated parser.
However, the solution needs to be that the extra triples aren't outputted. The fact that they're outputted twice, and not three times, suggests that the mechanism for deciding if the id gets generated and the one for deciding if the triples are outputted are getting tangled.
The text was updated successfully, but these errors were encountered: