see https://pypi.org/project/gremlinpython/
Gremlin-Python implements Gremlin within the Python language and can be used on any Python virtual machine including the popular CPython machine.
I have the following Cypher query(neo4j) and want to convert it to a Gremlin query.
MATCH d=(a:Actor {id:" + entityId +'})-[r:ACTING_IN*0..2]-(m) WITH d,
RELATIONSHIPS(d) AS rels WHERE NONE (rel in r WHERE rel.Type = "Hollywood") RETURN…
How to set current DateTime in the gremlin console?
I need to add an audit field created_on with current_timestamp as default value
Eg:
g.addV('student').property('name', 'Thirumal').property('created_on', datetime())
In, the above query, I am…
I am trying to connect with the AWS Neptune database using gremlinpython library from the AWS Lambda function.
from gremlin_python.driver import client
query = "g.V().count()"
uri = "wss://aws-neptune-endpoint:8182/gremlin"
clientt =…
I want to get the scores for each search result like you would be able to in elasticsearch. How do you do this through Neptune?
I'm using this gremlin query, but I'm not sure how you would get the score out of it.
limit = 100
g.withSideEffect(
…
I am searching for with my_table and I get all the tables I expect, sorted by score (though I am not sure if it's in the correct order since I don't know how to get the scores from elasticsearch).
When I reverse it (i.e. from sortOrder DESC to ASC),…
How to get or create vertex/edge in Apache TinkerPop Gremlin in one query?
Currently I am doing,
id = None
if g.V().has('employee', 'name', 'thirumal').hasNext():
id = g.V().has('employee', 'name', 'thirumal').values('id')
else:
id = uuid4()
…
When I set the maxResults to 100, I get 20 results.
When I set the maxResults to 10, I get 1 result.
From the docs:
maxResults – The maximum number of results to return. The default is the index.max_result_window OpenSearch setting, which…
We can do the following to create a connection, and then attached the connection to the graph g object, and then use g to mirror gremlin query inline.
from gremlin_python import statics
from gremlin_python.structure.graph import Graph
…
I have a developer vertex and a project vertex and an edge with start date and end date properties.
A developer can work only on one project at a given point of time. Sometimes they are assigned to multiple projects with the same start date by user…
I received the following error when using gremlin_python to run a a Gremlin query to save a property to an existing vertex using Gremlin Server inside a docker container on my local machine.
…
I want to convert following cypher query in gremlin but facing issue while using union.
match d=(s:Group{id:123})<-[r:Member_Of*]-(p:Person) with d,
RELATIONSHIPS(d) as rels
WHERE NONE(rel in rels WHERE EXISTS(rel.`Ceased On`))
return…
How to use pagination in apache tinker pop gremlin? Trying to get both count and the vertex properties
g.V().hasLabel('person').fold().as('persons','count').
select('persons','count').
by(range(local, 2, 4)).
…
I'm writing a gremlin python query with the intention that
Create an edge if it doesn't exist
Update the edge properties if it does
I read some answers here already and got the first part figured out using coalesce but I'm not sure how to update…
I want to filter the vertex based out of a date. I don't know from which package i have to refer the gt
graph = Graph()
remote_connection = DriverRemoteConnection(gremlin, 'g')
g =…
I have a query like this
g.V.has('id', 1).outE()
.project('edge','vertex')
.by(valueMap('number'))
.by(inV().valueMap())
it returns a dictionary that looks like this:
{"edge": { ...}, "vertex": { ..., "city": a value,…