old-docs.janusgraph.org | JanusGraph old documentation site
kandi X-RAY | old-docs.janusgraph.org Summary
kandi X-RAY | old-docs.janusgraph.org Summary
JanusGraph old documentation site
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of old-docs.janusgraph.org
old-docs.janusgraph.org Key Features
old-docs.janusgraph.org Examples and Code Snippets
Community Discussions
Trending Discussions on old-docs.janusgraph.org
QUESTION
I am currently working on getting started with Janus Graph and Gremlin-Python. I am going through the following example:
https://old-docs.janusgraph.org/latest/connecting-via-python.html
In part 2 of the example, there is some strange syntax I have never seen in Python before:
...ANSWER
Answered 2021-Apr-07 at 17:38The identifier __
has no special meaning in Python, aside from not being imported by default when using from module import *
like all identifiers of the form _*
. See the Python documentation on Reserved Identifiers.
QUESTION
I am extending sparql-to-gremlin code to support fully and partially unbound predicate queries that can be used by automated processes to explore the graph structure. The idea being that you could just connect to some graph DB and ask a fully unbound query with some limit and get vertex properties, edge types, edge properties, etc. That can then be explored more.
I can now solve a fully unbound query and can solve one that has the subject bound to a vertex. Now I am trying to put it together into a multi-literal query and finding that the Gremlin MATCH Step would need to reflect on the type of Traversal before it can decide which steps would actually apply. For example if, the Traversal results in a Vertex, asking for out/in edges and properties makes sense; if it’s an Edge though, asking for out/in edges does not make sense and actually results in errors about unexpected type being thrown.
Thus the question, is it possible to write a kind of “switch” statement that would reflect on the type and then only ask for things that makes sense in that context?
Here’s one type of SPARQL query that I am trying to support (based on the Graph of the Gods described here https://old-docs.janusgraph.org/0.1.0/getting-started.html):
https://old-docs.janusgraph.org/0.1.0/images/graph-of-the-gods-2.png
...ANSWER
Answered 2020-Feb-06 at 15:21I think that I follow your problem and I don't think I have a good answer for you. At the moment, Gremlin isn't terribly good with type detection and the issue remains open on TINKERPOP-2234. The typical workaround for most people when they have a mixed set of elements in a stream is to use a step like coalesce()
or choose()
to act as a form of switch
statement and then figure out some filter than can identify the object type. So here's some mixed results that I've contrived:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install old-docs.janusgraph.org
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page