adds global configuration key to register gremlin traversal sources#1239
adds global configuration key to register gremlin traversal sources#1239lvca merged 6 commits intoArcadeData:mainfrom
Conversation
customizing the gremlin script engines traversal sources. This allows clients of the database to register tinkerpop traversal DSLs or customize the traversal strategies.
|
@lvca please let me know what you think. I find tinker pop DSLs to be one of the most useful features of the framework. Additionally, it's nice to have the ability to customize the graph travresal strategies for various reasons. |
validates GREMLIN_TRAVERSAL_BINDING entries conform to the expected Map<String, TraversalSupplier> form.
| </annotationProcessorPath> | ||
| </annotationProcessorPaths> | ||
| <annotationProcessors> | ||
| <annotationProcessor>org.apache.tinkerpop.gremlin.process.traversal.dsl.GremlinDslProcessor</annotationProcessor> |
There was a problem hiding this comment.
What does the annotation processor do? Does it browse all the jars in the classpath looking for an annotation?
There was a problem hiding this comment.
it builds the SocialTraversalSource from the SocialTraversalDsl for the tests:
https://tinkerpop.apache.org/docs/current/reference/#gremlin-java-dsl
I'm not familiar very familiar with maven, but I added the tinkerpop-annotation artifact as a test-scoped dependency only. Will that be enough to not affect the release jar? Can I limit the annotationprocessor to just the test?
gremlin/src/main/java/com/arcadedb/gremlin/ArcadeTraversalBinder.java
Outdated
Show resolved
Hide resolved
gremlin/src/main/java/com/arcadedb/gremlin/ArcadeTraversalBinder.java
Outdated
Show resolved
Hide resolved
|
sg, I'll send a pull request on the docs repo in the next couple of days |
|
Thanks |
|
@lvca I'm sorry to create extra work on this, but unfortunately I think this needs to get rolled back in its current form and rethought. Currently it is entirely broken in the While working on writing up some documentation for this last night I was inspecting the Tinkerpop sources for the java I went back to verify this and tried adding another test to the GremlinTest make sure to set Worse yet, if I try to just rename the binding to I can't find any info on this issue in the tinkerpop issue tracker or mailing lists, so I'm asking on their answers server to see if there is more info. I think in the meantime this can: a.) be rolled back entirely a.) is probably better IMO |
|
@erickj no worries, glad you caught up before the release. Usually the Gremlin Discord channel is the best way to get help and they are super responsive. You could link this issue (they are familiar with ArcadeDB). For now maybe it's better to rollback waiting for a solution that works in both cases. |
|
Just to wrap up on this, I've had a brief conversation w/ Stephen Mallette on the tinkerpop discord about this https://discord.com/channels/838910279550238720/1152253500705755258 tldr; from his POV, there is no plan to support DSLs in the java interpreter at any point in the near future, and "the two ScriptEngine implementations are not meant to have complete feature parity. " Overall the expectation of DSL usage is to pre-translate the query to bytecode on a client endpoint via something like https://github.com/apache/tinkerpop/blob/master/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/translator.js then send the bytecode over HTTP to the server endpoint (aside, personally, I've found this approach too heavyweight in the past as you need to carry around your DSL & Traversals in multiple languages and need a javascript interpreter & HTTP server somewhere in the chain) In the end this will most likely only ever be supported by the groovy interpreter. Overall it's a bit disappointing to hear. I'm not sure on your thoughts on the general usefulness of this, but I think for the direction of the arcade project it would be difficult for users to start to understand script engine specific features, and would be too leaky for any user who wasn't well versed in the issue. @lvca lmkwyt |
|
Thanks for the detailed explanation. So @erickj are you currently using it with the Groovy Gremlin engine? What's your experience with the DSL and ArcadeDB? When do you find useful and when does it work properly? |
|
I had been using the DSL prior to switching to ArcadeDB against an embedded tinkergraph where I was evaluating queries against the groovy gremlin engine. When I began testing against arcadedb I had thought I was using the java script engine, however I believe I understand what happened now. The DSL execucution throws a ScriptException, which when the GREMLIN_ENGINE is set to 'auto' gets caught, logs an error at FINE, and falls back to gremlin groovy. Because I never run logs at trace levels this error was hidden. When it works well is in the graph schema design phase, where I design the indexes and queries in unison so that basic queries use the correct indices. It is also to cut down on boilerplate in queries in general for common or complex (but regular) queries. Finally, it makes queries easier to write overall. Since graph design phase is effectively an encapsulation and representation of a particular domain, keeping the query nomenclature in that same domain is a much more natural way for users to think than trying to map your question back to tinkerpop traversal methods. Using the DSL on the write side is less effective IMO as the DSL construction becomes more onerous, and I've found using the tinkerpop mutation APIs to be unnecessary when compared to the native Arcadedb mutation APIs. Also, the mutation APIs aren't adhoc like queries are. I'm currently working on a prototype to try and support the DSL in the GremlinLangScriptEngine which I'll go back and discuss with the tinkerpop devs when/if it actually works. |
…js [skip ci] Bumps [testcontainers](https://github.com/testcontainers/testcontainers-node) from 11.11.0 to 11.12.0. Release notes *Sourced from [testcontainers's releases](https://github.com/testcontainers/testcontainers-node/releases).* > v11.12.0 > -------- > > Changes > ------- > > 🚀 Features > ---------- > > * Add SSL support for postgres containers [`@cristianrgreco`](https://github.com/cristianrgreco) ([#1224](https://redirect.github.com/testcontainers/testcontainers-node/issues/1224)) > * Add Azurite support for HTTPS/OAuth configuration [`@cristianrgreco`](https://github.com/cristianrgreco) ([#1228](https://redirect.github.com/testcontainers/testcontainers-node/issues/1228)) > * Support preserving UID/GID when copying archives to containers [`@cristianrgreco`](https://github.com/cristianrgreco) ([#1234](https://redirect.github.com/testcontainers/testcontainers-node/issues/1234)) > * Follow symlinks when copying files into containers [`@cristianrgreco`](https://github.com/cristianrgreco) ([#1235](https://redirect.github.com/testcontainers/testcontainers-node/issues/1235)) > * Warn when compose wait strategy names don't match containers [`@cristianrgreco`](https://github.com/cristianrgreco) ([#1232](https://redirect.github.com/testcontainers/testcontainers-node/issues/1232)) > * Add support for GenericContainer security options [`@cristianrgreco`](https://github.com/cristianrgreco) ([#1226](https://redirect.github.com/testcontainers/testcontainers-node/issues/1226)) > > 🐛 Bug Fixes > ----------- > > * Honor nested .dockerignore exclusions in Docker build context [`@cristianrgreco`](https://github.com/cristianrgreco) ([#1229](https://redirect.github.com/testcontainers/testcontainers-node/issues/1229)) > * Fallback to new Reaper when reused Reaper is unreachable [`@cristianrgreco`](https://github.com/cristianrgreco) ([#1233](https://redirect.github.com/testcontainers/testcontainers-node/issues/1233)) > > 📖 Documentation > --------------- > > * Add AGENTS.md: [#1225](https://redirect.github.com/testcontainers/testcontainers-node/issues/1225) > * Update AGENTS.md: [#1236](https://redirect.github.com/testcontainers/testcontainers-node/issues/1236), [#1231](https://redirect.github.com/testcontainers/testcontainers-node/issues/1231), [#1227](https://redirect.github.com/testcontainers/testcontainers-node/issues/1227) > > 🧹 Maintenance > ------------- > > * Restore compose warning test compile after naming simplification [`@cristianrgreco`](https://github.com/cristianrgreco) ([#1239](https://redirect.github.com/testcontainers/testcontainers-node/issues/1239)) > * Simplify Docker Compose naming to v2-only format [`@cristianrgreco`](https://github.com/cristianrgreco) ([#1238](https://redirect.github.com/testcontainers/testcontainers-node/issues/1238)) > * Docker event stream test helper matches both `status` and `Action` fields [`@cristianrgreco`](https://github.com/cristianrgreco) ([#1230](https://redirect.github.com/testcontainers/testcontainers-node/issues/1230)) > > 📦 Dependency Updates > -------------------- > > * Bump dependencies: [#1222](https://redirect.github.com/testcontainers/testcontainers-node/issues/1222), [#1223](https://redirect.github.com/testcontainers/testcontainers-node/issues/1223), [#1220](https://redirect.github.com/testcontainers/testcontainers-node/issues/1220), [#1221](https://redirect.github.com/testcontainers/testcontainers-node/issues/1221), [#1212](https://redirect.github.com/testcontainers/testcontainers-node/issues/1212), [#1211](https://redirect.github.com/testcontainers/testcontainers-node/issues/1211), [#1208](https://redirect.github.com/testcontainers/testcontainers-node/issues/1208), [#1209](https://redirect.github.com/testcontainers/testcontainers-node/issues/1209) > * Bump mkdocs-material: [#1205](https://redirect.github.com/testcontainers/testcontainers-node/issues/1205) Commits * [`0481c58`](testcontainers/testcontainers-node@0481c58) Add SSL support for postgres containers ([#1224](https://redirect.github.com/testcontainers/testcontainers-node/issues/1224)) * [`746f96e`](testcontainers/testcontainers-node@746f96e) Add Azurite support for HTTPS/OAuth configuration ([#1228](https://redirect.github.com/testcontainers/testcontainers-node/issues/1228)) * [`ecd83c8`](testcontainers/testcontainers-node@ecd83c8) Fix stale composeContainerName reference in compose warning test ([#1239](https://redirect.github.com/testcontainers/testcontainers-node/issues/1239)) * [`f1a9a0b`](testcontainers/testcontainers-node@f1a9a0b) Support preserving UID/GID when copying archives to containers ([#1234](https://redirect.github.com/testcontainers/testcontainers-node/issues/1234)) * [`6274827`](testcontainers/testcontainers-node@6274827) Follow symlinks when copying files into containers ([#1235](https://redirect.github.com/testcontainers/testcontainers-node/issues/1235)) * [`5dc5293`](testcontainers/testcontainers-node@5dc5293) Simplify Compose naming to v2-only conventions ([#1238](https://redirect.github.com/testcontainers/testcontainers-node/issues/1238)) * [`975665b`](testcontainers/testcontainers-node@975665b) Honor nested .dockerignore exclusions in Docker build context ([#1229](https://redirect.github.com/testcontainers/testcontainers-node/issues/1229)) * [`d75a4ac`](testcontainers/testcontainers-node@d75a4ac) Fallback to new Reaper when reused one is unreachable ([#1233](https://redirect.github.com/testcontainers/testcontainers-node/issues/1233)) * [`84d0908`](testcontainers/testcontainers-node@84d0908) Warn when compose wait strategy names don't match containers ([#1232](https://redirect.github.com/testcontainers/testcontainers-node/issues/1232)) * [`c608c47`](testcontainers/testcontainers-node@c608c47) Update AGENTS.md ([#1236](https://redirect.github.com/testcontainers/testcontainers-node/issues/1236)) * Additional commits viewable in [compare view](testcontainers/testcontainers-node@v11.11.0...v11.12.0) [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- Dependabot commands and options You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
…studio [skip ci] [//]: # (dependabot-start)⚠️ \*\*Dependabot is rebasing this PR\*\*⚠️ Rebasing might not happen immediately, so don't worry if this takes some time. Note: if you make any changes to this PR yourself, they will take precedence over the rebase. --- [//]: # (dependabot-end) Bumps [testcontainers](https://github.com/testcontainers/testcontainers-node) from 11.11.0 to 11.12.0. Release notes *Sourced from [testcontainers's releases](https://github.com/testcontainers/testcontainers-node/releases).* > v11.12.0 > -------- > > Changes > ------- > > 🚀 Features > ---------- > > * Add SSL support for postgres containers [`@cristianrgreco`](https://github.com/cristianrgreco) ([#1224](https://redirect.github.com/testcontainers/testcontainers-node/issues/1224)) > * Add Azurite support for HTTPS/OAuth configuration [`@cristianrgreco`](https://github.com/cristianrgreco) ([#1228](https://redirect.github.com/testcontainers/testcontainers-node/issues/1228)) > * Support preserving UID/GID when copying archives to containers [`@cristianrgreco`](https://github.com/cristianrgreco) ([#1234](https://redirect.github.com/testcontainers/testcontainers-node/issues/1234)) > * Follow symlinks when copying files into containers [`@cristianrgreco`](https://github.com/cristianrgreco) ([#1235](https://redirect.github.com/testcontainers/testcontainers-node/issues/1235)) > * Warn when compose wait strategy names don't match containers [`@cristianrgreco`](https://github.com/cristianrgreco) ([#1232](https://redirect.github.com/testcontainers/testcontainers-node/issues/1232)) > * Add support for GenericContainer security options [`@cristianrgreco`](https://github.com/cristianrgreco) ([#1226](https://redirect.github.com/testcontainers/testcontainers-node/issues/1226)) > > 🐛 Bug Fixes > ----------- > > * Honor nested .dockerignore exclusions in Docker build context [`@cristianrgreco`](https://github.com/cristianrgreco) ([#1229](https://redirect.github.com/testcontainers/testcontainers-node/issues/1229)) > * Fallback to new Reaper when reused Reaper is unreachable [`@cristianrgreco`](https://github.com/cristianrgreco) ([#1233](https://redirect.github.com/testcontainers/testcontainers-node/issues/1233)) > > 📖 Documentation > --------------- > > * Add AGENTS.md: [#1225](https://redirect.github.com/testcontainers/testcontainers-node/issues/1225) > * Update AGENTS.md: [#1236](https://redirect.github.com/testcontainers/testcontainers-node/issues/1236), [#1231](https://redirect.github.com/testcontainers/testcontainers-node/issues/1231), [#1227](https://redirect.github.com/testcontainers/testcontainers-node/issues/1227) > > 🧹 Maintenance > ------------- > > * Restore compose warning test compile after naming simplification [`@cristianrgreco`](https://github.com/cristianrgreco) ([#1239](https://redirect.github.com/testcontainers/testcontainers-node/issues/1239)) > * Simplify Docker Compose naming to v2-only format [`@cristianrgreco`](https://github.com/cristianrgreco) ([#1238](https://redirect.github.com/testcontainers/testcontainers-node/issues/1238)) > * Docker event stream test helper matches both `status` and `Action` fields [`@cristianrgreco`](https://github.com/cristianrgreco) ([#1230](https://redirect.github.com/testcontainers/testcontainers-node/issues/1230)) > > 📦 Dependency Updates > -------------------- > > * Bump dependencies: [#1222](https://redirect.github.com/testcontainers/testcontainers-node/issues/1222), [#1223](https://redirect.github.com/testcontainers/testcontainers-node/issues/1223), [#1220](https://redirect.github.com/testcontainers/testcontainers-node/issues/1220), [#1221](https://redirect.github.com/testcontainers/testcontainers-node/issues/1221), [#1212](https://redirect.github.com/testcontainers/testcontainers-node/issues/1212), [#1211](https://redirect.github.com/testcontainers/testcontainers-node/issues/1211), [#1208](https://redirect.github.com/testcontainers/testcontainers-node/issues/1208), [#1209](https://redirect.github.com/testcontainers/testcontainers-node/issues/1209) > * Bump mkdocs-material: [#1205](https://redirect.github.com/testcontainers/testcontainers-node/issues/1205) Commits * [`0481c58`](testcontainers/testcontainers-node@0481c58) Add SSL support for postgres containers ([#1224](https://redirect.github.com/testcontainers/testcontainers-node/issues/1224)) * [`746f96e`](testcontainers/testcontainers-node@746f96e) Add Azurite support for HTTPS/OAuth configuration ([#1228](https://redirect.github.com/testcontainers/testcontainers-node/issues/1228)) * [`ecd83c8`](testcontainers/testcontainers-node@ecd83c8) Fix stale composeContainerName reference in compose warning test ([#1239](https://redirect.github.com/testcontainers/testcontainers-node/issues/1239)) * [`f1a9a0b`](testcontainers/testcontainers-node@f1a9a0b) Support preserving UID/GID when copying archives to containers ([#1234](https://redirect.github.com/testcontainers/testcontainers-node/issues/1234)) * [`6274827`](testcontainers/testcontainers-node@6274827) Follow symlinks when copying files into containers ([#1235](https://redirect.github.com/testcontainers/testcontainers-node/issues/1235)) * [`5dc5293`](testcontainers/testcontainers-node@5dc5293) Simplify Compose naming to v2-only conventions ([#1238](https://redirect.github.com/testcontainers/testcontainers-node/issues/1238)) * [`975665b`](testcontainers/testcontainers-node@975665b) Honor nested .dockerignore exclusions in Docker build context ([#1229](https://redirect.github.com/testcontainers/testcontainers-node/issues/1229)) * [`d75a4ac`](testcontainers/testcontainers-node@d75a4ac) Fallback to new Reaper when reused one is unreachable ([#1233](https://redirect.github.com/testcontainers/testcontainers-node/issues/1233)) * [`84d0908`](testcontainers/testcontainers-node@84d0908) Warn when compose wait strategy names don't match containers ([#1232](https://redirect.github.com/testcontainers/testcontainers-node/issues/1232)) * [`c608c47`](testcontainers/testcontainers-node@c608c47) Update AGENTS.md ([#1236](https://redirect.github.com/testcontainers/testcontainers-node/issues/1236)) * Additional commits viewable in [compare view](testcontainers/testcontainers-node@v11.11.0...v11.12.0) [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- Dependabot commands and options You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Allows customizing the gremlin script engines traversal sources. This allows clients of the database to register tinkerpop traversal DSLs or customize the traversal strategies.
Motivation
Using tinkerpop DSLs and customizing traversal strategies.
Related issues
A list of issues either fixed, containing architectural discussions, otherwise relevant
for this Pull Request.
Additional Notes
Anything else we should know when reviewing?
Checklist
mvn clean packagecommand (some tests seem flaky, but unrelated)