luigi-asprino opened a new issue, #3617: URL: https://github.com/apache/jena/issues/3617
### Version 5.6.0 ### Question Hi, I'm upgrading SPARQL Anything to the 5.6.0 version of Jena (see https://github.com/SPARQL-Anything/sparql.anything/issues/587). SA may generate [RDF-star triples](https://github.com/SPARQL-Anything/sparql.anything/blob/v1.1-DEV/Configuration.md#annotate-triples-with-slot-keys). After the upgrade, a test that checks whether two RDF-star graphs are isomorphic fails (the check is also done by using IsoMatcher - see https://github.com/apache/jena/issues/1710) I isolated the problem in the following piece of code. ``` System.out.println("G1"); String g1string = "<< <https://example.org/a> <https://example.org/b> <https://example.org/c> >> <https://example.org/p> <https://example.org/o> "; ByteArrayInputStream bais = new ByteArrayInputStream(g1string.getBytes()); Graph g1 = GraphFactory.createGraphMem(); RDFDataMgr.read(g1, bais, Lang.TTL); RDFDataMgr.write(System.out, g1, RDFFormat.TTL); System.out.println("Size g1: "+ g1.size()); String ns = "https://example.org/"; System.out.println("G2"); Graph g2 = GraphFactory.createGraphMem(); Node r = NodeFactory.createTripleTerm(NodeFactory.createURI(ns + "a"), NodeFactory.createURI(ns + "b"), NodeFactory.createURI(ns + "c")); g2.add(r, NodeFactory.createURI(ns + "p"), NodeFactory.createURI(ns + "o")); RDFDataMgr.write(System.out, g2, RDFFormat.TTL); System.out.println("Size g2: "+ g2.size()); System.out.println("Is g1 isomorphic with g2? " + g1.isIsomorphicWith(g2)); System.out.println("Is g1 isomorphic with g2? " + IsoMatcher.isomorphic(g1, g2)); ``` which prints ``` G1 [ <http://www.w3.org/1999/02/22-rdf-syntax-ns#reifies> <<( <https://example.org/a> <https://example.org/b> <https://example.org/c> )>>; <https://example.org/p> <https://example.org/o> ] . Size g1: 2 G2 <<( <https://example.org/a> <https://example.org/b> <https://example.org/c> )>> <https://example.org/p> <https://example.org/o> . Size g2: 1 Is g1 isomorphic with g2? false Is g1 isomorphic with g2? false ``` Have I built the triple term incorrectly? Or is the problem in the check or in how I'm reading the input? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
