All,

I was looking into the difference and isIsomorphicWith method of a Jena
Model when there are Blank Nodes.

The isIsomorphicWith returns the expected results when two RDF graphs with
blank nodes are effectively isomorphic. However, I would expect that if two
RDF graphs are isomorphic, then there shouldn't be a difference.  But when
blank nodes are in the graph, then all the triples that have blank nodes
are considered to be different. I assume then that the difference method
has been implemented in a way that it does take in account the labels of
the blank nodes (when the definition of isIsomorphicWith states the
opposite). Is my assumption correct?

This is example code


     String rdf1 = "<http://Alice> <http://knows> [].";

Model rdf1Model = ModelFactory.createDefaultModel();
rdf1Model.read(new ByteArrayInputStream( rdf1.getBytes()), null, "TTL");
String rdf2 = "<http://Alice> <http://knows> [].";
Model rdf2Model = ModelFactory.createDefaultModel();
rdf2Model.read(new ByteArrayInputStream( rdf2.getBytes()), null, "TTL");
boolean isIsomorphicWith = rdf1Model.isIsomorphicWith(rdf2Model);
Model diff = rdf1Model.difference(rdf2Model);
System.out.println("isIsomorphicWith = "+isIsomorphicWith); //returns true
diff.write(System.out, "TTL"); // returns "<http://Alice>  <http://knows>
 []  ." when I'm expecting an empty model because the graphs are isomorphic


Is there a way in Jena where difference follows the same definition of
isIsomorphicWith and ignores the labels on blank nodes.

Thanks!

--
Juan Sequeda, Ph.D
+1-575-SEQ-UEDA
www.juansequeda.com

Reply via email to