Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 0CECE200BA0 for ; Thu, 8 Sep 2016 17:31:38 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 0BBAF160ABD; Thu, 8 Sep 2016 15:31:38 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 35EBD160AAD for ; Thu, 8 Sep 2016 17:31:37 +0200 (CEST) Received: (qmail 45090 invoked by uid 500); 8 Sep 2016 15:31:36 -0000 Mailing-List: contact commits-help@commonsrdf.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commonsrdf.incubator.apache.org Delivered-To: mailing list commits@commonsrdf.incubator.apache.org Received: (qmail 45079 invoked by uid 99); 8 Sep 2016 15:31:36 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Sep 2016 15:31:36 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 09E14C9B4A for ; Thu, 8 Sep 2016 15:31:36 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.344 X-Spam-Level: X-Spam-Status: No, score=-4.344 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-1.124] autolearn=disabled Received: from mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id wjCRyXK5ocWp for ; Thu, 8 Sep 2016 15:31:32 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with SMTP id 782A460F04 for ; Thu, 8 Sep 2016 15:31:31 +0000 (UTC) Received: (qmail 43123 invoked by uid 99); 8 Sep 2016 15:31:30 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Sep 2016 15:31:30 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id A77D1E03CE; Thu, 8 Sep 2016 15:31:30 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: stain@apache.org To: commits@commonsrdf.incubator.apache.org Date: Thu, 08 Sep 2016 15:31:57 -0000 Message-Id: In-Reply-To: <3c718392e03740a1b7d60ec78c1dc9db@git.apache.org> References: <3c718392e03740a1b7d60ec78c1dc9db@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [29/50] incubator-commonsrdf git commit: Include @Deprecated getTriples() archived-at: Thu, 08 Sep 2016 15:31:38 -0000 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/jsonld-java Commit: 14e505e33d10b72fc22efd5c7952ad63f16f2393 Parents: 14f246e Author: Stian Soiland-Reyes Authored: Thu Jun 2 17:30:50 2016 +0100 Committer: Stian Soiland-Reyes 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 * 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 stream(); - + /** * Get all triples contained by the graph matched with the pattern. *

@@ -142,7 +143,9 @@ public interface Graph extends AutoCloseable,GraphLike * Implementations may throw {@link ConcurrentModificationException} from Stream * methods if they detect a conflict while the Stream is active. - * + *

+ * + * @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 getTriples() { + return stream(); + } + + /** + * This method is deprecated, use the equivalent method + * {@link #stream(BlankNodeOrIRI, IRI, RDFTerm)} instead. + * + */ + @Deprecated + default Stream getTriples(BlankNodeOrIRI subject, IRI predicate, + RDFTerm object) { + return stream(subject, predicate, object); + } + + /** * Get an Iterable for iterating over all triples in the graph. *

* 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 W3C Working Group Note published on 25 * February 2014. * + * @since 0.3.0-incubating * @see RDF * 1.1: On Semantics of RDF Datasets * @see 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}. *

* + * @since 0.3.0-incubating * @see Quad */ public interface QuadLike 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)); } /**