I have a graph that I want to to query vertices (full text search) by text that might occur in any of the keys in each vertex. How to do that?
I use Titan 0.9.0-M2 and Tinkerpop 3. The indexing backend is Elasticsearch.
Let's say your index is called vertices, then you would do:
graph.indexQuery("vertices","v.*:term").vertices()
Here's an example over the Graph of the Gods:
gremlin> graph.indexQuery("edges", "e.*:loves").edges()*.getElement()*.value("reason")
==>loves waves
==>loves fresh breezes
Related
I'm new to Graphx and doing some research, where I have to map the property graph model to hadoop. I have successfully created the graph by creating Vertex and edge RDD.Now I want to edit my graph by adding vertex at position X and the add a edge at position X-1 and X+1.
I have read multiple documents which says graphs are immutable, but there is an option of subgraph but according to me it is used only to eliminate certain vertex and edges.
Can some one guide me is there any way to edit the graphs ?
I am a newbie in OrientDB. Currently I want to create the undirect Edge between 2 Vertexes, it looks like: Product A relates to Product B.
I am using Java API, blueprint.
Thank you.
aVertex.addEdge(endVertex, "label")
graph.addEdge(id, outVertex, inVertex, "label")
Either way, there are always an out and an in vertex
There is no way to create an undirected edges. In OrientDB, as in most graph databases in the market, edges always have a direction.
It is not a limitation, because you can traverse edges regardless their direction, using both() query operator or, in Java:
vertex.getEdges(Direction.BOTH, label)
I am working with orientDB v2.2.10 and I am trying to create edges of class "E" between vertices using the graph editor, my question is can create undirected edges between vertices and if yes how to do it via Java API
You can find documentation about graph Java API here:
http://orientdb.com/docs/last/Graph-Database-Tinkerpop.html
How would write a traversal in use Gremlin TinkerPop 3 to find all vertices that have no incoming edges?
As a follow up I also need to find a vertices that have no outgoing edges as well.
This is simpler than the below version
g.V().not(inE())
g.V().not(outE())
Keeping my original answer for reference
g.V().where(inE().count().is(eq(0)))
For 0 outgoing edges
g.V().where(outE().count().is(eq(0)))
currently the algorithm returns only the vertices , but how to get the edges that it chose ? as there can be multiple edges between the vertices
I'll have to modify current function. Search source code 'OSQLFunctionDijkstra.java' for existing function and inside 'getDistance' method it should be easy to print 'Edge' information.