{"action":"created","issue":{"url":"https://api.github.com/repos/commons-rdf/commons-rdf/issues/45","labels_url":"https://api.github.com/repos/commons-rdf/commons-rdf/issues/45/labels{/name}","comments_url":"https://api.github.com/repos/commons-rdf/commons-rdf/issues/45/comments","events_url":"https://api.github.com/repos/commons-rdf/commons-rdf/issues/45/events","html_url":"https://github.com/commons-rdf/commons-rdf/issues/45","id":54272445,"number":45,"title":"Must Triple (re)implement equals/hashCode?","user":{"login":"stain","id":253413,"avatar_url":"https://avatars.githubusercontent.com/u/253413?v=3","gravatar_id":"","url":"https://api.github.com/users/stain","html_url":"https://github.com/stain","followers_url":"https://api.github.com/users/stain/followers","following_url":"https://api.github.com/users/stain/following{/other_user}","gists_url":"https://api.github.com/users/stain/gists{/gist_id}","starred_url":"https://api.github.com/users/stain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stain/subscriptions","organizations_url":"https://api.github.com/users/stain/orgs","repos_url":"https://api.github.com/users/stain/repos","events_url":"https://api.github.com/users/stain/events{/privacy}","received_events_url":"https://api.github.com/users/stain/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-01-14T01:19:48Z","updated_at":"2015-01-14T01:33:17Z","closed_at":null,"body":"It seems like a good idea. In #42's GraphImpl I initially implemented the graph using LinkedHashSet, but for this to make sense I had to implement `equals` and `hashCode` in `Triple`, which then logically (for add(IRI, IRI, IRI) to not insert duplicatE) meant I also had to add it to `IRI`, `Literal` and `BlankNode` (!).  Related to #44.\r\n\r\nNow if we specify this (by adding abstract methods with javadoc as a hint), then probably we should also specify to which depth two RDFTerms are considered equal. Is this going too far?\r\n\r\nSee also [my comments on LinkedHashSet](https://github.com/commons-rdf/commons-rdf/pull/42#discussion_r22910016) in #42. \r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/commons-rdf/commons-rdf/issues/comments/69855016","html_url":"https://github.com/commons-rdf/commons-rdf/issues/45#issuecomment-69855016","issue_url":"https://api.github.com/repos/commons-rdf/commons-rdf/issues/45","id":69855016,"user":{"login":"ansell","id":82365,"avatar_url":"https://avatars.githubusercontent.com/u/82365?v=3","gravatar_id":"","url":"https://api.github.com/users/ansell","html_url":"https://github.com/ansell","followers_url":"https://api.github.com/users/ansell/followers","following_url":"https://api.github.com/users/ansell/following{/other_user}","gists_url":"https://api.github.com/users/ansell/gists{/gist_id}","starred_url":"https://api.github.com/users/ansell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ansell/subscriptions","organizations_url":"https://api.github.com/users/ansell/orgs","repos_url":"https://api.github.com/users/ansell/repos","events_url":"https://api.github.com/users/ansell/events{/privacy}","received_events_url":"https://api.github.com/users/ansell/received_events","type":"User","site_admin":false},"created_at":"2015-01-14T01:33:17Z","updated_at":"2015-01-14T01:33:17Z","body":"On the depth question, the purpose of the API is to provide interconnections between different libraries so it is definitely relevant to define the expectations for the equals/hashCode methods."}}