titan-tp3-driver-example | Example Java program using Titan | Graph Database library
kandi X-RAY | titan-tp3-driver-example Summary
kandi X-RAY | titan-tp3-driver-example Summary
This is a starter project that demonstrates how a basic graph application can communicate with a Titan Server. Titan implements the graph APIs defined in [Apache TinkerPop] so much of this example code can work with any [Gremlin Server] This project demonstrates how to connect to Gremlin Server through Java using the [Gremlin Driver] that is distributed by TinkerPop.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- The main method
- Finds the creator of the given software
- Closes the cluster
- Get the singleton instance
titan-tp3-driver-example Key Features
titan-tp3-driver-example Examples and Code Snippets
Community Discussions
Trending Discussions on titan-tp3-driver-example
QUESTION
I've written a JUnit Test to check against the generate-modern.groovy graph if marko exists.
My gremlin query being
"g.V().has('name','marko')";
As you can see in the generate-modern.groovy file that indexing is already applied on the name property of the person.
I later made the following
query.force-index=true
property true in the dynamodb.properties file which blocks whole graph scan thereby making indexing mandatory.
However it throws me the following exception
ANSWER
Answered 2017-Aug-03 at 19:10The personByName
index definition uses a label constraint.
QUESTION
I have 2 questions:
How to index this query?
...
ANSWER
Answered 2017-Jul-04 at 14:22If that query is taking a long time, the problem is likely that it is visiting too many elements or it is stuck in an infinite loop. The existing JanusGraph/Titan indexes won't help for that. You already have a direct vertex lookup by id,
g.V(vertexId)
, and the rest of the query is traversing the neighborhood from that vertex. I'd suggest using edge labels, i.e.out('friends')
, to limit the number of edges you visit. You could also usesimplePath()
to eliminate cyclic paths. You could also usetimes()
oruntil()
to keep a limit on the number of times you loop with therepeat()
step.The configuration example you referenced only used composite indexes, which do not require an indexing backend.
Mixed indexes require configuring an indexing backend, either Elasticsearch, Lucene, or Solr. Pick one of these, then make sure you pass the correct configuration properties when you initialize your graph. You can find several examples in the distribution zip file in the conf
directory. For example, in the janusgraph-cassandra-es.properties
, you'll find:
QUESTION
We are trying to create a huge graph (around 100,000 vertices) in titan using gremlin server remote connection. We have followed the example code available at https://github.com/pluradj/titan-tp3-driver-example to create remote connection to titan via gremlin server. We are able to create indices, vertices, edges query the simple graphs created without any problem;
However, when we try to create a huge graph using a generator (it creates vertices and edges directly in the server using remote connection established) , we are getting the following error:
...ANSWER
Answered 2017-Jan-10 at 11:16The problem was forgetting to use Parameterized Scripts http://tinkerpop.apache.org/docs/current/reference/#parameterized-scripts
Gremlin Server caches all scripts that are passed to it: using Parameterized Scripts reduces caching because only not common scripts are cached (g.V(x))
Not using Parameterized Scripts and using instead String.format for example (like we did) implies caching all gremlin scripts separately which is very expensive and causes an OutOfMemoryError
I hope this would help someone ;)
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install titan-tp3-driver-example
You can use titan-tp3-driver-example 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 titan-tp3-driver-example 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