Open ignazio1977 opened 1 year ago
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.
TODO version 6
Test provided by @balhoff in https://github.com/ontodev/robot/issues/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.