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/09/05 15:53:49 UTC
[05/19] incubator-commonsrdf git commit: javadoc typos
javadoc typos
Project: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/commit/220f75f1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/tree/220f75f1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/diff/220f75f1
Branch: refs/heads/master
Commit: 220f75f19f3dfb730a9626292ac25e11807f4f31
Parents: 5e952b5
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Fri Apr 8 15:13:16 2016 +0100
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Fri Apr 8 15:16:42 2016 +0100
----------------------------------------------------------------------
.../org/apache/commons/rdf/api/Dataset.java | 2 -
.../apache/commons/rdf/api/GraphOrDataset.java | 107 ++++++++++---------
.../java/org/apache/commons/rdf/api/Quad.java | 12 +--
.../apache/commons/rdf/api/TripleOrQuad.java | 4 +-
4 files changed, 64 insertions(+), 61 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/220f75f1/api/src/main/java/org/apache/commons/rdf/api/Dataset.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/org/apache/commons/rdf/api/Dataset.java b/api/src/main/java/org/apache/commons/rdf/api/Dataset.java
index 70d5bff..fca9810 100644
--- a/api/src/main/java/org/apache/commons/rdf/api/Dataset.java
+++ b/api/src/main/java/org/apache/commons/rdf/api/Dataset.java
@@ -144,8 +144,6 @@ public interface Dataset extends AutoCloseable, GraphOrDataset<Quad> {
/**
* Remove a concrete pattern of quads from the default graph of the dataset.
*
- * @param graphName
- * The graph the quad belongs to
* @param subject
* The quad subject (<code>null</code> is a wildcard)
* @param predicate
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/220f75f1/api/src/main/java/org/apache/commons/rdf/api/GraphOrDataset.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/org/apache/commons/rdf/api/GraphOrDataset.java b/api/src/main/java/org/apache/commons/rdf/api/GraphOrDataset.java
index 35017fb..f41463a 100644
--- a/api/src/main/java/org/apache/commons/rdf/api/GraphOrDataset.java
+++ b/api/src/main/java/org/apache/commons/rdf/api/GraphOrDataset.java
@@ -22,24 +22,24 @@ import java.util.Iterator;
import java.util.stream.Stream;
/**
- * An <a href="http://www.w3.org/TR/rdf11-concepts/#section-rdf-graph"> RDF 1.1
- * Graph</a>, a set of RDF triples, as defined by <a
- * href="http://www.w3.org/TR/rdf11-concepts/" >RDF-1.1 Concepts and Abstract
- * Syntax</a>, a W3C Recommendation published on 25 February 2014.
+ * Common interface for {@link Graph} and {@link Dataset}
+ * <p>
+ *
*/
public interface GraphOrDataset<T extends TripleOrQuad> extends AutoCloseable {
/**
- * Add a triple to the graph, possibly mapping any of the components of the
- * Triple to those supported by this Graph.
+ * Add a triple/quad to the graph, possibly mapping any of the components of the
+ * TripleOrQuad to those supported by this Graph.
*
- * @param triple The triple or quad to add
+ * @param tripleOrQuad The triple or quad to add
*/
- void add(T triple);
+ void add(T tripleOrQuad);
/**
- * Add a triple to the graph, possibly mapping any of the components to
- * those supported by this Graph.
+ * Add a triple to the Graph, (or the default graph of a Dataset),
+ * possibly mapping any of the components to
+ * those supported by this graph/dataset.
*
* @param subject The triple subject
* @param predicate The triple predicate
@@ -48,26 +48,30 @@ public interface GraphOrDataset<T extends TripleOrQuad> extends AutoCloseable {
void add(BlankNodeOrIRI subject, IRI predicate, RDFTerm object);
/**
- * Check if graph contains triple.
+ * Check if graph/dataset contains triple/quad.
*
- * @param triple The triple to check.
- * @return True if the Graph contains the given Triple.
+ * @param tripleOrQuad The triple/quad to check.
+ * @return True if this graph/dataset contains the given Triple.
*/
- boolean contains(T triple);
+ boolean contains(T tripleOrQuad);
/**
- * Check if graph contains a pattern of triples.
- *
- * @param subject The triple subject (null is a wildcard)
- * @param predicate The triple predicate (null is a wildcard)
- * @param object The triple object (null is a wildcard)
- * @return True if the Graph contains any Triples that match the given
- * pattern.
- */
+ * Check if graph/dataset contains a pattern of triples or quads in the
+ * default graph of a dataset.
+ *
+ * @param subject
+ * The triple subject (null is a wildcard)
+ * @param predicate
+ * The triple predicate (null is a wildcard)
+ * @param object
+ * The triple object (null is a wildcard)
+ * @return True if this graph/dataset contains any triples/quads
+ * that match the given pattern.
+ */
boolean contains(BlankNodeOrIRI subject, IRI predicate, RDFTerm object);
/**
- * Close the graph, relinquishing any underlying resources.
+ * Close the graph/dataset, relinquishing any underlying resources.
* <p>
* For example, this would close any open file and network streams and free
* database locks held by the Graph implementation.
@@ -83,14 +87,15 @@ public interface GraphOrDataset<T extends TripleOrQuad> extends AutoCloseable {
}
/**
- * Remove a concrete triple from the graph.
+ * Remove a concrete triple/quad from the graph.
*
- * @param triple triple to remove
+ * @param tripleOrQuad triple/quad to remove
*/
- void remove(T triple);
+ void remove(T tripleOrQuad);
/**
- * Remove a concrete pattern of triples from the graph.
+ * Remove a concrete pattern of triples from the graph, or
+ * quads from the default graph of a dataset.
*
* @param subject The triple subject (null is a wildcard)
* @param predicate The triple predicate (null is a wildcard)
@@ -99,28 +104,27 @@ public interface GraphOrDataset<T extends TripleOrQuad> extends AutoCloseable {
void remove(BlankNodeOrIRI subject, IRI predicate, RDFTerm object);
/**
- * Clear the graph, removing all triples.
+ * Clear the graph/dataset, removing all triples/quads.
*/
void clear();
/**
- * Number of triples contained by the graph.
- * <p>
- * The count of a set does not include duplicates, consistent with the
- * {@link T#equals(Object)} equals method for each {@link T}.
+ * Number of triples/quads contained by the graph/dataset.
*
- * @return The number of triples in the graph
+ * @return The number of triples/quads in the graph/dataset
*/
long size();
/**
- * Get all triples contained by the graph.<br>
+ * Get all triples contained by the graph, or
+ * the equivalent of {@link Quad#asTriple()}
+ * for all quads of the default graph of a dataset.
* <p>
* The iteration does not contain any duplicate triples, as determined by
- * the {@link T#equals(Object)} method for each {@link T}.
+ * the {@link Triple#equals(Object)} method for each {@link Triple}.
* <p>
- * The behaviour of the {@link Stream} is not specified if {@link #add(T)},
- * {@link #remove(T)} or {@link #clear()} are called on the
+ * The behaviour of the {@link Stream} is not specified if {@link #add(TripleOrQuad)},
+ * {@link #remove(TripleOrQuad)} or {@link #clear()} are called on the
* {@link GraphOrDataset} before it terminates.
* <p>
* Implementations may throw {@link ConcurrentModificationException} from Stream
@@ -128,16 +132,18 @@ public interface GraphOrDataset<T extends TripleOrQuad> extends AutoCloseable {
*
* @return A {@link Stream} over all of the triples in the graph
*/
- Stream<? extends T> getTriples();
+ Stream<? extends Triple> getTriples();
/**
- * Get all triples contained by the graph matched with the pattern.
+ * Get all triples contained by the graph matched with the pattern, or
+ * the equivalent of {@link Quad#asTriple()}
+ * for all quads of the default graph of a dataset that match the pattern.
* <p>
* The iteration does not contain any duplicate triples, as determined by
- * the {@link T#equals(Object)} method for each {@link T}.
+ * the {@link Triple#equals(Object)} method for each {@link Triple}.
* <p>
- * The behaviour of the {@link Stream} is not specified if {@link #add(T)},
- * {@link #remove(T)} or {@link #clear()} are called on the
+ * The behaviour of the {@link Stream} is not specified if {@link #add(TripleOrQuad)},
+ * {@link #remove(TripleOrQuad)} or {@link #clear()} are called on the
* {@link GraphOrDataset} before it terminates.
* <p>
* Implementations may throw {@link ConcurrentModificationException} from Stream
@@ -148,7 +154,7 @@ public interface GraphOrDataset<T extends TripleOrQuad> extends AutoCloseable {
* @param object The triple object (null is a wildcard)
* @return A {@link Stream} over the matched triples.
*/
- Stream<? extends T> getTriples(BlankNodeOrIRI subject, IRI predicate,
+ Stream<? extends Triple> getTriples(BlankNodeOrIRI subject, IRI predicate,
RDFTerm object);
/**
@@ -156,12 +162,12 @@ public interface GraphOrDataset<T extends TripleOrQuad> extends AutoCloseable {
* <p>
* This method is meant to be used with a Java for-each loop, e.g.:
* <pre>
- * for (Triple t : graph.iterate()) {
+ * for (TripleOrQuad t : graphOrDataset.iterate()) {
* System.out.println(t);
* }
* </pre>
- * The behaviour of the iterator is not specified if {@link #add(T)},
- * {@link #remove(T)} or {@link #clear()}, are called on the
+ * The behaviour of the iterator is not specified if {@link #add(TripleOrQuad)},
+ * {@link #remove(TripleOrQuad)} or {@link #clear()}, are called on the
* {@link GraphOrDataset} before it terminates. It is undefined if the returned
* {@link Iterator} supports the {@link Iterator#remove()} method.
* <p>
@@ -188,20 +194,21 @@ public interface GraphOrDataset<T extends TripleOrQuad> extends AutoCloseable {
}
/**
- * Get an Iterable for iterating over the triples in the graph that match
- * the pattern.
+ * Get an Iterable for iterating over the triples in the graph
+ * or quads in the default graph of a dataset that
+ * match the pattern.
* <p>
* This method is meant to be used with a Java for-each loop, e.g.:
* <pre>
* IRI alice = factory.createIRI("http://example.com/alice");
* IRI knows = factory.createIRI("http://xmlns.com/foaf/0.1/");
- * for (Triple t : graph.iterate(alice, knows, null)) {
+ * for (Triple t : graphOrDataset.iterate(alice, knows, null)) {
* System.out.println(t.getObject());
* }
* </pre>
* <p>
* The behaviour of the iterator is not specified if
- * {@link #add(T)}, {@link #remove(T)} or {@link #clear()}, are
+ * {@link #add(TripleOrQuad)}, {@link #remove(TripleOrQuad)} or {@link #clear()}, are
* called on the {@link GraphOrDataset} before it terminates. It is undefined if the
* returned {@link Iterator} supports the {@link Iterator#remove()} method.
* <p>
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/220f75f1/api/src/main/java/org/apache/commons/rdf/api/Quad.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/org/apache/commons/rdf/api/Quad.java b/api/src/main/java/org/apache/commons/rdf/api/Quad.java
index 088533b..7ccd0d1 100644
--- a/api/src/main/java/org/apache/commons/rdf/api/Quad.java
+++ b/api/src/main/java/org/apache/commons/rdf/api/Quad.java
@@ -86,20 +86,18 @@ public interface Quad extends TripleOrQuad {
RDFTerm getObject();
/**
- * Convert this {@link Quad} to a {@link Triple}.
+ * Convert this Quad to a Triple.
* <p>
* The returned {@link Triple} will have equivalent values returned from the
* methods {@link TripleOrQuad#getSubject()},
- * {@link TripleOrQuad#getPredicate()} and {@link TripleOrQuad#getObject()}
- * (their values MUST be {@link RDFTerm#equals(Object)}) - however the
- * property values MAY be different instances.
+ * {@link TripleOrQuad#getPredicate()} and {@link TripleOrQuad#getObject()}.
* <p>
* The returned {@link Triple} MUST NOT be {@link #equals(Object)} to this
* {@link Quad}, even if this quad has a default graph
* {@link #getGraphName()} value of {@link Optional#empty()}, but MUST
- * follow the {@link Triple#equals(Object)) semantics. This means that the
+ * follow the {@link Triple#equals(Object)} semantics. This means that the
* following MUST be true:
- *
+ *
* <pre>
* Quad q1, q2;
* if (q1.equals(q2)) {
@@ -193,7 +191,7 @@ public interface Quad extends TripleOrQuad {
* <p>
* The returned hash code MUST be equal to the result of
* {@link Objects#hash(Object...)} with the arguments {@link #getSubject()},
- * {@link #getPredicate()}, {@link #getObject(), #getGraphName()}.
+ * {@link #getPredicate()}, {@link #getObject()}, {@link #getGraphName()}.
* <p>
* This method MUST be implemented in conjunction with
* {@link #equals(Object)} so that two equal {@link Quad}s produce the same
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/220f75f1/api/src/main/java/org/apache/commons/rdf/api/TripleOrQuad.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/org/apache/commons/rdf/api/TripleOrQuad.java b/api/src/main/java/org/apache/commons/rdf/api/TripleOrQuad.java
index 755bb99..6a86447 100644
--- a/api/src/main/java/org/apache/commons/rdf/api/TripleOrQuad.java
+++ b/api/src/main/java/org/apache/commons/rdf/api/TripleOrQuad.java
@@ -23,8 +23,8 @@ package org.apache.commons.rdf.api;
* A TripleOrQuad has at least a
* {@link #getSubject()}, {@link #getPredicate()} and
* {@link #getObject()}, but unlike a {@link Triple} does not have a
- * formalized {@link Triple#equals(Object)} semantics, and does not
- * neccesarily have a {@link Quad#getGraphLabel()}
+ * formalised {@link Triple#equals(Object)} semantics, and does not
+ * necessarily have a {@link Quad#getGraphName()}
* <p>
* Implementations of this interface SHOULD also implement {@link Triple}
* or {@link Quad}, but MUST NOT implement both interfaces.