commonsrdf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject [9/9] incubator-commonsrdf git commit: javadoc improvements
Date Fri, 08 Jul 2016 11:53:53 GMT
javadoc improvements


Project: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/commit/0f349723
Tree: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/tree/0f349723
Diff: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/diff/0f349723

Branch: refs/heads/jena
Commit: 0f349723de52c5a9cbc78f70edd41f40c355631b
Parents: 0475259
Author: Stian Soiland-Reyes <stain@apache.org>
Authored: Fri Jul 8 12:53:32 2016 +0100
Committer: Stian Soiland-Reyes <stain@apache.org>
Committed: Fri Jul 8 12:53:32 2016 +0100

----------------------------------------------------------------------
 .../java/org/apache/commons/rdf/jena/JenaAny.java   | 16 ++++++++++++++++
 .../org/apache/commons/rdf/jena/JenaBlankNode.java  |  6 ++++++
 .../java/org/apache/commons/rdf/jena/JenaIRI.java   |  6 ++++++
 .../org/apache/commons/rdf/jena/JenaLiteral.java    |  6 ++++++
 .../org/apache/commons/rdf/jena/JenaVariable.java   | 15 +++++++++++++++
 .../org/apache/commons/rdf/jena/impl/AnyImpl.java   |  5 +++++
 .../apache/commons/rdf/jena/impl/VariableImpl.java  | 13 +++++++++++++
 7 files changed, 67 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/0f349723/jena/src/main/java/org/apache/commons/rdf/jena/JenaAny.java
----------------------------------------------------------------------
diff --git a/jena/src/main/java/org/apache/commons/rdf/jena/JenaAny.java b/jena/src/main/java/org/apache/commons/rdf/jena/JenaAny.java
index b6c32fd..5b6f398 100644
--- a/jena/src/main/java/org/apache/commons/rdf/jena/JenaAny.java
+++ b/jena/src/main/java/org/apache/commons/rdf/jena/JenaAny.java
@@ -18,6 +18,22 @@
 
 package org.apache.commons.rdf.jena;
 
+import org.apache.jena.graph.Node;
+
+/**
+ * A placeholder for "any" RDFTerm.
+ * <p>
+ * Equivalent to <code>[]</code> in SPARQL. This is a Jena-specific
+ * RDFTerm extension used in SPARQL queries.
+ * <p>
+ * Note that any JenaAny is {@link Object#equals(Object)} equal to 
+ * any other JenaAny - in practice there is only a singleton instance -
+ * but  every ocurrance of JenaAny in a generalized statement 
+ * would independently represent "any" RDFTerm.
+ * 
+ * @see Node#ANY
+ * 
+ */
 public interface JenaAny extends JenaRDFTerm {
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/0f349723/jena/src/main/java/org/apache/commons/rdf/jena/JenaBlankNode.java
----------------------------------------------------------------------
diff --git a/jena/src/main/java/org/apache/commons/rdf/jena/JenaBlankNode.java b/jena/src/main/java/org/apache/commons/rdf/jena/JenaBlankNode.java
index 099821f..4777dda 100644
--- a/jena/src/main/java/org/apache/commons/rdf/jena/JenaBlankNode.java
+++ b/jena/src/main/java/org/apache/commons/rdf/jena/JenaBlankNode.java
@@ -19,7 +19,13 @@
 package org.apache.commons.rdf.jena;
 
 import org.apache.commons.rdf.api.BlankNode;
+import org.apache.jena.graph.Node;
 
+/**
+ * A Jena-backed {@link BlankNode}.
+ * 
+ * @see Node#isBlank()
+ */
 public interface JenaBlankNode extends JenaRDFTerm, BlankNode {
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/0f349723/jena/src/main/java/org/apache/commons/rdf/jena/JenaIRI.java
----------------------------------------------------------------------
diff --git a/jena/src/main/java/org/apache/commons/rdf/jena/JenaIRI.java b/jena/src/main/java/org/apache/commons/rdf/jena/JenaIRI.java
index ee58465..b16acd8 100644
--- a/jena/src/main/java/org/apache/commons/rdf/jena/JenaIRI.java
+++ b/jena/src/main/java/org/apache/commons/rdf/jena/JenaIRI.java
@@ -19,7 +19,13 @@
 package org.apache.commons.rdf.jena;
 
 import org.apache.commons.rdf.api.IRI;
+import org.apache.jena.graph.Node;
 
+/**
+ * A Jena-backed {@link IRI}.
+ * 
+ * @see Node#isURI()
+ */
 public interface JenaIRI extends JenaRDFTerm, IRI {
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/0f349723/jena/src/main/java/org/apache/commons/rdf/jena/JenaLiteral.java
----------------------------------------------------------------------
diff --git a/jena/src/main/java/org/apache/commons/rdf/jena/JenaLiteral.java b/jena/src/main/java/org/apache/commons/rdf/jena/JenaLiteral.java
index 7d0757b..df0c697 100644
--- a/jena/src/main/java/org/apache/commons/rdf/jena/JenaLiteral.java
+++ b/jena/src/main/java/org/apache/commons/rdf/jena/JenaLiteral.java
@@ -19,7 +19,13 @@
 package org.apache.commons.rdf.jena;
 
 import org.apache.commons.rdf.api.Literal;
+import org.apache.jena.graph.Node;
 
+/**
+ * A Jena-backed {@link Literal}
+ * 
+ * @see Node#isLiteral()
+ */
 public interface JenaLiteral extends JenaRDFTerm, Literal {
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/0f349723/jena/src/main/java/org/apache/commons/rdf/jena/JenaVariable.java
----------------------------------------------------------------------
diff --git a/jena/src/main/java/org/apache/commons/rdf/jena/JenaVariable.java b/jena/src/main/java/org/apache/commons/rdf/jena/JenaVariable.java
index 218272f..099018f 100644
--- a/jena/src/main/java/org/apache/commons/rdf/jena/JenaVariable.java
+++ b/jena/src/main/java/org/apache/commons/rdf/jena/JenaVariable.java
@@ -17,7 +17,22 @@
  */
 package org.apache.commons.rdf.jena;
 
+import org.apache.commons.rdf.api.BlankNode;
+import org.apache.jena.graph.Node;
 
+/**
+ * A placeholder for a variable RDFTerm.
+ * <p>
+ * Equivalent to <code>?variable</code> in SPARQL. This is a Jena-specific
+ * RDFTerm extension used in SPARQL queries.
+ * <p>
+ * Note that any JenaVariable is {@link Object#equals(Object)} equal to 
+ * any other JenaVariable if they have the same {@link #getVariableName()}. There
+ * is no equivalent of {@link BlankNode#uniqueReference()} and actual equality depend
+ * on the SPARQL query using the variable.
+ * 
+ * @see Node#isVariable()
+ */
 public interface JenaVariable extends JenaRDFTerm {
 	public String getVariableName();
 

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/0f349723/jena/src/main/java/org/apache/commons/rdf/jena/impl/AnyImpl.java
----------------------------------------------------------------------
diff --git a/jena/src/main/java/org/apache/commons/rdf/jena/impl/AnyImpl.java b/jena/src/main/java/org/apache/commons/rdf/jena/impl/AnyImpl.java
index a468f43..e2d3809 100644
--- a/jena/src/main/java/org/apache/commons/rdf/jena/impl/AnyImpl.java
+++ b/jena/src/main/java/org/apache/commons/rdf/jena/impl/AnyImpl.java
@@ -45,5 +45,10 @@ public class AnyImpl implements JenaRDFTerm, JenaAny {
 	public Node asJenaNode() {
 		return Node.ANY;
 	}
+	
+	@Override
+	public boolean equals(Object obj) {
+		return obj == this || obj instanceof JenaAny;
+	}
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/0f349723/jena/src/main/java/org/apache/commons/rdf/jena/impl/VariableImpl.java
----------------------------------------------------------------------
diff --git a/jena/src/main/java/org/apache/commons/rdf/jena/impl/VariableImpl.java b/jena/src/main/java/org/apache/commons/rdf/jena/impl/VariableImpl.java
index 130462a..b72ecde 100644
--- a/jena/src/main/java/org/apache/commons/rdf/jena/impl/VariableImpl.java
+++ b/jena/src/main/java/org/apache/commons/rdf/jena/impl/VariableImpl.java
@@ -18,6 +18,8 @@
 
 package org.apache.commons.rdf.jena.impl;
 
+import java.util.Objects;
+
 import org.apache.commons.rdf.jena.JenaRDFTerm;
 import org.apache.commons.rdf.jena.JenaVariable;
 import org.apache.jena.graph.Node;
@@ -47,5 +49,16 @@ public class VariableImpl implements JenaRDFTerm, JenaVariable {
 	public Node asJenaNode() {
 		return node;
 	}
+	
+	@Override
+	public boolean equals(Object obj) {
+		if (obj == this) { 
+			return true;
+		}
+		if (! (obj instanceof JenaVariable)) { 
+			return false;
+		}
+		return Objects.equals(getVariableName(), ((JenaVariable)obj).getVariableName());
+	}
 
 }


Mime
View raw message