You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@jena.apache.org by GitBox <gi...@apache.org> on 2021/08/10 17:52:17 UTC
[GitHub] [jena] afs commented on a change in pull request #1046: JENA-2147: Add DatasetGraph.stream
afs commented on a change in pull request #1046:
URL: https://github.com/apache/jena/pull/1046#discussion_r686195506
##########
File path: jena-arq/src/main/java/org/apache/jena/sparql/core/DatasetGraph.java
##########
@@ -129,6 +133,22 @@ public default void addAll(DatasetGraph src) {
*/
public Iterator<Quad> findNG(Node g, Node s, Node p , Node o) ;
+ /** Returns a {@link Stream} of {@link Quad Quads} matching a pattern.
+ *
+ * @return a stream of quads in this dataset matching the pattern.
+ */
+ public default Stream<Quad> stream(Node g, Node s, Node p, Node o) {
+ return Iter.asStream(find(g, s, p, o));
+ }
+
+ /** Returns a {@link Stream} of {@link Quad Quads} in this dataset.
+ *
+ * @return a stream of quads in this dataset.
+ */
+ public default Stream<Quad> stream() {
+ return stream(Node.ANY, Node.ANY, Node.ANY, Node.ANY);
Review comment:
Maybe - seems like it is one way, as is the other of providing stream/4 specially and all the find() are adapters to streams so making stream() having additional layers.
So just following `Graph` here which defaults like this.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org
For additional commands, e-mail: pr-help@jena.apache.org