GitHub user spmallette opened a pull request:
https://github.com/apache/tinkerpop/pull/423
TINKERPOP-1451 TinkerGraph persistence cannot handle a single file name as
the graph location
https://issues.apache.org/jira/browse/TINKERPOP-1451
works nicely now:
```text
gremlin> configuration = new
org.apache.commons.configuration.BaseConfiguration()
==>org.apache.commons.configuration.BaseConfiguration@18a3962d
gremlin>
configuration.setProperty(TinkerGraph.GREMLIN_TINKERGRAPH_GRAPH_LOCATION,
'test4.gryo')
==>null
gremlin> configuration.setProperty(Graph.GRAPH, TinkerGraph.class.getName())
==>null
gremlin>
configuration.setProperty(TinkerGraph.GREMLIN_TINKERGRAPH_GRAPH_FORMAT, 'gryo')
==>null
gremlin> graph = TinkerGraph.open(configuration)
==>tinkergraph[vertices:0 edges:0]
gremlin> v = graph.addVertex('Person')
==>v[0]
gremlin> v.property(list, 'age', 1)
==>vp[age->1]
gremlin> v.property(list, 'age', 2)
==>vp[age->2]
gremlin> v.properties()
==>vp[age->1]
==>vp[age->2]
gremlin> graph.close()
==>null
gremlin>
configuration.setProperty(TinkerGraph.GREMLIN_TINKERGRAPH_DEFAULT_VERTEX_PROPERTY_CARDINALITY,
VertexProperty.Cardinality.list.toString());
==>null
gremlin> graph = TinkerGraph.open(configuration)
==>tinkergraph[vertices:1 edges:0]
gremlin> graph.traversal().V().properties()
==>vp[age->1]
==>vp[age->2]
```
VOTE +1
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/apache/tinkerpop TINKERPOP-1451
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/tinkerpop/pull/423.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #423
----
commit 6a6b44d85a4e3e7f6e83778aab9fc21436ef6004
Author: Stephen Mallette <[email protected]>
Date: 2016-09-15T17:51:33Z
TinkerGraph's would not save on close()
if the path was just a file name. Tested "just a file name" manually and
added a test for relative paths - didn't want to generate test data outside of
our test directories. TINKERPOP-1451
commit b1579f38038e85842bb8699e4397b390e24a57c8
Author: Stephen Mallette <[email protected]>
Date: 2016-09-15T17:57:21Z
Modified TinkerGraph IO test to use just the filename for the path
Change my mind from the previous commit. Probably better to have the test
for exactly what was failing.
Changed my mind about
commit 2d57a32af554271c766ad4cfa0856b57b5806da7
Author: Stephen Mallette <[email protected]>
Date: 2016-09-15T18:08:31Z
Added a test for persisting multi-properties in TinkerGraph
Changed the test back to using a relative path in the data directory -
didn't like it polluting the source control directories.
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---