spmallette commented on code in PR #3384:
URL: https://github.com/apache/tinkerpop/pull/3384#discussion_r3083231150


##########
docs/src/reference/gremlin-applications.asciidoc:
##########
@@ -469,31 +469,83 @@ That file tells Gremlin Server many things such as:
 * Thread pool sizes
 * Where to report metrics gathered by the server
 * The serializers to make available
-* The Gremlin `ScriptEngine` instances to expose and external dependencies to 
inject into them
 * `Graph` instances to expose
+* `TraversalSource` bindings (auto-created or explicitly declared)
+* `LifeCycleHook` implementations for startup/shutdown logic
 
 The log messages that printed above show a number of things, but most 
importantly, there is a `Graph` instance named
 `graph` that is exposed in Gremlin Server.  This graph is an in-memory 
TinkerGraph and was empty at the start of the
-server.  An initialization script at `scripts/generate-modern.groovy` was 
executed during startup.  Its contents are
-as follows:
+server.  A `TinkerFactoryDataLoader` lifecycle hook loaded the "modern" 
dataset into it during startup, and a
+`TraversalSource` named `g` was auto-created from the `graph` entry.
 
-[source,groovy]
+[[server-auto-traversal-sources]]
+==== Auto-Created TraversalSources
+
+When Gremlin Server starts, it automatically creates a `TraversalSource` for 
each graph in the `graphs` configuration
+that does not have an explicit entry in the `traversalSources` section.  The 
naming convention is:
+
+* A graph named `graph` gets a `TraversalSource` named `g`
+* All other graphs get `g_<name>` (e.g. a graph named `modern` gets `g_modern`)
+
+This means a minimal configuration like the following is fully functional:
+
+[source,yaml]
+----
+graphs: {
+  graph: conf/tinkergraph-empty.properties}
+----
+
+[[server-traversal-sources]]
+==== Declarative TraversalSources
+
+For more control, the `traversalSources` YAML section allows explicit 
`TraversalSource` creation with optional
+strategy configuration via a Gremlin query:
+
+[source,yaml]
+----
+traversalSources: {
+  g: {graph: graph},
+  gReadOnly: {graph: graph, query: "g.withStrategies(ReadOnlyStrategy)", 
language: "gremlin-lang"}}

Review Comment:
   is "query" the right terminology here? it's not really a functioning query - 
it's only allowing configuration steps i assume? maybe it's a 
"sourceConfiguration"?? you use "expression" below - that's better - like, 
"gremlinExpression"?? "sourceExpression"?? 
   
   anything stopping someone from doing stuff other than configuration steps? 
what happens if i use another language and do `g.V()....`? seems like we might 
want some controls there if there aren't any already.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to