Repository: incubator-commonsrdf Updated Branches: refs/heads/master 1f19fd831 -> 902d21083
java.util.Optional import Project: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/commit/902d2108 Tree: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/tree/902d2108 Diff: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/diff/902d2108 Branch: refs/heads/master Commit: 902d21083b8c0c9103a516bd13f3737e1548850d Parents: 1f19fd8 Author: Stian Soiland-Reyes <st...@apache.org> Authored: Mon Nov 21 14:30:43 2016 +0000 Committer: Stian Soiland-Reyes <st...@apache.org> Committed: Mon Nov 21 14:30:43 2016 +0000 ---------------------------------------------------------------------- examples/src/example/IntroToRDF.java | 2 ++ src/site/markdown/introduction.md | 2 ++ 2 files changed, 4 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/902d2108/examples/src/example/IntroToRDF.java ---------------------------------------------------------------------- diff --git a/examples/src/example/IntroToRDF.java b/examples/src/example/IntroToRDF.java index 58aea85..9de1297 100644 --- a/examples/src/example/IntroToRDF.java +++ b/examples/src/example/IntroToRDF.java @@ -17,8 +17,10 @@ */ package example; +import java.util.Optional; import org.apache.commons.rdf.api.*; import org.apache.commons.rdf.simple.SimpleRDF; +import org.apache.commons.rdf.simple.Types; /** See http://commonsrdf.incubator.apache.org/introduction.html */ http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/902d2108/src/site/markdown/introduction.md ---------------------------------------------------------------------- diff --git a/src/site/markdown/introduction.md b/src/site/markdown/introduction.md index 6d731e0..3e7cbd2 100644 --- a/src/site/markdown/introduction.md +++ b/src/site/markdown/introduction.md @@ -422,6 +422,8 @@ You can use `optional.isPresent()` and `optional.get()` to check if a `Triple` matched the graph stream pattern: ```java +import java.util.Optional; +// ... Optional<? extends Triple> nameTriple = graph.stream(alice, name, null).findAny(); if (nameTriple.isPresent()) { System.out.println(nameTriple.get());