tinkerpop | Apache TinkerPop - a graph computing framework | Graph Database library
kandi X-RAY | tinkerpop Summary
kandi X-RAY | tinkerpop Summary
Apache TinkerPop - a graph computing framework
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Submits a computer result .
- Handle an iterator .
- Generate the traversal source .
- iterate bytecode traversal
- Create a new settings object from the given configuration .
- Evaluate the gremlin script .
- Deserializes this object .
- Executes an iteration of the vertex program .
- Stops the server .
- Registers a serializer for the given class .
tinkerpop Key Features
tinkerpop Examples and Code Snippets
Community Discussions
Trending Discussions on tinkerpop
QUESTION
I would like to drop specific vertices from my Neptune graph. I get a list of id's from outside Neptune and wish to drop all of them. Problem is, some of them may not exist.
I tried this, but it seems I can't hand over an array:
...ANSWER
Answered 2022-Mar-18 at 16:45Your first approach is the correct way to write your traversal - passing a List
of id
should work:
QUESTION
I have a graph with one start-node and two goal-vetices. Two paths lead to the first goal, another path to the second. I look for all paths to the goals vertices and collect the edge weights (sack(sum)). I add the sum of all paths leading to the same goal via group().by().
query so far:
...ANSWER
Answered 2022-Feb-23 at 14:38You just need to select the date
key from the map
map.
QUESTION
I am very new to apache spark and I just have to fetch a table from cassandra database, Below I have appended the data to debug the situation, Please help and thanks in advance. Cassandra Node:192.168.56.10 Spark Node: 192.168.56.10
Cassandra Table to be fetched: dev.device {keyspace.table_name}
Access pyspark with connection to cassandra:
...ANSWER
Answered 2021-Dec-27 at 11:08You can't use connector compiled for Scala 2.11 with Spark 3.2.0 that is compiled with Scala 2.12. You need to use appropriate version - right now it's 3.1.0 with coordinates com.datastax.spark:spark-cassandra-connector_2.12:3.1.0
P.S. Please note that although basic functionality will work, more advanced functionality won't work until the SPARKC-670 is fixed (see this PR)
QUESTION
Hello dear gremlin jedi,
I have a bunch of nodes with different labels in my graph:
...ANSWER
Answered 2021-Dec-10 at 18:31You can try this approach, where in query you can map values to integer, and use simple order on those integers.
QUESTION
I'm new to Gremlin and Apache TinkerPop, and so this hopefully should be something simple. I have a graph where a role relationship is made between a vertex with a label of person and another with a label of authority. The edges have labels reflecting the role, e.g. adminsters, reads etc.
The authority vertices also nest, and so have edges between themselves of owns. In the permission model, this should be being used to apply implicit permissions, so if you have the adminsters relationship to a top level authority it should also apply to all the authorities that authority owns.
Some sample to set something basic up:-
...ANSWER
Answered 2021-Dec-02 at 15:23Ok managed to get what I needed done using projects
:-
QUESTION
I'm looking for an implementation to run text query ex: "g.V().limit(1).toList()" while using the PatitionStrategy in Apache TinkerPop.
I'm attempting to build a REST interface to run queries on selected graph paritions only. I know how to run a raw query using Client, but I'm looking for an implementation where I can create a multi-tenant graph (https://tinkerpop.apache.org/docs/current/reference/#partitionstrategy) and query only selected tenants using raw text query instead of a GLV. Im able to query only selected partitions using pythongremlin, but there is no reference implementation I could find to run a text query on a tenant. Here is tenant query implementation
...ANSWER
Answered 2021-Nov-26 at 22:17It depends on how the backend store handles text mode queries, but for the query itself, essentially you just need to use the Groovy/Java style formulation. This will work with GremlinServer and Amazon Neptune. For other backends you will need to make sure that this syntax is supported. So from Python you would use something like:
QUESTION
I tried to play around with the partition strategy as what was mentioned here https://tinkerpop.apache.org/docs/current/reference/ .Initially, I expect that when I define a specific partition key for a zone and write some vertices on it, it would index that specific zones and improve the vertex lookup. Eventually, I realize that the partition key is just like another property value define within a vertex. In other words, these codes is nothing more but just a property value lookup which leads to full graph traversal scan:
...
ANSWER
Answered 2021-Nov-19 at 12:03From TinkerPop's perspective, PartitionStrategy
is just automatically modifying your Gremlin to take advantage of particular property in the graph. TinkerPop doesn't know anything about your graph databases's underlying indexing features nor does it implement any. It is up to your graph to optimize such things. Some graphs might do that on their own, some might offer you the opportunity to create indices that would help improve the speed of PartitionStrategy
and others might do nothing at all, leaving PartitionStrategy
to not work well for all use cases.
Going back to TinkerPop's perspective, the goal of PartitionStrategy
(and SubgraphStrategy
for that matter) is more to ease the manner with which Gremlin is written for use cases where parts of the graph need to be hidden. Without it, you would have lots and lots of repetitive filters mixed into your traversal which would muddy its readability.
Consider this bit of code:
QUESTION
I tried following query with Gremlin and Tinkerpop
...ANSWER
Answered 2021-Sep-14 at 19:59I believe what you are seeing is a special case condition with TinkerGraph where if you create two properties with the same key while creating the vertex as well, list cardinality is assumed. If you were to perform the same property additions on a vertex that already exists, single cardinality would be assumed and one would replace the other. For example:
QUESTION
I'm trying to test if janusgraph could be queried with sparql. So, I found one of plug-in 'SPARQL-Gremlin' could do that. (At least, the doc said it is working.) However, when I followed the doc https://tinkerpop.apache.org/docs/current/reference/#sparql-gremlin I found that if current storage is TinkGraph, then the sparql could be run successfully. However, if I change storage solution to the remote(janusgraph), then I got error message. So, is there anyone who have been succeed based on this plugin and janusgraph?
...ANSWER
Answered 2021-Aug-26 at 13:47The comment form HadoopMarc is the likely lead to solving your problem. You need to be sure sparql-gremlin
is on your classpath for Gremlin Server when using this the way that you are in Gremlin Console. In other words, you are sending the Gremlin string of g = traversal(SparqlTraversalSource).withGraph(graph)
to be executed on the server and the server doesn't know anything about SparqlTraversalSource
if sparql-gremlin
is not in its classpath.
To get this working via Gremlin Console and :remote
(i.e. sending scripts) I would do try the following:
- Get
sparql-gremlin
on your classpath for Gremlin Server (i.e. Janus Server). You can do that best withbin/gremlin-server.sh install org.apache.tinkerpop sparql-gremlin 3.4.12
(or whatever version you are using) - Start the server with a
graph
configured for JanusGraph in the server YAML file - Connect with Gremlin Console using
:remote
as you did in your example - Test to see if Gremlin Server picked up the package by sending just submitting a script of
SparqlTraversalSource
which should return the classname. - If the previous step worked you should be able to do:
traversal(SparqlTraversalSource).withGraph(graph).sparql("SELECT ?....")
If you have that all working then a next step might be to configure a special traversal source in the Gremlin Server initialization script that is already setup with the SparqlTraversalSource
so that you can just reference it from your scripts directly.
QUESTION
I've sent a gremlin statement which fails with the following error:
...ANSWER
Answered 2021-Aug-04 at 17:37Thanks for the clarifications. As a side note, Neptune is not yet at the 3.5.0 TinkerPop level so there is always the possibility of mismatches between client and server. The audit log only shows the query received. It does not reflect the results of running the query. When I am debugging issues like this one, I often create a text version of the query (the node client has a translator that can do that for you) and use the Neptune REST API to first of all check the /explain
plan - you can also generate that from the Neptune notebooks using %%gremlin explain
. If nothing obvious shows up in the explain plan I usually try to run the text version of the query just to see if anything shows up - to rule out the client driver. I also sometimes run my query against a TinkerGraph just to see if the issue is as simple as Neptune not returning the best error message it could. If the text query should work, changing the Node.js Gremlin client driver to 3.4.11 is worth trying.
UPDATED to add a link to the documentation on Gremlin translators.
https://tinkerpop.apache.org/docs/current/reference/#translators
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install tinkerpop
You can use tinkerpop like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the tinkerpop component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.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