COMMONSRDF-6 internalIdentifier -> uniqueReference() ..in user guide and comments
Project: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/commit/48dc0678 Tree: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/tree/48dc0678 Diff: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/diff/48dc0678 Branch: refs/heads/master Commit: 48dc067806e627d4871a2aee09bec5b27f84e3e7 Parents: ba12551 Author: Stian Soiland-Reyes <st...@apache.org> Authored: Wed Apr 29 10:59:50 2015 +0100 Committer: Stian Soiland-Reyes <st...@apache.org> Committed: Wed Apr 29 10:59:50 2015 +0100 ---------------------------------------------------------------------- examples/src/example/UserGuideTest.java | 2 +- .../org/apache/commons/rdf/simple/BlankNodeImpl.java | 4 ++-- src/site/markdown/userguide.md | 12 ++++-------- 3 files changed, 7 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/48dc0678/examples/src/example/UserGuideTest.java ---------------------------------------------------------------------- diff --git a/examples/src/example/UserGuideTest.java b/examples/src/example/UserGuideTest.java index 1bf80d8..3c66fbe 100644 --- a/examples/src/example/UserGuideTest.java +++ b/examples/src/example/UserGuideTest.java @@ -88,7 +88,7 @@ public class UserGuideTest { System.out.println(b1.equals(factory.createBlankNode("b1"))); System.out.println(b1.equals(new SimpleRDFTermFactory().createBlankNode("b1"))); - System.out.println(bnode.internalIdentifier()); + System.out.println(bnode.uniqueReference()); } @Test http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/48dc0678/simple/src/main/java/org/apache/commons/rdf/simple/BlankNodeImpl.java ---------------------------------------------------------------------- diff --git a/simple/src/main/java/org/apache/commons/rdf/simple/BlankNodeImpl.java b/simple/src/main/java/org/apache/commons/rdf/simple/BlankNodeImpl.java index cdfdc92..6e9e217 100644 --- a/simple/src/main/java/org/apache/commons/rdf/simple/BlankNodeImpl.java +++ b/simple/src/main/java/org/apache/commons/rdf/simple/BlankNodeImpl.java @@ -56,9 +56,9 @@ final class BlankNodeImpl implements BlankNode { // Rather than implement ntriples escaping here, and knowing - // the uniqueReference() contain a UUID anyway, we simply + // our uniqueReference() contain a UUID anyway, we simply // create another name-based UUID, and use it within both - // internalIdentifier() and within ntriplesString(). + // uniqueReference() and within ntriplesString(). // // A side-effect from this is that the blank node identifier // is not preserved or shown in ntriplesString. In a way http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/48dc0678/src/site/markdown/userguide.md ---------------------------------------------------------------------- diff --git a/src/site/markdown/userguide.md b/src/site/markdown/userguide.md index 9dbf4d8..de15018 100644 --- a/src/site/markdown/userguide.md +++ b/src/site/markdown/userguide.md @@ -379,29 +379,25 @@ System.out.println(b1.equals(new SimpleRDFTermFactory().createBlankNode("b1"))); #### Blank node reference -_Warning: This method is still under discussion and these details, -including the method name, are subject to change. See -[COMMONSRDF-6](https://issues.apache.org/jira/browse/COMMONSRDF-6)._ - While blank nodes are distinct from IRIs, and don't have inherent universal identifiers, it can nevertheless be useful for debugging and testing to have a unique reference string for a particular blank node. For that purpose, BlankNode exposes the -[internalIdentifier](apidocs/org/apache/commons/rdf/api/BlankNode.html#internalIdentifier--) +[uniqueReference](apidocs/org/apache/commons/rdf/api/BlankNode.html#uniqueReference--) method: ```java -System.out.println(bnode.internalIdentifier()); +System.out.println(bnode.uniqueReference()); ``` > `735d5e63-96a4-488b-8613-7037b82c74a5` While this reference string might for the _simple_ -implementation also be seen within the `BlankNode.ntriplesString()` +implementation also be seen within the `BlankNode.ntriplesString()` result, there is no such guarantee from the Commons RDF API. Clients who need a globally unique reference -for a blank node should therefore use the `internalIdentifier()` method. +for a blank node should therefore use the `uniqueReference()` method. _Note: While it is recommended for this string to be (or contain) a [UUID string](http://docs.oracle.com/javase/8/docs/api/java/util/UUID.html),