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 2017/04/07 19:53:44 UTC

[1/8] tinkerpop git commit: TINKERPOP-1664 Fixed a bug in StarVertexProperty where properties are now validated. Key value arrays now check for null values. [Forced Update!]

Repository: tinkerpop
Updated Branches:
  refs/heads/TINKERPOP-1608 bab6a40fc -> 93b31fd48 (forced update)


TINKERPOP-1664  Fixed a bug in StarVertexProperty where properties are now validated.
Key value arrays now check for null values.


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

Branch: refs/heads/TINKERPOP-1608
Commit: 4713be48a415bb6a253231298a8bc1c324207eb3
Parents: 11903a2
Author: BrynCooke <br...@gmail.com>
Authored: Thu Apr 6 09:45:18 2017 +0100
Committer: BrynCooke <br...@gmail.com>
Committed: Thu Apr 6 09:45:18 2017 +0100

----------------------------------------------------------------------
 CHANGELOG.asciidoc                                          | 4 ++++
 .../tinkerpop/gremlin/structure/util/ElementHelper.java     | 4 ++++
 .../tinkerpop/gremlin/structure/util/star/StarGraph.java    | 1 +
 .../tinkerpop/gremlin/structure/util/ElementHelperTest.java | 9 +++++++++
 4 files changed, 18 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4713be48/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 3ac081b..54ab8dd 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -30,6 +30,10 @@ TinkerPop 3.1.7 (Release Date: NOT OFFICIALLY RELEASED YET)
 * Fixed `EventStrategy` so that newly added properties trigger events with the name of the key that was added.
 * Drop use of jitpack for the jbcrypt artifact - using the official one in Maven Central.
 
+Bugs
+^^^^
+* TINKERPOP-1664 StarVertexProperty properties were not validated.
+
 [[release-3-1-6]]
 TinkerPop 3.1.6 (Release Date: February 3, 2017)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4713be48/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java
index d42bdee..d0d6aab 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java
@@ -116,6 +116,10 @@ public final class ElementHelper {
         for (int i = 0; i < propertyKeyValues.length; i = i + 2) {
             if (!(propertyKeyValues[i] instanceof String) && !(propertyKeyValues[i] instanceof T))
                 throw Element.Exceptions.providedKeyValuesMustHaveALegalKeyOnEvenIndices();
+
+            if (propertyKeyValues[i + 1] == null) {
+                throw Property.Exceptions.propertyValueCanNotBeNull();
+            }
         }
     }
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4713be48/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 2089c42..d9dc329 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
@@ -480,6 +480,7 @@ public final class StarGraph implements Graph, Serializable {
 
         @Override
         public <U> Property<U> property(final String key, final U value) {
+            ElementHelper.validateProperty(key, value);
             if (null == metaProperties)
                 metaProperties = new HashMap<>();
             Map<String, Object> properties = metaProperties.get(this.id);

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4713be48/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelperTest.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelperTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelperTest.java
index e8ec27c..f4c8082 100644
--- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelperTest.java
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelperTest.java
@@ -119,6 +119,15 @@ public class ElementHelperTest {
     }
 
     @Test
+    public void shouldNotAllowEvenNumberOfKeyValuesAndInvalidValues() {
+        try {
+            ElementHelper.legalPropertyKeyValueArray("aKey", "test", "value-for-this-one", 1, "1", null);
+        } catch (IllegalArgumentException iae) {
+            assertEquals(Property.Exceptions.propertyValueCanNotBeNull().getMessage(), iae.getMessage());
+        }
+    }
+
+    @Test
     public void shouldFindTheIdValueAlone() {
         assertEquals(123l, ElementHelper.getIdValue(T.id, 123l).get());
     }


[3/8] tinkerpop git commit: Reversed logic of if to place null first CTR

Posted by sp...@apache.org.
Reversed logic of if to place null first CTR


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

Branch: refs/heads/TINKERPOP-1608
Commit: 7c99635e4909b6904e89020b02a9193d5b7ea0d9
Parents: df9de56
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Apr 7 09:03:02 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Apr 7 09:03:02 2017 -0400

----------------------------------------------------------------------
 .../org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/7c99635e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java
index d0d6aab..445b9e5 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java
@@ -117,7 +117,7 @@ public final class ElementHelper {
             if (!(propertyKeyValues[i] instanceof String) && !(propertyKeyValues[i] instanceof T))
                 throw Element.Exceptions.providedKeyValuesMustHaveALegalKeyOnEvenIndices();
 
-            if (propertyKeyValues[i + 1] == null) {
+            if (null == propertyKeyValues[i + 1]) {
                 throw Property.Exceptions.propertyValueCanNotBeNull();
             }
         }


[2/8] tinkerpop git commit: Fixed changelog entry CTR

Posted by sp...@apache.org.
Fixed changelog entry CTR


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

Branch: refs/heads/TINKERPOP-1608
Commit: df9de56e4749fd74b4fd18b4542ac28026c71d4b
Parents: 4713be4
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Apr 7 09:02:18 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Apr 7 09:02:18 2017 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/df9de56e/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 54ab8dd..effdc07 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -26,14 +26,11 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 TinkerPop 3.1.7 (Release Date: NOT OFFICIALLY RELEASED YET)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
+* Added validation to `StarVertexProperty`.
 * Bumped to Jackson 2.8.7.
 * Fixed `EventStrategy` so that newly added properties trigger events with the name of the key that was added.
 * Drop use of jitpack for the jbcrypt artifact - using the official one in Maven Central.
 
-Bugs
-^^^^
-* TINKERPOP-1664 StarVertexProperty properties were not validated.
-
 [[release-3-1-6]]
 TinkerPop 3.1.6 (Release Date: February 3, 2017)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


[4/8] tinkerpop git commit: TINKERPOP-1608 Added test for GraphML transform

Posted by sp...@apache.org.
TINKERPOP-1608 Added test for GraphML transform


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

Branch: refs/heads/TINKERPOP-1608
Commit: 777747e6cdf8def87e4e51918027686cdb78f243
Parents: 2f90a7f
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Apr 6 09:41:29 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Apr 7 15:53:15 2017 -0400

----------------------------------------------------------------------
 .../src/main/resources/tp2-to-tp3-graphml.xslt  | 19 +++++++
 .../tinkerpop/gremlin/structure/io/IoTest.java  | 31 +++++++++++
 .../io/graphml/tinkerpop-classic-tp2.xml        | 54 ++++++++++++++++++++
 3 files changed, 104 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/777747e6/gremlin-core/src/main/resources/tp2-to-tp3-graphml.xslt
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/resources/tp2-to-tp3-graphml.xslt b/gremlin-core/src/main/resources/tp2-to-tp3-graphml.xslt
index 1944bcf..40d553b 100644
--- a/gremlin-core/src/main/resources/tp2-to-tp3-graphml.xslt
+++ b/gremlin-core/src/main/resources/tp2-to-tp3-graphml.xslt
@@ -1,4 +1,22 @@
 <?xml version="1.0" ?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+
 <!-- XSL stylesheet to convert TinkerPop v2 GraphML files for Apache TinkerPop v3 -->
 <xsl:stylesheet version="1.0"
                 xmlns="http://graphml.graphdrawing.org/xmlns"
@@ -34,6 +52,7 @@
             <data key="labelE">
                 <xsl:value-of select="@label"/>
             </data>
+            <xsl:apply-templates select="node()|@*"/>
         </edge>
     </xsl:template>
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/777747e6/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
index 428a0d8..2c13c2f 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
@@ -55,6 +55,9 @@ import org.slf4j.LoggerFactory;
 
 import javax.xml.XMLConstants;
 import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.stream.StreamResult;
 import javax.xml.transform.stream.StreamSource;
 import javax.xml.validation.Schema;
 import javax.xml.validation.SchemaFactory;
@@ -286,6 +289,34 @@ public class IoTest {
             assertEquals(IteratorUtils.count(source.vertices()), IteratorUtils.count(target.vertices()));
             assertEquals(IteratorUtils.count(source.edges()), IteratorUtils.count(target.edges()));
         }
+
+        @Test
+        @FeatureRequirement(featureClass = Graph.Features.EdgeFeatures.class, feature = Graph.Features.EdgeFeatures.FEATURE_ADD_EDGES)
+        @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
+        @FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_STRING_VALUES)
+        @FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_INTEGER_VALUES)
+        @FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_FLOAT_VALUES)
+        @FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_BOOLEAN_VALUES)
+        @FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_LONG_VALUES)
+        @FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_DOUBLE_VALUES)
+        @FeatureRequirement(featureClass = EdgePropertyFeatures.class, feature = EdgePropertyFeatures.FEATURE_FLOAT_VALUES)
+        public void shouldTransformGraphMLV2ToV3ViaXSLT() throws Exception {
+            final InputStream stylesheet = Thread.currentThread().getContextClassLoader().getResourceAsStream("tp2-to-tp3-graphml.xslt");
+            final InputStream datafile = IoTest.class.getResourceAsStream(TestHelper.convertPackageToResourcePath(GraphMLResourceAccess.class) + "tinkerpop-classic-tp2.xml");
+            final ByteArrayOutputStream output = new ByteArrayOutputStream();
+
+            final TransformerFactory tFactory = TransformerFactory.newInstance();
+            final StreamSource stylesource = new StreamSource(stylesheet);
+            final Transformer transformer = tFactory.newTransformer(stylesource);
+
+            final StreamSource source = new StreamSource(datafile);
+            final StreamResult result = new StreamResult(output);
+            transformer.transform(source, result);
+
+            final GraphReader reader = GraphMLReader.build().create();
+            reader.readGraph(new ByteArrayInputStream(output.toByteArray()), graph);
+            assertClassicGraph(graph, false, true);
+        }
     }
 
     public static final class GryoTest extends AbstractGremlinTest {

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/777747e6/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphml/tinkerpop-classic-tp2.xml
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphml/tinkerpop-classic-tp2.xml b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphml/tinkerpop-classic-tp2.xml
new file mode 100644
index 0000000..b056732
--- /dev/null
+++ b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphml/tinkerpop-classic-tp2.xml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<graphml xmlns="http://graphml.graphdrawing.org/xmlns"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns
+        http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
+    <key id="weight" for="edge" attr.name="weight" attr.type="float"/>
+    <key id="name" for="node" attr.name="name" attr.type="string"/>
+    <key id="age" for="node" attr.name="age" attr.type="int"/>
+    <key id="lang" for="node" attr.name="lang" attr.type="string"/>
+    <graph id="G" edgedefault="directed">
+        <node id="1">
+            <data key="name">marko</data>
+            <data key="age">29</data>
+        </node>
+        <node id="2">
+            <data key="name">vadas</data>
+            <data key="age">27</data>
+        </node>
+        <node id="3">
+            <data key="name">lop</data>
+            <data key="lang">java</data>
+        </node>
+        <node id="4">
+            <data key="name">josh</data>
+            <data key="age">32</data>
+        </node>
+        <node id="5">
+            <data key="name">ripple</data>
+            <data key="lang">java</data>
+        </node>
+        <node id="6">
+            <data key="name">peter</data>
+            <data key="age">35</data>
+        </node>
+        <edge id="7" source="1" target="2" label="knows">
+            <data key="weight">0.5</data>
+        </edge>
+        <edge id="8" source="1" target="4" label="knows">
+            <data key="weight">1.0</data>
+        </edge>
+        <edge id="9" source="1" target="3" label="created">
+            <data key="weight">0.4</data>
+        </edge>
+        <edge id="10" source="4" target="5" label="created">
+            <data key="weight">1.0</data>
+        </edge>
+        <edge id="11" source="4" target="3" label="created">
+            <data key="weight">0.4</data>
+        </edge>
+        <edge id="12" source="6" target="3" label="created">
+            <data key="weight">0.2</data>
+        </edge>
+    </graph>
+</graphml>
\ No newline at end of file


[7/8] tinkerpop git commit: TINKERPOP-1608 Cleaned up java source in docs a bit.

Posted by sp...@apache.org.
TINKERPOP-1608 Cleaned up java source in docs a bit.


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

Branch: refs/heads/TINKERPOP-1608
Commit: c47fda69b0512b26ddf974d2a7043da14d9da49c
Parents: 7683bf9
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Apr 7 15:47:53 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Apr 7 15:53:33 2017 -0400

----------------------------------------------------------------------
 docs/src/reference/the-graph.asciidoc | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c47fda69/docs/src/reference/the-graph.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/the-graph.asciidoc b/docs/src/reference/the-graph.asciidoc
index 26ed778..09c11fa 100644
--- a/docs/src/reference/the-graph.asciidoc
+++ b/docs/src/reference/the-graph.asciidoc
@@ -451,23 +451,23 @@ specification that were corrected for 3.x. As a result, attempting to read a Gra
 
 [source,java]
 ----
-import javax.xml.parsers.DocumentBuilderFactory
-import javax.xml.transform.TransformerFactory
-import javax.xml.transform.dom.DOMSource
-import javax.xml.transform.stream.StreamSource
-import javax.xml.transform.stream.StreamResult
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.transform.stream.StreamResult;
 
 InputStream stylesheet = Thread.currentThread().getContextClassLoader().getResourceAsStream("tp2-to-tp3-graphml.xslt");
-File datafile = new File('/tmp/tp2-graphml.xml')
-File outfile = new File('/tmp/tp3-graphml.xml')
+File datafile = new File('/tmp/tp2-graphml.xml');
+File outfile = new File('/tmp/tp3-graphml.xml');
 
-TransformerFactory tFactory = TransformerFactory.newInstance()
-StreamSource stylesource = new StreamSource(stylesheet)
-Transformer transformer = tFactory.newTransformer(stylesource)
+TransformerFactory tFactory = TransformerFactory.newInstance();
+StreamSource stylesource = new StreamSource(stylesheet);
+Transformer transformer = tFactory.newTransformer(stylesource);
 
-StreamSource source = new StreamSource(datafile)
-StreamResult result = new StreamResult(new FileWriter(outfile))
-transformer.transform(source, result)
+StreamSource source = new StreamSource(datafile);
+StreamResult result = new StreamResult(new FileWriter(outfile));
+transformer.transform(source, result);
 ----
 
 [[graphson-reader-writer]]


[8/8] tinkerpop git commit: TINKERPOP-1608 Cleaned up bad features on graphml xslt test

Posted by sp...@apache.org.
TINKERPOP-1608 Cleaned up bad features on graphml xslt test


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

Branch: refs/heads/TINKERPOP-1608
Commit: 93b31fd48663fd45aaf39a254e35b12849d933aa
Parents: c47fda6
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Apr 7 15:52:04 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Apr 7 15:53:33 2017 -0400

----------------------------------------------------------------------
 .../java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java   | 4 ----
 1 file changed, 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/93b31fd4/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
index 2c13c2f..9246aa7 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
@@ -295,10 +295,6 @@ public class IoTest {
         @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
         @FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_STRING_VALUES)
         @FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_INTEGER_VALUES)
-        @FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_FLOAT_VALUES)
-        @FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_BOOLEAN_VALUES)
-        @FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_LONG_VALUES)
-        @FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_DOUBLE_VALUES)
         @FeatureRequirement(featureClass = EdgePropertyFeatures.class, feature = EdgePropertyFeatures.FEATURE_FLOAT_VALUES)
         public void shouldTransformGraphMLV2ToV3ViaXSLT() throws Exception {
             final InputStream stylesheet = Thread.currentThread().getContextClassLoader().getResourceAsStream("tp2-to-tp3-graphml.xslt");


[5/8] tinkerpop git commit: Added TP2-to-TP3 GraphML XSLT to resources

Posted by sp...@apache.org.
Added TP2-to-TP3 GraphML XSLT to resources


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

Branch: refs/heads/TINKERPOP-1608
Commit: 2f90a7f7b5f41f0b4a819202cf5cc48373aef165
Parents: 7c99635
Author: Joshua Shinavier <jo...@fortytwo.net>
Authored: Fri Nov 18 12:08:00 2016 -0800
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Apr 7 15:53:15 2017 -0400

----------------------------------------------------------------------
 .../src/main/resources/tp2-to-tp3-graphml.xslt  | 40 ++++++++++++++++++++
 1 file changed, 40 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2f90a7f7/gremlin-core/src/main/resources/tp2-to-tp3-graphml.xslt
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/resources/tp2-to-tp3-graphml.xslt b/gremlin-core/src/main/resources/tp2-to-tp3-graphml.xslt
new file mode 100644
index 0000000..1944bcf
--- /dev/null
+++ b/gremlin-core/src/main/resources/tp2-to-tp3-graphml.xslt
@@ -0,0 +1,40 @@
+<?xml version="1.0" ?>
+<!-- XSL stylesheet to convert TinkerPop v2 GraphML files for Apache TinkerPop v3 -->
+<xsl:stylesheet version="1.0"
+                xmlns="http://graphml.graphdrawing.org/xmlns"
+                xmlns:graphml="http://graphml.graphdrawing.org/xmlns"
+                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                exclude-result-prefixes="graphml">
+    <xsl:output method="xml" indent="yes" omit-xml-declaration="yes"/>
+    <xsl:strip-space elements="*"/>
+
+    <xsl:template match="node()|@*">
+        <xsl:copy>
+            <xsl:apply-templates select="node()|@*"/>
+        </xsl:copy>
+    </xsl:template>
+
+    <xsl:template match="graphml:graphml">
+        <graphml>
+            <key id="labelV" for="node" attr.name="labelV" attr.type="string"/>
+            <key id="labelE" for="edge" attr.name="labelE" attr.type="string"/>
+            <xsl:apply-templates/>
+        </graphml>
+    </xsl:template>
+
+    <xsl:template match="graphml:node">
+        <node>
+            <xsl:apply-templates select="node()|@*"/>
+            <data key="labelV">vertex</data>
+        </node>
+    </xsl:template>
+
+    <xsl:template match="graphml:edge">
+        <edge id="{@id}" source="{@source}" target="{@target}">
+            <data key="labelE">
+                <xsl:value-of select="@label"/>
+            </data>
+        </edge>
+    </xsl:template>
+
+</xsl:stylesheet>


[6/8] tinkerpop git commit: TINKERPOP-1608 Update docs and changelog with GraphML XSTL

Posted by sp...@apache.org.
TINKERPOP-1608 Update docs and changelog with GraphML XSTL


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

Branch: refs/heads/TINKERPOP-1608
Commit: 7683bf9f5bd0be832cf09b9e84c56effd89b14bc
Parents: 777747e
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Apr 6 10:24:48 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Apr 7 15:53:33 2017 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |  1 +
 docs/src/reference/the-graph.asciidoc           | 26 ++++++++++++++++++++
 .../upgrade/release-3.1.x-incubating.asciidoc   | 16 ++++++++++--
 3 files changed, 41 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/7683bf9f/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index effdc07..bb42ff9 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -26,6 +26,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 TinkerPop 3.1.7 (Release Date: NOT OFFICIALLY RELEASED YET)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
+* Added XSLT transform option to convert TinkerPop 2.x GraphML to 3.x GraphML.
 * Added validation to `StarVertexProperty`.
 * Bumped to Jackson 2.8.7.
 * Fixed `EventStrategy` so that newly added properties trigger events with the name of the key that was added.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/7683bf9f/docs/src/reference/the-graph.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/the-graph.asciidoc b/docs/src/reference/the-graph.asciidoc
index e51c309..26ed778 100644
--- a/docs/src/reference/the-graph.asciidoc
+++ b/docs/src/reference/the-graph.asciidoc
@@ -444,6 +444,32 @@ try (final InputStream stream = new FileInputStream("tinkerpop-modern.xml")) {
 }
 ----
 
+GraphML was a supported format in TinkerPop 2.x, but there were several issues that made it inconsistent with the
+specification that were corrected for 3.x. As a result, attempting to read a GraphML file generated by 2.x with the
+3.x `GraphMLReader` will result in error. To help with this problem, an XSLT file is provided as a resource in
+`gremlin-core` which will transform 2.x GraphML to 3.x GraphML. It can be used as follows:
+
+[source,java]
+----
+import javax.xml.parsers.DocumentBuilderFactory
+import javax.xml.transform.TransformerFactory
+import javax.xml.transform.dom.DOMSource
+import javax.xml.transform.stream.StreamSource
+import javax.xml.transform.stream.StreamResult
+
+InputStream stylesheet = Thread.currentThread().getContextClassLoader().getResourceAsStream("tp2-to-tp3-graphml.xslt");
+File datafile = new File('/tmp/tp2-graphml.xml')
+File outfile = new File('/tmp/tp3-graphml.xml')
+
+TransformerFactory tFactory = TransformerFactory.newInstance()
+StreamSource stylesource = new StreamSource(stylesheet)
+Transformer transformer = tFactory.newTransformer(stylesource)
+
+StreamSource source = new StreamSource(datafile)
+StreamResult result = new StreamResult(new FileWriter(outfile))
+transformer.transform(source, result)
+----
+
 [[graphson-reader-writer]]
 GraphSON Reader/Writer
 ~~~~~~~~~~~~~~~~~~~~~~

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/7683bf9f/docs/src/upgrade/release-3.1.x-incubating.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/upgrade/release-3.1.x-incubating.asciidoc b/docs/src/upgrade/release-3.1.x-incubating.asciidoc
index 05c34c2..2768048 100644
--- a/docs/src/upgrade/release-3.1.x-incubating.asciidoc
+++ b/docs/src/upgrade/release-3.1.x-incubating.asciidoc
@@ -25,10 +25,23 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 TinkerPop 3.1.7
 ---------------
 
-*Release Date: TBD*
+*Release Date: NOT OFFICIALLY RELEASED YET*
 
 Please see the link:https://github.com/apache/tinkerpop/blob/3.1.6/CHANGELOG.asciidoc#tinkerpop-xyz-release-date-MM-DD-YYYY[changelog] for a complete list of all the modifications that are part of this release.
 
+Upgrading for Users
+~~~~~~~~~~~~~~~~~~~
+
+GraphML XSLT
+^^^^^^^^^^^^
+
+There were some inconsistencies in the GraphML format supported in TinkerPop 2.x. These issues were corrected on the
+initial release of TinkerPop 3.0.0, but as a result, attempting to read GraphML from 2.x will end with an error. A
+newly added XSLT file in `gremlin-core`, called `tp2-to-tp3-graphml.xslt`, transforms 2.x GraphML into 3.x GraphML,
+making it possible easily read in legacy GraphML through a 3.x `GraphMLReader`.
+
+See: https://issues.apache.org/jira/browse/TINKERPOP-1608[TINKERPOP-1608]
+
 TinkerPop 3.1.6
 ---------------
 
@@ -53,7 +66,6 @@ to proceed only when the server was fully complete with its work.
 
 See: link:https://issues.apache.org/jira/browse/TINKERPOP-1544[TINKERPOP-1544]
 
-
 TinkerPop 3.1.5
 ---------------