Details

      Description

      Create a gremlin-examples module that in turn would have some sub-modules containing example Gremlin code. The thread of discussion is here:

      https://pony-poc.apache.org/thread.html/Z1mhshgtenmsu87

      but in summary, there were ideas to write example modules for lots of different things:

      • Gremlin Server usage
      • DSL examples – SocialTraversal/etc.
      • Language compiler – Java RegEx into Gremlin instructions (e.g.).
      • Build your own implementation examples — like a stub of a graph implementation to get people going.
      • maven archetypes

      For this task, I think this just entails setting up the pattern for doing this. Perhaps we could include the work of Jason Plurad (if he'd care to contribute it) at:

      https://github.com/pluradj/tp3-java-example

      or something similar. We could then expand from there.

        Activity

        Hide
        spmallette stephen mallette added a comment -

        Ultimately opting to implement "examples" purely with Maven archetypes as was suggested by several individuals on the mailing list. Seems like the cleanest way to do this.

        Show
        spmallette stephen mallette added a comment - Ultimately opting to implement "examples" purely with Maven archetypes as was suggested by several individuals on the mailing list. Seems like the cleanest way to do this.
        Hide
        githubbot ASF GitHub Bot added a comment -

        GitHub user spmallette opened a pull request:

        https://github.com/apache/incubator-tinkerpop/pull/237

        TINKERPOP-1085 Added gremlin-archetypes and related submodules

        https://issues.apache.org/jira/browse/TINKERPOP-1085

        Established the model for "examples" in TinkerPop using Maven archetypes. Provided two archetypes: gremlin-archetype-server and gremlin-archetype-tinkergraph.

        Note that each archetype has tests to validate their operations and the tests are configured to execute on standard execution of `mvn clean install`. You can manually try out the achetypes with a command like this:

        ```text
        $ mvn archetype:generate -DarchetypeGroupId=org.apache.tinkerpop -DarchetypeArtifactId=gremlin-archetype-server -DarchetypeVersion=3.1.2-SNAPSHOT -DgroupId=com.my -DartifactId=app
        ```

        which will create a project (based on the `gremlin-archetype-server` module) in a directory called "app".

        VOTE +1

        You can merge this pull request into a Git repository by running:

        $ git pull https://github.com/apache/incubator-tinkerpop TINKERPOP-1085

        Alternatively you can review and apply these changes as the patch at:

        https://github.com/apache/incubator-tinkerpop/pull/237.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 #237


        commit bb3bf09f57ba2ceb40565f2f9cefa886718d241d
        Author: Stephen Mallette <spmva@genoprime.com>
        Date: 2016-02-23T15:01:15Z

        Added gremlin-archetypes and related submodules.

        Established the model for "examples" in TinkerPop using Maven archetypes. Provided two archetypes: gremlin-archetype-server and gremlin-archetype-tinkergraph.


        Show
        githubbot ASF GitHub Bot added a comment - GitHub user spmallette opened a pull request: https://github.com/apache/incubator-tinkerpop/pull/237 TINKERPOP-1085 Added gremlin-archetypes and related submodules https://issues.apache.org/jira/browse/TINKERPOP-1085 Established the model for "examples" in TinkerPop using Maven archetypes. Provided two archetypes: gremlin-archetype-server and gremlin-archetype-tinkergraph. Note that each archetype has tests to validate their operations and the tests are configured to execute on standard execution of `mvn clean install`. You can manually try out the achetypes with a command like this: ```text $ mvn archetype:generate -DarchetypeGroupId=org.apache.tinkerpop -DarchetypeArtifactId=gremlin-archetype-server -DarchetypeVersion=3.1.2-SNAPSHOT -DgroupId=com.my -DartifactId=app ``` which will create a project (based on the `gremlin-archetype-server` module) in a directory called "app". VOTE +1 You can merge this pull request into a Git repository by running: $ git pull https://github.com/apache/incubator-tinkerpop TINKERPOP-1085 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/incubator-tinkerpop/pull/237.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 #237 commit bb3bf09f57ba2ceb40565f2f9cefa886718d241d Author: Stephen Mallette <spmva@genoprime.com> Date: 2016-02-23T15:01:15Z Added gremlin-archetypes and related submodules. Established the model for "examples" in TinkerPop using Maven archetypes. Provided two archetypes: gremlin-archetype-server and gremlin-archetype-tinkergraph.
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user okram commented on the pull request:

        https://github.com/apache/incubator-tinkerpop/pull/237#issuecomment-188286536

        VOTE +1. When you merge can you publish fresh docs to 3.1.2-SNAPSHOT so I can get a better sense of the organization of things?

        Show
        githubbot ASF GitHub Bot added a comment - Github user okram commented on the pull request: https://github.com/apache/incubator-tinkerpop/pull/237#issuecomment-188286536 VOTE +1. When you merge can you publish fresh docs to 3.1.2-SNAPSHOT so I can get a better sense of the organization of things?
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user pluradj commented on a diff in the pull request:

        https://github.com/apache/incubator-tinkerpop/pull/237#discussion_r53957947

        — Diff: CHANGELOG.asciidoc —
        @@ -26,6 +26,9 @@ image::https://raw.githubusercontent.com/apache/incubator-tinkerpop/master/docs/
        TinkerPop 3.1.2 (NOT OFFICIALLY RELEASED YET)
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        +* Added the `gremlin-archetype-driver` archetype that demonstrates
        — End diff –

        no `gremlin-archetype-driver`. this line can be removed.

        Show
        githubbot ASF GitHub Bot added a comment - Github user pluradj commented on a diff in the pull request: https://github.com/apache/incubator-tinkerpop/pull/237#discussion_r53957947 — Diff: CHANGELOG.asciidoc — @@ -26,6 +26,9 @@ image:: https://raw.githubusercontent.com/apache/incubator-tinkerpop/master/docs/ TinkerPop 3.1.2 (NOT OFFICIALLY RELEASED YET) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +* Added the `gremlin-archetype-driver` archetype that demonstrates — End diff – no `gremlin-archetype-driver`. this line can be removed.
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user pluradj commented on a diff in the pull request:

        https://github.com/apache/incubator-tinkerpop/pull/237#discussion_r53960519

        — Diff: docs/src/reference/gremlin-applications.asciidoc —
        @@ -1880,3 +1880,25 @@ The following shows the output for `HadoopGraph`:


        describeGraph(HadoopGraph)


        +
        +[[gremlin-archetypes]]
        +Gremlin Archetypes
        +==================
        +
        +TinkerPop has a number of link:https://maven.apache.org/guides/introduction/introduction-to-archetypes.html[Maven archetypes],
        +which provide example project templates to quickly get started with TinkerPop. The available archetypes are as follows:
        +
        +* `gremlin-archetype-server` - An example project that demonstrates the basic structure of a
        +<<gremlin-server,Gremlin Server>> project, how to connect with the Gremlin Driver, and how to embed Gremlin Server in
        +a testing framework.
        +* `gremlin-archetype-tinkergraph` - A basic example of how to structure a TinkerPop project with Maven.
        +
        +You can use Maven to generate these example projects with a command like:
        +
        +[source,shell]
        +$ mvn archetype:generate -DarchetypeGroupId=org.apache.tinkerpop -DarchetypeArtifactId=gremlin-archetype-server
        + -DarchetypeVersion=3.1.2-incubating -DgroupId=com.my -DartifactId=app
        — End diff –

        Suggest adding `-Dversion=0.1 -DinteractiveMode=false`

        Show
        githubbot ASF GitHub Bot added a comment - Github user pluradj commented on a diff in the pull request: https://github.com/apache/incubator-tinkerpop/pull/237#discussion_r53960519 — Diff: docs/src/reference/gremlin-applications.asciidoc — @@ -1880,3 +1880,25 @@ The following shows the output for `HadoopGraph`: describeGraph(HadoopGraph) + +[ [gremlin-archetypes] ] +Gremlin Archetypes +================== + +TinkerPop has a number of link: https://maven.apache.org/guides/introduction/introduction-to-archetypes.html[Maven archetypes], +which provide example project templates to quickly get started with TinkerPop. The available archetypes are as follows: + +* `gremlin-archetype-server` - An example project that demonstrates the basic structure of a +<<gremlin-server,Gremlin Server>> project, how to connect with the Gremlin Driver, and how to embed Gremlin Server in +a testing framework. +* `gremlin-archetype-tinkergraph` - A basic example of how to structure a TinkerPop project with Maven. + +You can use Maven to generate these example projects with a command like: + + [source,shell] +$ mvn archetype:generate -DarchetypeGroupId=org.apache.tinkerpop -DarchetypeArtifactId=gremlin-archetype-server + -DarchetypeVersion=3.1.2-incubating -DgroupId=com.my -DartifactId=app — End diff – Suggest adding `-Dversion=0.1 -DinteractiveMode=false`
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user pluradj commented on a diff in the pull request:

        https://github.com/apache/incubator-tinkerpop/pull/237#discussion_r53962273

        — Diff: gremlin-archetype/gremlin-archetype-tinkergraph/src/main/resources/archetype-resources/README.asciidoc —
        @@ -0,0 +1,35 @@
        +////
        +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.
        +////
        +Simple TinkerPop Application
        +============================
        +
        +This is a simple starter project that demonstrates how a basic TinkerPop project is structured with Maven. This project
        +uses link:http://tinkerpop.apache.org/docs/$

        {project.version}

        /reference/#tinkergraph-gremlin[TinkerGraph] as an
        +embedded graph database, loads it with some data and then executes a shortest path calculation, printing the results.
        +
        +Prerequisites
        +-------------
        +
        * Java 8 Update 40
        +* link:https://maven.apache.org/[Maven 3.x]
        +
        +Building and Running
        +--------------------
        +
        +[source,text]
        +mvn clean package
        — End diff –

        need to make sure that the Gremlin Server is not running, otherwise the unit test fails.

        Show
        githubbot ASF GitHub Bot added a comment - Github user pluradj commented on a diff in the pull request: https://github.com/apache/incubator-tinkerpop/pull/237#discussion_r53962273 — Diff: gremlin-archetype/gremlin-archetype-tinkergraph/src/main/resources/archetype-resources/README.asciidoc — @@ -0,0 +1,35 @@ +//// +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. +//// +Simple TinkerPop Application +============================ + +This is a simple starter project that demonstrates how a basic TinkerPop project is structured with Maven. This project +uses link: http://tinkerpop.apache.org/docs/$ {project.version} /reference/#tinkergraph-gremlin [TinkerGraph] as an +embedded graph database, loads it with some data and then executes a shortest path calculation, printing the results. + +Prerequisites +------------- + * Java 8 Update 40 +* link: https://maven.apache.org/[Maven 3.x] + +Building and Running +-------------------- + + [source,text] +mvn clean package — End diff – need to make sure that the Gremlin Server is not running, otherwise the unit test fails.
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user pluradj commented on a diff in the pull request:

        https://github.com/apache/incubator-tinkerpop/pull/237#discussion_r53962369

        — Diff: gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/README.asciidoc —
        @@ -0,0 +1,67 @@
        +////
        +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.
        +////
        +Gremlin Server Application
        +==========================
        +
        +This is a starter project that demonstrates how a basic
        +link:http://tinkerpop.apache.org/docs/$

        {project.version}/reference/#gremlin-server[Gremlin Server] project is structured
        +with Maven. This project demonstrates how to connect to Gremlin Server through Java using the
        +link:http://tinkerpop.apache.org/docs/${project.version}

        /reference/#connecting-via-java[Gremlin Driver] that is
        +distributed by TinkerPop.
        +
        +Prerequisites
        +-------------
        +
        * Java 8 Update 40
        +* link:https://maven.apache.org/[Maven 3.x]
        +* Gremlin Server is link:http://archive.apache.org/dist/incubator/tinkerpop/[downloaded] and unpackaged
        +
        +Building and Running
        +--------------------
        +
        +Start Gremlin Server in the directory it was unpackaged and specify usage of the "modern" graph configuration:
        +
        +[source,text]
        +$ bin/gremlin-server.sh conf/gremlin-server-modern.yaml
        +[INFO] GremlinServer -
        + \,,,/
        + (o o)
        +----oOOo(3)oOOo----
        +
        +[INFO] GremlinServer - Configuring Gremlin Server from conf/gremlin-server-modern.yaml
        +[INFO] MetricManager - Configured Metrics Slf4jReporter configured with interval=180000ms and loggerName=org.apache.tinkerpop.gremlin.server.Settings$Slf4jReporterMetrics
        +[INFO] Graphs - Graph [graph] was successfully configured via [conf/tinkergraph-empty.properties].
        +[INFO] ServerGremlinExecutor - Initialized Gremlin thread pool. Threads in pool named with pattern gremlin-*
        +[INFO] ScriptEngines - Loaded gremlin-groovy ScriptEngine
        +[INFO] GremlinExecutor - Initialized gremlin-groovy ScriptEngine with scripts/generate-modern.groovy
        +[INFO] ServerGremlinExecutor - Initialized GremlinExecutor and configured ScriptEngines.
        +[INFO] ServerGremlinExecutor - A GraphTraversalSource is now bound to [g] with graphtraversalsource[tinkergraph[vertices:0 edges:0], standard]
        +[INFO] OpLoader - Adding the standard OpProcessor.
        +[INFO] OpLoader - Adding the control OpProcessor.
        +[INFO] OpLoader - Adding the session OpProcessor.
        +[INFO] GremlinServer - Executing start up LifeCycleHook
        +[INFO] Logger$info - Loading 'modern' graph data.
        +[INFO] AbstractChannelizer - Configured application/vnd.gremlin-v1.0+gryo with org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0
        +[INFO] AbstractChannelizer - Configured application/vnd.gremlin-v1.0+gryo-stringd with org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0
        +[INFO] GremlinServer$1 - Gremlin Server configured with worker thread pool of 1, gremlin pool of 8 and boss thread pool of 1.
        +[INFO] GremlinServer$1 - Channel started at port 8182.
        +
        +Build and run this project as follows:
        +
        +[source,text]
        +mvn clean package
        — End diff –

        need to make sure that the Gremlin Server is not running, otherwise the unit test fails.

        Show
        githubbot ASF GitHub Bot added a comment - Github user pluradj commented on a diff in the pull request: https://github.com/apache/incubator-tinkerpop/pull/237#discussion_r53962369 — Diff: gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/README.asciidoc — @@ -0,0 +1,67 @@ +//// +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. +//// +Gremlin Server Application +========================== + +This is a starter project that demonstrates how a basic +link: http://tinkerpop.apache.org/docs/$ {project.version}/reference/#gremlin-server [Gremlin Server] project is structured +with Maven. This project demonstrates how to connect to Gremlin Server through Java using the +link: http://tinkerpop.apache.org/docs/$ {project.version} /reference/#connecting-via-java [Gremlin Driver] that is +distributed by TinkerPop. + +Prerequisites +------------- + * Java 8 Update 40 +* link: https://maven.apache.org/[Maven 3.x] +* Gremlin Server is link: http://archive.apache.org/dist/incubator/tinkerpop/[downloaded ] and unpackaged + +Building and Running +-------------------- + +Start Gremlin Server in the directory it was unpackaged and specify usage of the "modern" graph configuration: + + [source,text] +$ bin/gremlin-server.sh conf/gremlin-server-modern.yaml + [INFO] GremlinServer - + \,,,/ + (o o) +---- oOOo (3) oOOo ---- + + [INFO] GremlinServer - Configuring Gremlin Server from conf/gremlin-server-modern.yaml + [INFO] MetricManager - Configured Metrics Slf4jReporter configured with interval=180000ms and loggerName=org.apache.tinkerpop.gremlin.server.Settings$Slf4jReporterMetrics + [INFO] Graphs - Graph [graph] was successfully configured via [conf/tinkergraph-empty.properties] . + [INFO] ServerGremlinExecutor - Initialized Gremlin thread pool. Threads in pool named with pattern gremlin-* + [INFO] ScriptEngines - Loaded gremlin-groovy ScriptEngine + [INFO] GremlinExecutor - Initialized gremlin-groovy ScriptEngine with scripts/generate-modern.groovy + [INFO] ServerGremlinExecutor - Initialized GremlinExecutor and configured ScriptEngines. + [INFO] ServerGremlinExecutor - A GraphTraversalSource is now bound to [g] with graphtraversalsource[tinkergraph [vertices:0 edges:0] , standard] + [INFO] OpLoader - Adding the standard OpProcessor. + [INFO] OpLoader - Adding the control OpProcessor. + [INFO] OpLoader - Adding the session OpProcessor. + [INFO] GremlinServer - Executing start up LifeCycleHook + [INFO] Logger$info - Loading 'modern' graph data. + [INFO] AbstractChannelizer - Configured application/vnd.gremlin-v1.0+gryo with org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0 + [INFO] AbstractChannelizer - Configured application/vnd.gremlin-v1.0+gryo-stringd with org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0 + [INFO] GremlinServer$1 - Gremlin Server configured with worker thread pool of 1, gremlin pool of 8 and boss thread pool of 1. + [INFO] GremlinServer$1 - Channel started at port 8182. + +Build and run this project as follows: + + [source,text] +mvn clean package — End diff – need to make sure that the Gremlin Server is not running, otherwise the unit test fails.
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user pluradj commented on a diff in the pull request:

        https://github.com/apache/incubator-tinkerpop/pull/237#discussion_r53965414

        — Diff: gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/pom.xml —
        @@ -0,0 +1,80 @@
        +<!--
        +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.
        +-->
        +<project xmlns="http://maven.apache.org/POM/4.0.0"
        + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
        + <modelVersion>4.0.0</modelVersion>
        + <groupId>\$

        {groupId}

        </groupId>
        + <artifactId>\$

        {artifactId}

        </artifactId>
        + <version>\$

        {version}

        </version>
        +
        + <name>Getting started with Gremlin Server</name>
        +
        + <packaging>jar</packaging>
        + <properties>
        + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        + </properties>
        + <dependencies>
        + <dependency>
        + <groupId>org.apache.tinkerpop</groupId>
        + <artifactId>gremlin-driver</artifactId>
        + <version>$

        {project.version}</version>
        + </dependency>
        + <dependency>
        + <groupId>org.apache.tinkerpop</groupId>
        + <artifactId>gremlin-server</artifactId>
        + <version>${project.version}

        </version>
        + <scope>test</scope>
        + </dependency>
        + <dependency>
        + <groupId>org.slf4j</groupId>
        + <artifactId>slf4j-log4j12</artifactId>
        + <version>$

        {slf4j.version}

        </version>
        + <scope>test</scope>
        — End diff –

        suggest making a compile dependency and adding `log4j` also to avoid the `log4j:WARN No appenders could be found for logger`

        Show
        githubbot ASF GitHub Bot added a comment - Github user pluradj commented on a diff in the pull request: https://github.com/apache/incubator-tinkerpop/pull/237#discussion_r53965414 — Diff: gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/pom.xml — @@ -0,0 +1,80 @@ +<!-- +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. +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd "> + <modelVersion>4.0.0</modelVersion> + <groupId>\$ {groupId} </groupId> + <artifactId>\$ {artifactId} </artifactId> + <version>\$ {version} </version> + + <name>Getting started with Gremlin Server</name> + + <packaging>jar</packaging> + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + </properties> + <dependencies> + <dependency> + <groupId>org.apache.tinkerpop</groupId> + <artifactId>gremlin-driver</artifactId> + <version>$ {project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.tinkerpop</groupId> + <artifactId>gremlin-server</artifactId> + <version>${project.version} </version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + <version>$ {slf4j.version} </version> + <scope>test</scope> — End diff – suggest making a compile dependency and adding `log4j` also to avoid the `log4j:WARN No appenders could be found for logger`
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user pluradj commented on a diff in the pull request:

        https://github.com/apache/incubator-tinkerpop/pull/237#discussion_r53965692

        — Diff: gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/README.asciidoc —
        @@ -0,0 +1,67 @@
        +////
        +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.
        +////
        +Gremlin Server Application
        +==========================
        +
        +This is a starter project that demonstrates how a basic
        +link:http://tinkerpop.apache.org/docs/$

        {project.version}/reference/#gremlin-server[Gremlin Server] project is structured
        +with Maven. This project demonstrates how to connect to Gremlin Server through Java using the
        +link:http://tinkerpop.apache.org/docs/${project.version}

        /reference/#connecting-via-java[Gremlin Driver] that is
        +distributed by TinkerPop.
        +
        +Prerequisites
        +-------------
        +
        * Java 8 Update 40
        +* link:https://maven.apache.org/[Maven 3.x]
        +* Gremlin Server is link:http://archive.apache.org/dist/incubator/tinkerpop/[downloaded] and unpackaged
        +
        +Building and Running
        +--------------------
        +
        +Start Gremlin Server in the directory it was unpackaged and specify usage of the "modern" graph configuration:
        +
        +[source,text]
        +$ bin/gremlin-server.sh conf/gremlin-server-modern.yaml
        +[INFO] GremlinServer -
        + \,,,/
        + (o o)
        +----oOOo(3)oOOo----
        +
        +[INFO] GremlinServer - Configuring Gremlin Server from conf/gremlin-server-modern.yaml
        +[INFO] MetricManager - Configured Metrics Slf4jReporter configured with interval=180000ms and loggerName=org.apache.tinkerpop.gremlin.server.Settings$Slf4jReporterMetrics
        +[INFO] Graphs - Graph [graph] was successfully configured via [conf/tinkergraph-empty.properties].
        +[INFO] ServerGremlinExecutor - Initialized Gremlin thread pool. Threads in pool named with pattern gremlin-*
        +[INFO] ScriptEngines - Loaded gremlin-groovy ScriptEngine
        +[INFO] GremlinExecutor - Initialized gremlin-groovy ScriptEngine with scripts/generate-modern.groovy
        +[INFO] ServerGremlinExecutor - Initialized GremlinExecutor and configured ScriptEngines.
        +[INFO] ServerGremlinExecutor - A GraphTraversalSource is now bound to [g] with graphtraversalsource[tinkergraph[vertices:0 edges:0], standard]
        +[INFO] OpLoader - Adding the standard OpProcessor.
        +[INFO] OpLoader - Adding the control OpProcessor.
        +[INFO] OpLoader - Adding the session OpProcessor.
        +[INFO] GremlinServer - Executing start up LifeCycleHook
        +[INFO] Logger$info - Loading 'modern' graph data.
        +[INFO] AbstractChannelizer - Configured application/vnd.gremlin-v1.0+gryo with org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0
        +[INFO] AbstractChannelizer - Configured application/vnd.gremlin-v1.0+gryo-stringd with org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0
        +[INFO] GremlinServer$1 - Gremlin Server configured with worker thread pool of 1, gremlin pool of 8 and boss thread pool of 1.
        +[INFO] GremlinServer$1 - Channel started at port 8182.
        +
        +Build and run this project as follows:
        +
        +[source,text]
        +mvn clean package
        +mvn exec:java -Dexec.mainClass="$

        {package}

        .App"
        — End diff –

        if you add the `log4j` dependency, also include `-Dlog4j.configuration=file:conf/log4j.properties`

        Show
        githubbot ASF GitHub Bot added a comment - Github user pluradj commented on a diff in the pull request: https://github.com/apache/incubator-tinkerpop/pull/237#discussion_r53965692 — Diff: gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/README.asciidoc — @@ -0,0 +1,67 @@ +//// +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. +//// +Gremlin Server Application +========================== + +This is a starter project that demonstrates how a basic +link: http://tinkerpop.apache.org/docs/$ {project.version}/reference/#gremlin-server [Gremlin Server] project is structured +with Maven. This project demonstrates how to connect to Gremlin Server through Java using the +link: http://tinkerpop.apache.org/docs/$ {project.version} /reference/#connecting-via-java [Gremlin Driver] that is +distributed by TinkerPop. + +Prerequisites +------------- + * Java 8 Update 40 +* link: https://maven.apache.org/[Maven 3.x] +* Gremlin Server is link: http://archive.apache.org/dist/incubator/tinkerpop/[downloaded ] and unpackaged + +Building and Running +-------------------- + +Start Gremlin Server in the directory it was unpackaged and specify usage of the "modern" graph configuration: + + [source,text] +$ bin/gremlin-server.sh conf/gremlin-server-modern.yaml + [INFO] GremlinServer - + \,,,/ + (o o) +---- oOOo (3) oOOo ---- + + [INFO] GremlinServer - Configuring Gremlin Server from conf/gremlin-server-modern.yaml + [INFO] MetricManager - Configured Metrics Slf4jReporter configured with interval=180000ms and loggerName=org.apache.tinkerpop.gremlin.server.Settings$Slf4jReporterMetrics + [INFO] Graphs - Graph [graph] was successfully configured via [conf/tinkergraph-empty.properties] . + [INFO] ServerGremlinExecutor - Initialized Gremlin thread pool. Threads in pool named with pattern gremlin-* + [INFO] ScriptEngines - Loaded gremlin-groovy ScriptEngine + [INFO] GremlinExecutor - Initialized gremlin-groovy ScriptEngine with scripts/generate-modern.groovy + [INFO] ServerGremlinExecutor - Initialized GremlinExecutor and configured ScriptEngines. + [INFO] ServerGremlinExecutor - A GraphTraversalSource is now bound to [g] with graphtraversalsource[tinkergraph [vertices:0 edges:0] , standard] + [INFO] OpLoader - Adding the standard OpProcessor. + [INFO] OpLoader - Adding the control OpProcessor. + [INFO] OpLoader - Adding the session OpProcessor. + [INFO] GremlinServer - Executing start up LifeCycleHook + [INFO] Logger$info - Loading 'modern' graph data. + [INFO] AbstractChannelizer - Configured application/vnd.gremlin-v1.0+gryo with org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0 + [INFO] AbstractChannelizer - Configured application/vnd.gremlin-v1.0+gryo-stringd with org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0 + [INFO] GremlinServer$1 - Gremlin Server configured with worker thread pool of 1, gremlin pool of 8 and boss thread pool of 1. + [INFO] GremlinServer$1 - Channel started at port 8182. + +Build and run this project as follows: + + [source,text] +mvn clean package +mvn exec:java -Dexec.mainClass="$ {package} .App" — End diff – if you add the `log4j` dependency, also include `-Dlog4j.configuration= file:conf/log4j.properties `
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user pluradj commented on a diff in the pull request:

        https://github.com/apache/incubator-tinkerpop/pull/237#discussion_r53971453

        — Diff: gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/main/resources/gremlin-server.yaml —
        @@ -0,0 +1,45 @@
        +# Licensed to the Apache Software Foundation (ASF) under one
        — End diff –

        since `gremlin-server` is a `test` scope dependency, this should move over to `.../src/test/resources` in the generated project

        Show
        githubbot ASF GitHub Bot added a comment - Github user pluradj commented on a diff in the pull request: https://github.com/apache/incubator-tinkerpop/pull/237#discussion_r53971453 — Diff: gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/main/resources/gremlin-server.yaml — @@ -0,0 +1,45 @@ +# Licensed to the Apache Software Foundation (ASF) under one — End diff – since `gremlin-server` is a `test` scope dependency, this should move over to `.../src/test/resources` in the generated project
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user pluradj commented on the pull request:

        https://github.com/apache/incubator-tinkerpop/pull/237#issuecomment-188378094

        I tested both (server and tinkergraph) generated projects on Mac and Windows.
        Good stuff @spmallette

        VOTE +1

        Show
        githubbot ASF GitHub Bot added a comment - Github user pluradj commented on the pull request: https://github.com/apache/incubator-tinkerpop/pull/237#issuecomment-188378094 I tested both (server and tinkergraph) generated projects on Mac and Windows. Good stuff @spmallette VOTE +1
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user spmallette commented on the pull request:

        https://github.com/apache/incubator-tinkerpop/pull/237#issuecomment-188407259

        @pluradj that was a nice body of feedback - thanks. i've cleaned up and added your suggestions. deploying a fresh SNAPSHOT now.

        @okram there really isn't any documentation to "re-publish". i only made one change to our generated asciidoc which added a note about "archetypes" to the reference docs. the other asciidoc i have in this PR is just README's that get generated into a example project when the archetype is used.

        I could see where a tutorial could be built around an archetype. In the more complex thoughts you had for "examples" I think that would be the way to do it. Write a tutorial in our standard pattern then build an archetype to support it.

        Show
        githubbot ASF GitHub Bot added a comment - Github user spmallette commented on the pull request: https://github.com/apache/incubator-tinkerpop/pull/237#issuecomment-188407259 @pluradj that was a nice body of feedback - thanks. i've cleaned up and added your suggestions. deploying a fresh SNAPSHOT now. @okram there really isn't any documentation to "re-publish". i only made one change to our generated asciidoc which added a note about "archetypes" to the reference docs. the other asciidoc i have in this PR is just README's that get generated into a example project when the archetype is used. I could see where a tutorial could be built around an archetype. In the more complex thoughts you had for "examples" I think that would be the way to do it. Write a tutorial in our standard pattern then build an archetype to support it.
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user asfgit closed the pull request at:

        https://github.com/apache/incubator-tinkerpop/pull/237

        Show
        githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/incubator-tinkerpop/pull/237

          People

          • Assignee:
            spmallette stephen mallette
            Reporter:
            spmallette stephen mallette
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development