You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "Andy Seaborne (JIRA)" <ji...@apache.org> on 2014/10/24 19:59:34 UTC

[jira] [Issue Comment Deleted] (JENA-805) Graph#isIsomorphicWith should use semantic equivalence when comparing blank nodes

     [ https://issues.apache.org/jira/browse/JENA-805?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andy Seaborne updated JENA-805:
-------------------------------
    Comment: was deleted

(was: Jena2 is not completely RDF 1.1.  The changes that would mean that data on-disk need to be reloaded are being done as part of Jena3, to avoid a major version change followed soon afterwards by another one.

Jena has treated simple literals and xsd strings as the same value in some cases (in memory graphs for example).  This is not an RDF 1.1 matter.  RDF 1.1 makes them the same term (i.e. .equals).  Other "same value" are integers "1" and "+001".)

> Graph#isIsomorphicWith should use semantic equivalence when comparing blank nodes
> ---------------------------------------------------------------------------------
>
>                 Key: JENA-805
>                 URL: https://issues.apache.org/jira/browse/JENA-805
>             Project: Apache Jena
>          Issue Type: Bug
>          Components: Jena
>    Affects Versions: Jena 2.12.1
>            Reporter: Chris Beer
>            Priority: Minor
>
> It appears that Graph#isIsomorphicWith appears to use syntactic equivalence when comparing blank nodes:
> https://github.com/apache/jena/blob/master/jena-core/src/main/java/com/hp/hpl/jena/graph/impl/GraphMatcher.java#L27
> It should probably use semantic equivalence instead, or, at the very least, respect the RDF 1.1 equivalence of plain literals and xsd:string-typed literals.
> Here is an example that I believe should be considered isomorphic:
> {code}
>     @Test
>     public void isomorphismShouldRespectPlainLiteralEquivalence() {
>         // Without worrying about a blank node, isomorphism works fine:
>         Model model1 = ModelFactory.createDefaultModel();
>         model1.read(IOUtils.toInputStream("<info:x> <info:y> \"x\""), "", "TTL");
>         Model model2 = ModelFactory.createDefaultModel();
>         model2.read(IOUtils.toInputStream("<info:x> <info:y> \"x\"^^<http://www.w3.org/2001/XMLSchema#string>"), "", "TTL");
>         assertTrue(model1.isIsomorphicWith(model2)); // WORKS
>         // Now with a blank node:
>         Model model3 = ModelFactory.createDefaultModel();
>         model3.read(IOUtils.toInputStream("<info:x> <info:y> [ <info:z> \"x\" ]"), "", "TTL");
>         Model model4 = ModelFactory.createDefaultModel();
>         model4.read(IOUtils.toInputStream("<info:x> <info:y> [ <info:z> \"x\"^^<http://www.w3.org/2001/XMLSchema#string> ]"), "", "TTL");
>         assertTrue(model3.isIsomorphicWith(model4)); // BROKEN
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)