commonsrdf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject [15/19] incubator-commonsrdf git commit: Include @Deprecated getTriples()
Date Mon, 05 Sep 2016 15:53:59 GMT
Include @Deprecated getTriples()

The default implementation calls .stream()

.. and @since for new Quad features


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

Branch: refs/heads/master
Commit: 14e505e33d10b72fc22efd5c7952ad63f16f2393
Parents: 14f246e
Author: Stian Soiland-Reyes <stain@apache.org>
Authored: Thu Jun 2 17:30:50 2016 +0100
Committer: Stian Soiland-Reyes <stain@apache.org>
Committed: Thu Jun 2 17:31:05 2016 +0100

----------------------------------------------------------------------
 .../java/org/apache/commons/rdf/api/Graph.java  | 30 ++++++++++++++++++--
 .../org/apache/commons/rdf/api/GraphLike.java   |  1 +
 .../java/org/apache/commons/rdf/api/Quad.java   |  1 +
 .../org/apache/commons/rdf/api/QuadLike.java    |  1 +
 .../org/apache/commons/rdf/api/TripleLike.java  |  1 +
 .../commons/rdf/api/AbstractGraphTest.java      |  4 +--
 6 files changed, 33 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/14e505e3/api/src/main/java/org/apache/commons/rdf/api/Graph.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/org/apache/commons/rdf/api/Graph.java b/api/src/main/java/org/apache/commons/rdf/api/Graph.java
index 42ced98..6106bab 100644
--- a/api/src/main/java/org/apache/commons/rdf/api/Graph.java
+++ b/api/src/main/java/org/apache/commons/rdf/api/Graph.java
@@ -125,11 +125,12 @@ public interface Graph extends AutoCloseable,GraphLike<Triple, BlankNodeOrIRI,
I
      * <p>
      * Implementations may throw {@link ConcurrentModificationException} from Stream
      * methods if they detect a conflict while the Stream is active.
-     *
+     * 
+     * @since 0.3.0-incubating
      * @return A {@link Stream} over all of the triples in the graph
      */
     Stream<? extends Triple> stream();
-
+    
     /**
      * Get all triples contained by the graph matched with the pattern.
      * <p>
@@ -142,7 +143,9 @@ public interface Graph extends AutoCloseable,GraphLike<Triple, BlankNodeOrIRI,
I
      * <p>
      * Implementations may throw {@link ConcurrentModificationException} from Stream
      * methods if they detect a conflict while the Stream is active.
-     *
+     * <p>
+     * 
+     * @since 0.3.0-incubating
      * @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)
@@ -152,6 +155,27 @@ public interface Graph extends AutoCloseable,GraphLike<Triple, BlankNodeOrIRI,
I
                                         RDFTerm object);
 
     /**
+     * This method is deprecated, use the equivalent method 
+     * {@link #stream()} instead. 
+     * 
+     */
+    @Deprecated
+    default Stream<? extends Triple> getTriples() {
+    	return stream();
+    }
+
+    /**
+     * This method is deprecated, use the equivalent method 
+     * {@link #stream(BlankNodeOrIRI, IRI, RDFTerm)} instead.
+     * 
+     */
+    @Deprecated    
+    default Stream<? extends Triple> getTriples(BlankNodeOrIRI subject, IRI predicate,
+            RDFTerm object) {
+    	return stream(subject, predicate, object);
+    }
+    
+    /**
      * Get an Iterable for iterating over all triples in the graph.
      * <p>
      * This method is meant to be used with a Java for-each loop, e.g.:

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/14e505e3/api/src/main/java/org/apache/commons/rdf/api/GraphLike.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/org/apache/commons/rdf/api/GraphLike.java b/api/src/main/java/org/apache/commons/rdf/api/GraphLike.java
index 28c2f10..c68278e 100644
--- a/api/src/main/java/org/apache/commons/rdf/api/GraphLike.java
+++ b/api/src/main/java/org/apache/commons/rdf/api/GraphLike.java
@@ -31,6 +31,7 @@ import java.util.stream.Stream;
  * include semantics like {@link #size()} or the requirement of mapping
  * {@link RDFTerm} instances from different implementations.
  * 
+ * @since 0.3.0-incubating
  * @see Graph
  * @see Dataset
  * @see TripleLike

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/14e505e3/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 348595b..5a67571 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
@@ -28,6 +28,7 @@ import java.util.Optional;
  * Concepts and Abstract Syntax</a>, a W3C Working Group Note published on 25
  * February 2014.
  * 
+ * @since 0.3.0-incubating
  * @see <a href="http://www.w3.org/TR/2014/NOTE-rdf11-datasets-20140225/">RDF
  *      1.1: On Semantics of RDF Datasets</a>
  * @see <a href="http://www.w3.org/TR/rdf11-concepts/#section-dataset"> </a>

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/14e505e3/api/src/main/java/org/apache/commons/rdf/api/QuadLike.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/org/apache/commons/rdf/api/QuadLike.java b/api/src/main/java/org/apache/commons/rdf/api/QuadLike.java
index 7ed7255..9c42465 100644
--- a/api/src/main/java/org/apache/commons/rdf/api/QuadLike.java
+++ b/api/src/main/java/org/apache/commons/rdf/api/QuadLike.java
@@ -33,6 +33,7 @@ import java.util.Optional;
  * name {@link G}.
  * <p>
  * 
+ * @since 0.3.0-incubating
  * @see Quad
  */
 public interface QuadLike<S extends RDFTerm, P extends RDFTerm, O extends RDFTerm, G extends
RDFTerm>

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/14e505e3/api/src/main/java/org/apache/commons/rdf/api/TripleLike.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/org/apache/commons/rdf/api/TripleLike.java b/api/src/main/java/org/apache/commons/rdf/api/TripleLike.java
index c061cc7..2fbeb11 100644
--- a/api/src/main/java/org/apache/commons/rdf/api/TripleLike.java
+++ b/api/src/main/java/org/apache/commons/rdf/api/TripleLike.java
@@ -29,6 +29,7 @@ package org.apache.commons.rdf.api;
  * Implementations should specialise which {@link RDFTerm} subclasses they
  * return for subject {@link S}, predicate {@link P} and object {@link O}.
  * 
+ * @since 0.3.0-incubating
  * @see Triple
  * @see Quad
  * @see QuadLike

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/14e505e3/api/src/test/java/org/apache/commons/rdf/api/AbstractGraphTest.java
----------------------------------------------------------------------
diff --git a/api/src/test/java/org/apache/commons/rdf/api/AbstractGraphTest.java b/api/src/test/java/org/apache/commons/rdf/api/AbstractGraphTest.java
index 27b9ff4..67191de 100644
--- a/api/src/test/java/org/apache/commons/rdf/api/AbstractGraphTest.java
+++ b/api/src/test/java/org/apache/commons/rdf/api/AbstractGraphTest.java
@@ -296,7 +296,7 @@ public abstract class AbstractGraphTest {
             
             // look up BlankNodes by name
             IRI name = factory.createIRI("http://xmlns.com/foaf/0.1/name");
-            g3.getTriples(null, name, null).parallel().forEach( t ->
+            g3.stream(null, name, null).parallel().forEach( t ->
                 whoIsWho.put( t.getObject().ntriplesString(), t.getSubject()));
                         
             assertEquals(4, whoIsWho.size());
@@ -361,7 +361,7 @@ public abstract class AbstractGraphTest {
 
         // unordered() as we don't need to preserve triple order
         // sequential() as we don't (currently) require target Graph to be thread-safe
-        source.getTriples().unordered().sequential().forEach(t -> target.add(t));
+        source.stream().unordered().sequential().forEach(t -> target.add(t));
     }
 
     /**


Mime
View raw message