cdegroc
cdegroc
Explore posts from servers
JJanusGraph
Created by karthikraju on 10/15/2024 in #questions
Unable to use text predicates like 'textContains' in gremlin python
To use JanusGraph-specific predicates, you would need to swap gremlin-python with janusgraph-python I believe: https://github.com/JanusGraph/janusgraph-python#text-predicates Can you give this a try?
3 replies
JJanusGraph
Created by b4lls4ck on 8/23/2024 in #questions
Speeding up Queries Made to JanusGraph
Thanks Florian for chiming in. I had overlooked that option!
29 replies
JJanusGraph
Created by b4lls4ck on 8/23/2024 in #questions
Speeding up Queries Made to JanusGraph
You can start Gremlin Console from a dedicated JanusGraph container or even JanusGraph server itself (https://docs.janusgraph.org/v0.3/basics/server/#connecting-to-gremlin-server)
# Start gremlin console
$ ./bin/gremlin.sh

# Connect to a remote JanusGraph server (configured in /etc/remote.yaml in this case)
gremlin> :remote connect tinkerpop.server /etc/remote.yaml session

# Enter remote console mode and send all commands to the server
gremlin> :remote console

# Now you can access open management
...
# Start gremlin console
$ ./bin/gremlin.sh

# Connect to a remote JanusGraph server (configured in /etc/remote.yaml in this case)
gremlin> :remote connect tinkerpop.server /etc/remote.yaml session

# Enter remote console mode and send all commands to the server
gremlin> :remote console

# Now you can access open management
...
29 replies
JJanusGraph
Created by b4lls4ck on 8/23/2024 in #questions
Speeding up Queries Made to JanusGraph
Technically, I think so (afaik). A grpc endpoint was added to JanusGraph 1.0 but does not yet support index management (https://github.com/JanusGraph/janusgraph/tree/master/janusgraph-grpc#todo-1). But, it doesn't mean that you need to implement something yourself. You could start a Gremlin Console and update indexes from there using Groovy.
29 replies
JJanusGraph
Created by b4lls4ck on 8/23/2024 in #questions
Speeding up Queries Made to JanusGraph
I would suggest that you create a Graph Index first. Since your condition does an exact match on "Bob", you can use a Composite Index. Indexes cannot be created from Python (AFAIK) but only through JanusGraph management interface. We have sample commands in the doc showing how to create one: https://docs.janusgraph.org/schema/index-management/index-performance/#composite-index
29 replies
JJanusGraph
Created by b4lls4ck on 8/23/2024 in #questions
Speeding up Queries Made to JanusGraph
👋🏻 Hey. Your traversals g.V().has("person", "name", "Bob").outE("knows").has("weight", P.gte(0.5)).inV().values("name").toList() could probably benefit from different indexes. Without a Graph Index (https://docs.janusgraph.org/schema/index-management/index-performance/#graph-index), the first part g.V().has("person", "name", "Bob") has to filter through all vertices to find the ones with property value "Bob". Then, without a Vertex Centric Index (https://docs.janusgraph.org/schema/index-management/index-performance/#vertex-centric-indexes), JanusGraph needs to filter all of the matching vertices' "knows" out edges - .outE("knows") - to find the ones with a weight >= 0.5 - .has("weight", P.gte(0.5)).
29 replies
JJanusGraph
Created by cdegroc on 2/20/2024 in #questions
Concurrent updates during a REINDEX
Thank you both! 🙇🏻
16 replies
JJanusGraph
Created by cdegroc on 2/20/2024 in #questions
Concurrent updates during a REINDEX
Also, as a follow-up, my understanding of the code is that a REINDEX does not clear the existing index data and will only reindex what's currently in the backend's edgestore. Is that correct? I imagine for such cases the work in https://github.com/JanusGraph/janusgraph/issues/1099 could help.
16 replies
JJanusGraph
Created by cdegroc on 2/20/2024 in #questions
Concurrent updates during a REINDEX
Thanks Boxuan. I'm trying to link that to the code. IIUC this is because keys are iterated and SliceQueries are built/emitted on the fly as the job is making progress. Is that right?
16 replies
JJanusGraph
Created by cdegroc on 1/12/2024 in #questions
TreeStep and MultiQuery support
10 replies
JJanusGraph
Created by cdegroc on 1/12/2024 in #questions
TreeStep and MultiQuery support
Thanks for your quick answer. I can see this requirement was added long ago. I will review TinkerPop tests, and then ask questions on the TinkerPop discord.
10 replies
JJanusGraph
Created by cdegroc on 1/12/2024 in #questions
TreeStep and MultiQuery support
Even though unit tests are green, I imagine this could be breaking some traversal types I haven't tried or am not used to. @rngcntr, since you're the original author of this change (https://github.com/JanusGraph/janusgraph/pull/2516/files#diff-e1f91b256e6c63d882f9b043cbfa4d264c15299c52bae1b845dcd90b8beadabbR239-R252), would you remember why MultiQuery optimizations were disabled for Path-based traversals by any chance? 🙇🏻
10 replies
JJanusGraph
Created by cdegroc on 1/12/2024 in #questions
TreeStep and MultiQuery support
👋🏻 Hey. This worked and the traversal now leverages multiQuery, resulting in a nice performance improvement in my tests.
10 replies
JJanusGraph
Created by cdegroc on 1/12/2024 in #questions
TreeStep and MultiQuery support
Thanks! That's worth a try! 👀
10 replies
JJanusGraph
Created by rpuga on 11/17/2023 in #questions
Unable to use next() in gremlin-python
14 replies
JJanusGraph
Created by mellow - Nivalis ❆ on 7/1/2023 in #questions
How do I enable dynamic graphs while using the latest docker image `janusgraph/janusgraph:latest`?
Just to be safe, I'd suggest using ConfiguredGraphFactory.createConfiguration instead of ConfiguredGraphFactory.createTemplateConfiguration, at least until you get it working.
64 replies
JJanusGraph
Created by mellow - Nivalis ❆ on 7/1/2023 in #questions
How do I enable dynamic graphs while using the latest docker image `janusgraph/janusgraph:latest`?
Yes. After this is done, I think gremlin python could be used. Just like gremlin console, it will forward commands to the JanusGraph server, so if the traversal can be used in the gremlin console, it's likely to work from gremlin python as well.
64 replies
JJanusGraph
Created by mellow - Nivalis ❆ on 7/1/2023 in #questions
How do I enable dynamic graphs while using the latest docker image `janusgraph/janusgraph:latest`?
We're still not at a point where we could open a graph traversal and use it to make requests. This command
ConfiguredGraphFactory.createTemplateConfiguration(new MapConfiguration(map))
ConfiguredGraphFactory.createTemplateConfiguration(new MapConfiguration(map))
only creates a "template configuration".
64 replies
JJanusGraph
Created by mellow - Nivalis ❆ on 7/1/2023 in #questions
How do I enable dynamic graphs while using the latest docker image `janusgraph/janusgraph:latest`?
When opening the gremlin console, here is what I did
// The next steps tell the console that commands should be forwarded to the server configured in conf/remote.yaml
gremlin> :remote connect tinkerpop.server /tmp/janus-dynamicgraphs-bug/janus-install/janusgraph-1.0.0-SNAPSHOT/conf/remote.yaml session
gremlin> :remote console
gremlin> map = new HashMap<String, Object>()
gremlin> map.put('storage.backend', 'cql')
gremlin> map.put('storage.hostname', '127.0.0.1:9042')
gremlin> map.put('index.search.backend', 'elasticsearch')
gremlin> map.put('index.search.hostname', '127.0.0.1:9200')
gremlin> ConfiguredGraphFactory.createTemplateConfiguration(new MapConfiguration(map))
// No error
// The next steps tell the console that commands should be forwarded to the server configured in conf/remote.yaml
gremlin> :remote connect tinkerpop.server /tmp/janus-dynamicgraphs-bug/janus-install/janusgraph-1.0.0-SNAPSHOT/conf/remote.yaml session
gremlin> :remote console
gremlin> map = new HashMap<String, Object>()
gremlin> map.put('storage.backend', 'cql')
gremlin> map.put('storage.hostname', '127.0.0.1:9042')
gremlin> map.put('index.search.backend', 'elasticsearch')
gremlin> map.put('index.search.hostname', '127.0.0.1:9200')
gremlin> ConfiguredGraphFactory.createTemplateConfiguration(new MapConfiguration(map))
// No error
64 replies
JJanusGraph
Created by mellow - Nivalis ❆ on 7/1/2023 in #questions
How do I enable dynamic graphs while using the latest docker image `janusgraph/janusgraph:latest`?
I've tried your script locally (thanks for that!). One think I noted is that your README file is missing one step: - A local JanusGraph server is started - A local gremlin console is started but is not connected to the server
64 replies