On 03/24/15 12:23, Reto Gmür wrote:
On Mon, Mar 23, 2015 at 12:04 PM, Andy Seaborne <[email protected]> wrote:

On 23/03/15 10:25, Reto Gmür wrote:

Right now the API on Github says nothing about the identity and hascode of
any term. In order to have interoperable it is essential to define the
value of hashcode and the identity conditions for the rdf-terms which are
not locally scoped, i.e. for IRIs and Literals.


+1


I suggest to take the definitions from the clerezza rdf commons.


Absent active JIRA at the moment, could you email here please?

Given Peter is spending time on his implementation, this might be quite
useful to him.

Sure.

Literal: the hash code of the lexical form plus the hash code of the
datatype plus if the literal has a language the hash code of the language

https://git-wip-us.apache.org/repos/asf?p=clerezza-rdf-core.git;a=blob;f=api/src/main/java/org/apache/commons/rdf/Literal.java;h=cf5e1eea2d848a57e4e338a3d208f127103d39a4;hb=HEAD

And the IRI: 5 + the hashcode of the string

https://git-wip-us.apache.org/repos/asf?p=clerezza-rdf-core.git;a=blob;f=api/src/main/java/org/apache/commons/rdf/Iri.java;h=e1ef0f7d21a3cb668b4a3b2f2aae7e2f642b68dd;hb=HEAD

The definition of hashCode look fine - the low bits are decently spread. Gone are the days of xors.

And BNodes are identified by object reference in Clerezza so BNodes have a hashcode and equality from Object.

        Andy



Reply via email to