You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commonsrdf.apache.org by st...@apache.org on 2016/10/07 15:01:48 UTC
[45/50] incubator-commonsrdf git commit: javadoc and code tidy
javadoc and code tidy
Project: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/commit/88c75a9e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/tree/88c75a9e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/diff/88c75a9e
Branch: refs/heads/master
Commit: 88c75a9ea47a634191b013c83658815bf6cc8ed0
Parents: 252f68c
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Fri Oct 7 15:56:34 2016 +0100
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Fri Oct 7 15:56:34 2016 +0100
----------------------------------------------------------------------
.../apache/commons/rdf/rdf4j/RDF4JGraph.java | 5 +-
.../commons/rdf/rdf4j/RDF4JTermFactory.java | 80 ++++++++++----------
2 files changed, 43 insertions(+), 42 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/88c75a9e/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/RDF4JGraph.java
----------------------------------------------------------------------
diff --git a/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/RDF4JGraph.java b/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/RDF4JGraph.java
index e419375..3e889a2 100644
--- a/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/RDF4JGraph.java
+++ b/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/RDF4JGraph.java
@@ -66,9 +66,8 @@ public interface RDF4JGraph extends Graph, RDF4JGraphLike<Triple> {
* <p>
* The returned set is an immutable copy; to specify a different mask, use
* {@link RDF4JTermFactory#asRDFTermGraph(Repository, Set, org.apache.commons.rdf.rdf4j.RDF4JTermFactory.Option...)
- *
- * @return The context mask as an set of {@link BlankNodeOrIRI}s, which may
- * contain the value <code>null</code>.
+ *
+ * @return The context mask as a set of {@link BlankNodeOrIRI}s, which may contain the value null
*/
public Set<RDF4JBlankNodeOrIRI<Resource>> getContextMask();
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/88c75a9e/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/RDF4JTermFactory.java
----------------------------------------------------------------------
diff --git a/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/RDF4JTermFactory.java b/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/RDF4JTermFactory.java
index 0e5fdc6..737c53e 100644
--- a/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/RDF4JTermFactory.java
+++ b/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/RDF4JTermFactory.java
@@ -119,45 +119,6 @@ public final class RDF4JTermFactory implements RDFTermFactory {
*/
handleInitAndShutdown
}
-
- /**
- * Adapt a RDF4J {@link Value} as a Commons RDF {@link RDFTerm}.
- * <p>
- * The value will be of the same kind as the term, e.g. a
- * {@link org.eclipse.rdf4j.model.BNode} is converted to a
- * {@link org.apache.commons.rdf.api.BlankNode}, a
- * {@link org.eclipse.rdf4j.model.IRI} is converted to a
- * {@link org.apache.commons.rdf.api.IRI} and a
- * {@link org.eclipse.rdf4j.model.Literal}. is converted to a
- * {@link org.apache.commons.rdf.api.Literal}
- *
- * @param value
- * The RDF4J {@link Value} to convert.
- * @param salt
- * A {@link UUID} salt to use for uniquely mapping any
- * {@link BNode}s. The salt should typically be the same for
- * multiple statements in the same {@link Repository} or
- * {@link Model} to ensure {@link BlankNode#equals(Object)} and
- * {@link BlankNode#uniqueReference()} works as intended.
- * @param <T>
- * The subclass of {@link Value}, e.g. {@link BNode}
- * @return A {@link RDFTerm} that corresponds to the RDF4J value
- * @throws IllegalArgumentException
- * if the value is not a BNode, Literal or IRI
- */
- @SuppressWarnings("unchecked")
- public static <T extends Value> RDF4JTerm<T> asRDFTerm(final T value, UUID salt) {
- if (value instanceof BNode) {
- return (RDF4JTerm<T>) rdf4j.createBlankNodeImpl((BNode) value, salt);
- }
- if (value instanceof org.eclipse.rdf4j.model.Literal) {
- return (RDF4JTerm<T>) rdf4j.createLiteralImpl((org.eclipse.rdf4j.model.Literal) value);
- }
- if (value instanceof org.eclipse.rdf4j.model.IRI) {
- return (RDF4JTerm<T>) rdf4j.createIRIImpl((org.eclipse.rdf4j.model.IRI) value);
- }
- throw new IllegalArgumentException("Value is not a BNode, Literal or IRI: " + value.getClass());
- }
private final UUID salt;
@@ -273,6 +234,45 @@ public final class RDF4JTermFactory implements RDFTermFactory {
public <T extends Value> RDF4JTerm<T> asRDFTerm(T value) {
return asRDFTerm(value, salt);
}
+
+ /**
+ * Adapt a RDF4J {@link Value} as a Commons RDF {@link RDFTerm}.
+ * <p>
+ * The value will be of the same kind as the term, e.g. a
+ * {@link org.eclipse.rdf4j.model.BNode} is converted to a
+ * {@link org.apache.commons.rdf.api.BlankNode}, a
+ * {@link org.eclipse.rdf4j.model.IRI} is converted to a
+ * {@link org.apache.commons.rdf.api.IRI} and a
+ * {@link org.eclipse.rdf4j.model.Literal}. is converted to a
+ * {@link org.apache.commons.rdf.api.Literal}
+ *
+ * @param value
+ * The RDF4J {@link Value} to convert.
+ * @param salt
+ * A {@link UUID} salt to use for uniquely mapping any
+ * {@link BNode}s. The salt should typically be the same for
+ * multiple statements in the same {@link Repository} or
+ * {@link Model} to ensure {@link BlankNode#equals(Object)} and
+ * {@link BlankNode#uniqueReference()} works as intended.
+ * @param <T>
+ * The subclass of {@link Value}, e.g. {@link BNode}
+ * @return A {@link RDFTerm} that corresponds to the RDF4J value
+ * @throws IllegalArgumentException
+ * if the value is not a BNode, Literal or IRI
+ */
+ @SuppressWarnings("unchecked")
+ public static <T extends Value> RDF4JTerm<T> asRDFTerm(final T value, UUID salt) {
+ if (value instanceof BNode) {
+ return (RDF4JTerm<T>) rdf4j.createBlankNodeImpl((BNode) value, salt);
+ }
+ if (value instanceof org.eclipse.rdf4j.model.Literal) {
+ return (RDF4JTerm<T>) rdf4j.createLiteralImpl((org.eclipse.rdf4j.model.Literal) value);
+ }
+ if (value instanceof org.eclipse.rdf4j.model.IRI) {
+ return (RDF4JTerm<T>) rdf4j.createIRIImpl((org.eclipse.rdf4j.model.IRI) value);
+ }
+ throw new IllegalArgumentException("Value is not a BNode, Literal or IRI: " + value.getClass());
+ }
/**
* Adapt an RDF4J {@link Repository} as a Commons RDF {@link Dataset}.
@@ -602,4 +602,6 @@ public final class RDF4JTermFactory implements RDFTermFactory {
return opts;
}
+
+
}