J
JanusGraphJamie Burns

many graphs

I'm a little confused about accessing graphs. I have ideas for two unrelated graphs. For now, in my gremlin server yaml i have four graphs (while i'm learning) graphs: { graph: conf/janusgraph-inmemory.properties, ConfigurationManagementGraph: conf/janusgraph-cql-configurationgraph.properties, pbrgraph: conf/janusgraph-cql-pbrgraph.properties, gardengraph: conf/janusgraph-cql-gardengraph.properties } I can list these in the Console, gremlin> JanusGraphFactory.getGraphNames() ==>pbrgraph ==>gardengraph ==>graph ==>ConfigurationManagementGraph But to operate on one of them i have to open using the path to the properties file, gremlin> graph = JanusGraphFactory.open( 'conf/janusgraph-cql-pbrgraph.properties' ) ==>standardjanusgraph[cql:[127.0.0.1]] Why can't i just open it using the graph name? gremlin> graph = JanusGraphFactory.open( 'pbrgraph' ) Backend shorthand unknown: pbrgraph
Solution:
You then also don't need JanusGraphFactory.open() any more since JanusGraph Server already opened the graph instances for you. By using the JanusGraphFactory directly in Gremlin Console you basically circumvent this whole functionality from JanusGraph Server and instead access the JanusGraph API directly to load the graphs yourselves. This means that it doesn't know about your Gremlin Server YAML which also explains why you cannot use graph names defined in that YAML...
FH
Florian Hockmann39d ago
JanusGraph Server (which is just Gremlin Server with libraries & config loaded for JanusGraph) loads these graphs already on startup. You can also tell the server to bind a graph traversal source to these graphs on startup. Then you can directly execute Gremlin traversals on them. E.g., a graph named graph could get the traversal source g and then you can execute traversals via g.V().has([...]). A graph named gardengraph could get the traversal source g_garden so you could execute traversals via g_garden.V().... Creating the graph traversal sources for your graphs can happen in a groovy file. The server already comes with a default one: https://github.com/JanusGraph/janusgraph/blob/master/janusgraph-dist/src/assembly/static/scripts/empty-sample.groovy#L30 This Groovy script needs to be configured in your Gremlin Server YAML under scriptEngines.gremlin-groovy.plugins.org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin.files. For example like this: https://github.com/JanusGraph/janusgraph/blob/master/janusgraph-dist/src/assembly/static/conf/gremlin-server/gremlin-server-cql-es.yaml#L29
GitHub
janusgraph/janusgraph-dist/src/assembly/static/scripts/empty-sample...
JanusGraph: an open-source, distributed graph database - JanusGraph/janusgraph
GitHub
janusgraph/janusgraph-dist/src/assembly/static/conf/gremlin-server/...
JanusGraph: an open-source, distributed graph database - JanusGraph/janusgraph
Solution
FH
Florian Hockmann39d ago
You then also don't need JanusGraphFactory.open() any more since JanusGraph Server already opened the graph instances for you. By using the JanusGraphFactory directly in Gremlin Console you basically circumvent this whole functionality from JanusGraph Server and instead access the JanusGraph API directly to load the graphs yourselves. This means that it doesn't know about your Gremlin Server YAML which also explains why you cannot use graph names defined in that YAML
JB
Jamie Burns38d ago
👍 Thank you
Want results from more Discord servers?
Add your server
More Posts
Indexing on vertex labelHi, I was under the assumption that vertex label are indexed by default. But this doesn't seems to bAdd a collection of values in an edge propertyHi, I tried to find out some Gremlin example but nothing. Is it possible add, in a single edge propCustom Vertex IDs and Serialized GraphJust wondering if anyone has tried to use custom vertex ids and restore a serialized graph? `g.io("Concurrent updates during a REINDEX👋🏻 Hello. I was reading JanusGraph documentation on reindexing (https://docs.janusgraph.org/scheIs Java 17 support on the roadmap?Hi JanusGraph team, thanks for your hard work. Are there any plans to support Java 17 in the near fuDo Custom Vertex IDs Guarantee Single Instance of That Vertex?Previously I was using a composite index with a unique constraint with locking to try to enforce unisecure connection - TLSI could not find any topic about TLS encryption and how Janus does it in the docs. Does Janus supporHow many servers, or memory would you recommend for a 2.5TB dataset?JG + ScyllaDBBest configuration for a single serverServer Spec: 256 vCPU (Threads) / 4 TB memory RAID5: 35TB XFS Filesystem Current have a single servElasticsearch mixed index performanceHi All, we use JanusGraph 1.0 with Cassandra storage backend and 3 node cluster Elasticsearch index Support to query vertex with custom id in Gremlin.Net SDK@Florian Hockmann I am exploring usage of custom vertex id in our graph, when I play around with C#Vertex ID collisionsHello! I'm following up on my questions from https://discord.com/channels/981533699378135051/1198566