[GitHub] tinkerpop pull request #595: TINKERPOP-1608 XSLT for converting GraphSON
Github user asfgit closed the pull request at: https://github.com/apache/tinkerpop/pull/595 --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] tinkerpop pull request #595: TINKERPOP-1608 XSLT for converting GraphSON
Github user robertdale commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/595#discussion_r110806894 --- Diff: gremlin-core/src/main/resources/tp2-to-tp3-graphml.xslt --- @@ -0,0 +1,59 @@ + + + + + +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"> + + + + + + + + + + + + + + + + + + + + +vertex + + + + + + + + + --- End diff -- xsltproc is complaining because the apply-templates is not immediately after a new node when trying to apply selected attributes. From what I can tell, the only attributes that should be in the element are already explicitly defined. It is not necessary to copy attributes (@*) back into the element. That appears to be the main difference between TP2 and TP3 - that the label attribute is now a element with key attribute. Thus, the attribute selection can be removed. `` --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] tinkerpop pull request #595: TINKERPOP-1608 XSLT for converting GraphSON
Github user spmallette commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/595#discussion_r110656585 --- Diff: gremlin-core/src/main/resources/tp2-to-tp3-graphml.xslt --- @@ -0,0 +1,59 @@ + + + + + +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"> + + + + + + + + + + + + + + + + + + + + +vertex + + + + + + + + + --- End diff -- @pluradj how's your XSLT? any thoughts on this thread? --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] tinkerpop pull request #595: TINKERPOP-1608 XSLT for converting GraphSON
Github user dkuppitz commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/595#discussion_r110655969 --- Diff: gremlin-core/src/main/resources/tp2-to-tp3-graphml.xslt --- @@ -0,0 +1,59 @@ + + + + + +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"> + + + + + + + + + + + + + + + + + + + + +vertex + + + + + + + + + --- End diff -- I used XSLT many years ago and probably forgot everything I ever knew about it. Thus I have absolutely no idea why only this line is causing trouble. I was just trying out random things and commented out certain lines to find the root of the error. --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] tinkerpop pull request #595: TINKERPOP-1608 XSLT for converting GraphSON
Github user spmallette commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/595#discussion_r110653510 --- Diff: gremlin-core/src/main/resources/tp2-to-tp3-graphml.xslt --- @@ -0,0 +1,59 @@ + + + + + +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"> + + + + + + + + + + + + + + + + + + + + +vertex + + + + + + + + + --- End diff -- I don't remember my XSLT syntax too well - what's the difference? the pattern of `"node()|@*` is used everywhere else - do you know why it's fine to use in those other spots but not here? --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] tinkerpop pull request #595: TINKERPOP-1608 XSLT for converting GraphSON
Github user dkuppitz commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/595#discussion_r110650888 --- Diff: gremlin-core/src/main/resources/tp2-to-tp3-graphml.xslt --- @@ -0,0 +1,59 @@ + + + + + +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"> + + + + + + + + + + + + + + + + + + + + +vertex + + + + + + + + + --- End diff -- Adding to my previous comment; If this line uses `select="node()"` only, then `xsltproc` is able to produce a "valid" output. I'm not sure if there're corner cases where something could be missing in the output, but at a first sight it looks good to me. --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] tinkerpop pull request #595: TINKERPOP-1608 XSLT for converting GraphSON
Github user pluradj commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/595#discussion_r110463999 --- Diff: gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java --- @@ -286,6 +289,34 @@ public void shouldReadWriteSelfLoopingEdges() throws Exception { 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) --- End diff -- only need `String` and `Integer` vertex properties. --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] tinkerpop pull request #595: TINKERPOP-1608 XSLT for converting GraphSON
Github user pluradj commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/595#discussion_r110464956 --- Diff: 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] --- End diff -- If this doc is Java rather than Groovy, the syntax needs to be tidied up a bit with semicolons and double quoted strings. --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] tinkerpop pull request #595: TINKERPOP-1608 XSLT for converting GraphSON
GitHub user spmallette opened a pull request: https://github.com/apache/tinkerpop/pull/595 TINKERPOP-1608 XSLT for converting GraphSON https://issues.apache.org/jira/browse/TINKERPOP-1608 Finished up the PR originally started on #501 - this basically just takes the work @joshsh started over there, adds a test and documentation. Builds well with `mvn clean install -DincludeNeo4j` VOTE +1 You can merge this pull request into a Git repository by running: $ git pull https://github.com/apache/tinkerpop TINKERPOP-1608 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tinkerpop/pull/595.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 #595 commit cfef83624caa50af5b520738d3a817bda433628a Author: Joshua Shinavier Date: 2016-11-18T20:08:00Z Added TP2-to-TP3 GraphML XSLT to resources commit 22bcad585e2df84f6521296c41b6173563c56d15 Author: Stephen Mallette Date: 2017-04-06T13:41:29Z TINKERPOP-1608 Added test for GraphML transform commit 609e96b2799162f1d5409d26446efcda650f0c14 Author: Stephen Mallette Date: 2017-04-06T14:24:48Z TINKERPOP-1608 Update docs and changelog with GraphML XSTL --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. ---