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/16 12:33:37 UTC
incubator-tinkerpop git commit: Feature check for metaproperties
prior to creation in stargraph TINKERPOP3-684
Repository: incubator-tinkerpop
Updated Branches:
refs/heads/master 15899c761 -> 36fc0286b
Feature check for metaproperties prior to creation in stargraph TINKERPOP3-684
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/36fc0286
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/36fc0286
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/36fc0286
Branch: refs/heads/master
Commit: 36fc0286ba640c83a3140fb3f21e94b200ad2499
Parents: 15899c7
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Sat May 16 06:32:49 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Sat May 16 06:32:49 2015 -0400
----------------------------------------------------------------------
.../apache/tinkerpop/gremlin/structure/util/star/StarGraph.java | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/36fc0286/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraph.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraph.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraph.java
index 894599d..50c3a79 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraph.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraph.java
@@ -176,9 +176,12 @@ public final class StarGraph implements Graph, Serializable {
// else convert to a star graph
final StarGraph starGraph = new StarGraph();
final StarVertex starVertex = (StarVertex) starGraph.addVertex(T.id, vertex.id(), T.label, vertex.label());
+
+ final boolean supportsMetaProperties = vertex.graph().features().vertex().supportsMetaProperties();
+
vertex.properties().forEachRemaining(vp -> {
final VertexProperty<?> starVertexProperty = starVertex.property(VertexProperty.Cardinality.list, vp.key(), vp.value(), T.id, vp.id());
- vp.properties().forEachRemaining(p -> starVertexProperty.property(p.key(), p.value()));
+ if (supportsMetaProperties) vp.properties().forEachRemaining(p -> starVertexProperty.property(p.key(), p.value()));
});
vertex.edges(Direction.IN).forEachRemaining(edge -> {
final Edge starEdge = starVertex.addInEdge(edge.label(), starGraph.addVertex(T.id, edge.outVertex().id()), T.id, edge.id());