You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2015/05/29 22:41:25 UTC

[2/2] incubator-tinkerpop git commit: Update docs with respect to default cardinality config in TinkerGraph

Update docs with respect to default cardinality config in TinkerGraph


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

Branch: refs/heads/master
Commit: 3e4d70031cb2980073b71640d600fc6c9676b2f4
Parents: ff6067d
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri May 29 16:39:36 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri May 29 16:41:11 2015 -0400

----------------------------------------------------------------------
 docs/src/implementations.asciidoc | 17 +++++++++++++++++
 docs/src/the-graph.asciidoc       |  4 ++--
 2 files changed, 19 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/3e4d7003/docs/src/implementations.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/implementations.asciidoc b/docs/src/implementations.asciidoc
index c4a087a..061f06a 100644
--- a/docs/src/implementations.asciidoc
+++ b/docs/src/implementations.asciidoc
@@ -504,10 +504,27 @@ TinkerGraph has several settings that can be provided on creation via `Configura
 |gremlin.tinkergraph.vertexIdManager |The `IdManager` implementation to use for vertices.
 |gremlin.tinkergraph.edgeIdManager |The `IdManager` implementation to use for edges.
 |gremlin.tinkergraph.vertexPropertyIdManager |The `IdManager` implementation to use for vertex properties.
+|gremlin.tinkergraph.defaultVertexPropertyCardinality |The default `VertexProperty.Cardinality` to use when `Vertex.property(k,v)` is called.
 |=========================================================
 
 The `IdManager` settings above refer to how TinkerGraph will control identifiers for vertices, edges and vertex properties.  There are several options for each of these settings: `ANY`, `LONG`, `INTEGER`, `UUID`, or the fully qualified class name of an `IdManager` implementation on the classpath.  When not specified, the default values for all settings is `ANY`, meaning that the graph will work with any object on the JVM as the identifier and will generate new identifiers from `Long` when the identifier is not user supplied.  TinkerGraph will also expect the user to understand the types used for identifiers when querying, meaning that `g.V(1)` and `g.V(1L)` could return two different vertices.  `LONG`, `INTEGER` and `UUID` settings will try to coerce identifier values to the expected type as well as generate new identifiers with that specified type.
 
+It is important to consider the data being imported to TinkerGraph with respect to `defaultVertexPropertyCardinality` setting.  For example, if a `.gryo` file is known to contain multi-property data, be sure to set the default cardinality to `list` or else the data will import as `single`.  Consider the following:
+
+[gremlin-groovy]
+----
+graph = TinkerGraph.open()
+graph.io(gryo()).readGraph("data/tinkerpop-crew.kryo")
+g = graph.traversal()
+g.V().properties()
+conf = new BaseConfiguration()
+conf.setProperty("gremlin.tinkergraph.defaultVertexPropertyCardinality","list")
+graph = TinkerGraph.open(conf)
+graph.io(gryo()).readGraph("data/tinkerpop-crew.kryo")
+g = graph.traversal()
+g.V().properties()
+----
+
 [[neo4j-gremlin]]
 Neo4j-Gremlin
 -------------

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/3e4d7003/docs/src/the-graph.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/the-graph.asciidoc b/docs/src/the-graph.asciidoc
index aeefbea..8db78ed 100644
--- a/docs/src/the-graph.asciidoc
+++ b/docs/src/the-graph.asciidoc
@@ -116,7 +116,7 @@ g.V(v).values('name') <7>
 If the concept of vertex properties is difficult to grasp, then it may be best to think of vertex properties in terms of "literal vertices." A vertex can have an edge to a "literal vertex" that has a single value key/value -- e.g. "value=okram." The edge that points to that literal vertex has an edge-label of "name." The properties on the edge represent the literal vertex's properties. The "literal vertex" can not have any other edges to it (only one from the associated vertex).
 
 [[the-crew-toy-graph]]
-TIP: A toy graph demonstrating all of the new TinkerPop3 graph structure features is available at `TinkerFactory.createTheCrew()` and `data/tinkerpop-crew*`. This graph demonstrates multi-properties, meta-properties, and graph variables.
+TIP: A toy graph demonstrating all of the new TinkerPop3 graph structure features is available at `TinkerFactory.createTheCrew()` and `data/tinkerpop-crew*`. This graph demonstrates multi-properties and meta-properties.
 
 .TinkerPop Crew
 image::the-crew-graph.png[width=685]
@@ -133,7 +133,7 @@ g.V().has('name','gremlin').inE('uses').
       select().by('skill').by('name') // rank the users of gremlin by their skill level
 ----
 
-IMPORTANT: The default behavior for `Vertex.property(key,value)` is `Cardinality.single`.
+IMPORTANT: The default behavior for `Vertex.property(key,value)` is dependent on the graph implementation.  Please refer to the documentation of the graph to determine this method's behavior.
 
 Graph Variables
 ---------------