Skip to content

Commit

Permalink
Merge branch 'master' into 4.0.x
Browse files Browse the repository at this point in the history
  • Loading branch information
augustearth committed Mar 12, 2024
2 parents c377d2d + c985c75 commit 0cc047e
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 9 deletions.
14 changes: 14 additions & 0 deletions docs/groovy/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Provided as a convience to run the example .groovy files in this directory
version: '3.9'


services:
runner:
image: groovy:3.0.9-jdk11
working_dir: /appsrc
command: bash -c "groovy graph-method-1.groovy"
stdin_open: true
tty: true
volumes:
- "./:/appsrc"

8 changes: 4 additions & 4 deletions docs/groovy/graph-method-1.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// DEPENDENCIES
///////////////////////////////////////////////////////////////////////////////

@Grab('io.github.carnival-data:carnival-core:3.0.2-SNAPSHOT')
@Grab('io.github.carnival-data:carnival-core:3.0.1')
@Grab('org.apache.tinkerpop:gremlin-core:3.4.10')


Expand Down Expand Up @@ -106,14 +106,14 @@ class Expanders implements GraphMethods {

String val = PX.NAME.valueOf(recV)
List<String> words = val.trim().split(/\s+/)
if (words.size == 0) return
if (words.size() == 0) return

Vertex nameV

if (words.size == 1) {
if (words.size() == 1) {
nameV = VX.NAME.instance().withProperty(PX.FIRST, words[0]).ensure(graph, g)
}
if (words.size == 2) {
if (words.size() == 2) {
nameV = VX.NAME.instance().withProperties(
PX.FIRST, words[0],
PX.LAST, words[1]
Expand Down
3 changes: 2 additions & 1 deletion docs/groovy/graph-model-1.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
// DEPENDENCIES
///////////////////////////////////////////////////////////////////////////////

@Grab('io.github.carnival-data:carnival-core:3.0.2-SNAPSHOT')
//@Grab('io.github.carnival-data:carnival-core:3.0.2-SNAPSHOT')
@Grab('io.github.carnival-data:carnival-core:3.0.1')
@Grab('org.apache.tinkerpop:gremlin-core:3.4.10')


Expand Down
2 changes: 1 addition & 1 deletion docs/groovy/graph-model-2.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// DEPENDENCIES
///////////////////////////////////////////////////////////////////////////////

@Grab('io.github.carnival-data:carnival-core:3.0.2-SNAPSHOT')
@Grab('io.github.carnival-data:carnival-core:3.0.1')
@Grab('org.apache.tinkerpop:gremlin-core:3.4.10')


Expand Down
2 changes: 1 addition & 1 deletion docs/groovy/graph-model-3.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// DEPENDENCIES
///////////////////////////////////////////////////////////////////////////////

@Grab('io.github.carnival-data:carnival-core:3.0.2-SNAPSHOT')
@Grab('io.github.carnival-data:carnival-core:3.0.1')
@Grab('org.apache.tinkerpop:gremlin-core:3.4.10')


Expand Down
9 changes: 9 additions & 0 deletions docs/groovy/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
This directory contains example scripts.

The docker compose file can be use to start an interactive shell with groovy available on the command line:
`docker-compose run runner bash`

From the shell, the scripts can be run as follows:
`groovy graph-model-1.groovy`

For more see the [user documentation](https://carnival-data.github.io/carnival/#script-development).
4 changes: 2 additions & 2 deletions docs/groovy/tutorial-1.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
// public snapshot repository
//@GrabResolver(name='io.github.carnival-data', root='https://s01.oss.sonatype.org/content/repositories/snapshots/')

@Grab('io.github.carnival-data:carnival-core:3.0.2-SNAPSHOT')
@Grab('io.github.carnival-data:carnival-vine:3.0.2-SNAPSHOT')
@Grab('io.github.carnival-data:carnival-core:3.0.1')
@Grab('io.github.carnival-data:carnival-vine:3.0.1')
@Grab('org.apache.tinkerpop:gremlin-core:3.4.10')
@Grab('com.fasterxml.jackson.core:jackson-databind:2.14.1')

Expand Down
3 changes: 3 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,9 @@ The example scripts use [Groovy Grape](http://docs.groovy-lang.org/latest/html/d
groovy -Dgroovy.grape.report.downloads=true graph-model-1.groovy
```

> **Note**
> To assist with running the example scripts, as an alternative to installing Groovy `docs/groovy` contains a docker-compose file to start an interactive shell with groovy available on the command line. To start the shell, from the example directory run `docker-compose run runner bash`. Scripts can be run with commands such as `groovy graph-model-1.groovy`.

### <a name="app-development"></a>Groovy Applications
The Carnival library can be included in Gradle Groovy applications and libraries.
Expand Down

0 comments on commit 0cc047e

Please sign in to comment.