You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by dk...@apache.org on 2015/06/08 19:05:49 UTC

[1/2] incubator-tinkerpop git commit: fixed Neo4j code sample

Repository: incubator-tinkerpop
Updated Branches:
  refs/heads/master b8993a019 -> 5c516402b


fixed Neo4j code sample


Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/542f4db3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/542f4db3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/542f4db3

Branch: refs/heads/master
Commit: 542f4db3e1087e2275e8113e1fe850fb98341a03
Parents: e9385f3
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Mon Jun 8 19:03:34 2015 +0200
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Mon Jun 8 19:03:34 2015 +0200

----------------------------------------------------------------------
 docs/src/implementations.asciidoc | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/542f4db3/docs/src/implementations.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/implementations.asciidoc b/docs/src/implementations.asciidoc
index e4f791a..8072926 100644
--- a/docs/src/implementations.asciidoc
+++ b/docs/src/implementations.asciidoc
@@ -666,6 +666,7 @@ g.V().has(label,'organism') // does not match as P.eq() does a full string match
 g.V().has(label,of('organism')) // LabelP.of() is specific to neo4j-gremlin and used for multi-label matching
 g.V().has(label,of('organism')).has(label,of('animal'))
 g.V().has(label,of('organism').and(of('animal')))
+graph.close()
 ----
 
 `LabelP.of()` is only required if multi-labels are leveraged. `LabelP.of()` is used when filtering/looking-up vertices by their label(s) as the standard `P.eq()` does a direct match on the `::`-representation of `vertex.label()`


[2/2] incubator-tinkerpop git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-tinkerpop

Posted by dk...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-tinkerpop


Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/5c516402
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/5c516402
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/5c516402

Branch: refs/heads/master
Commit: 5c516402b4962c896767fd3c9bed0cfe740ebbf7
Parents: 542f4db b8993a0
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Mon Jun 8 19:04:13 2015 +0200
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Mon Jun 8 19:04:13 2015 +0200

----------------------------------------------------------------------
 docs/src/implementations.asciidoc               | 60 +++++++++++++++-----
 .../gremlin/structure/util/ElementHelper.java   | 19 +++++--
 .../gremlin/neo4j/structure/Neo4jGraph.java     | 13 ++++-
 pom.xml                                         |  7 ++-
 4 files changed, 75 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5c516402/docs/src/implementations.asciidoc
----------------------------------------------------------------------
diff --cc docs/src/implementations.asciidoc
index 8072926,8882ab7..c31e31f
--- a/docs/src/implementations.asciidoc
+++ b/docs/src/implementations.asciidoc
@@@ -650,26 -670,35 +670,36 @@@ An example use case is presented below
  [gremlin-groovy]
  ----
  graph = Neo4jGraph.open('/tmp/neo4j')
- vertex = (Neo4jVertex) graph.addVertex('human::animal') // typecasting only required in Java
- vertex.label() // standard Vertex.label() method (note that labels are alphabetically sorted)
- vertex.labels() // specific Neo4jVertex.labels() method
- vertex.addLabel('organism') // specific Neo4jVertex.addLabel() method
+ vertex = (Neo4jVertex) graph.addVertex('human::animal') <1>
+ vertex.label() <2>
+ vertex.labels() <3>
+ vertex.addLabel('organism') <4>
  vertex.label()
- vertex.removeLabel('human') // specific Neo4jVertex.removeLabel() method
+ vertex.removeLabel('human') <5>
  vertex.labels()
- vertex.addLabel('organism') // add a repeat
+ vertex.addLabel('organism') <6>
  vertex.labels()
- vertex.removeLabel('human') // remove a label that doesn't exist
+ vertex.removeLabel('human') <7>
  vertex.label()
  g = graph.traversal()
- g.V().has(label,'organism') // does not match as P.eq() does a full string match
- g.V().has(label,of('organism')) // LabelP.of() is specific to neo4j-gremlin and used for multi-label matching
+ g.V().has(label,'organism') <8>
+ g.V().has(label,of('organism')) <9>
  g.V().has(label,of('organism')).has(label,of('animal'))
  g.V().has(label,of('organism').and(of('animal')))
 +graph.close()
  ----
  
- `LabelP.of()` is only required if multi-labels are leveraged. `LabelP.of()` is used when filtering/looking-up vertices by their label(s) as the standard `P.eq()` does a direct match on the `::`-representation of `vertex.label()`
+ <1> Typecasting to a `Neo4jVertex` is only required in Java.
+ <2> The standard `Vertex.label()` method returns all the labels in alphabetical order concatenated using `::`.
+ <3> `Neo4jVertex.labels()` method returns the individual labels as a set.
+ <4> `Neo4jVertex.addLabel()` method adds a single label.
+ <5> `Neo4jVertex.removeLabel()` method removes a single label.
+ <6> Labels are unique and thus duplicate labels don't exist.
+ <7> If a label that does not exist is removed, nothing happens.
+ <8> `P.eq()` does a full string match and should only be used if multi-labels are not leveraged.
+ <9> `LabelP.of()` is specific to `Neo4jGraph` and used for multi-label matching.
+ 
+ IMPORTANT: `LabelP.of()` is only required if multi-labels are leveraged. `LabelP.of()` is used when filtering/looking-up vertices by their label(s) as the standard `P.eq()` does a direct match on the `::`-representation of `vertex.label()`
  
  [[hadoop-gremlin]]
  Hadoop-Gremlin