gremlin

TitanDB - Build a property index in descending order by timestamp

故事扮演 提交于 2019-12-12 20:16:30
问题 TitanDB 1.0.0 (on top of DynamoDB) Gremlin 3 I've got a set of vertices with a label a . I have a property of type long on those vertices which corresponds to the time in milliseconds from 1970 UTC (timestamp of when the vertex was created.) When I pull back those vertices I want to be able to pull them back in decsending order. How can I create an index on that property in the decr order in Titan Management System ? Documentation seems vague on that. Closest thing I found is public

executeGraph() is not really needed in Datastax DSE 5.0 Graph with Java?

人走茶凉 提交于 2019-12-12 20:01:58
问题 It seems that in both approaches the vertex is stored and can be retrieved properly later. Common configuration: DseCluster dseCluster = DseCluster.builder() .addContactPoint("192.168.1.43") .build(); DseSession dseSession = dseCluster.connect(); GraphTraversalSource g = DseGraph.traversal( dseSession, new GraphOptions().setGraphName("graph") ); Approach 1: Vertex v = g.addV("User").property("uuid","testuuid231").next(); Approach 2: GraphStatement graphStatement = DseGraph

Gremlin group by vertex property and get sum other properties in the same vertex

你。 提交于 2019-12-12 18:27:46
问题 We have vertex which will store various jobs and their types and counts as properties. I have to group by the status and their counts. I tried the following query which works for one property(receiveCount) g.V().hasLabel("Jobs").has("Type",within("A","B","C")).group().by("Type").by(fold().match(__.as("p").unfold().values("receiveCount").sum().as("totalRec")).select("totalRec")).next() I wanted to give 10 more properties like successCount, FailedCount etc.. Is there a better way to give that?

Gremlin, How to add edge to existing vertex in gremlin-python

ぐ巨炮叔叔 提交于 2019-12-12 05:26:52
问题 I am trying to add edge to an existing node in gremlin-python. But graph traversal(g) object do not have addE method and vertex do not have addEdge method. 回答1: You can do it with a mid-traversal V() : >>> vFrom = g.V(1).next() >>> vTo = g.V(6).next() >>> g.V(vTo).as_('t').V(vFrom).addE("knows").to("t").toList() [e[13][1-knows->6]] I did learn that there is a bug that prevents this approach that uses withSideEffect() in TinkerPop 3.2.4: >>> g.withSideEffect("t",vTo).V(vFrom).addE("knows").to(

Load Titan graph with Gremlin

混江龙づ霸主 提交于 2019-12-12 03:59:23
问题 Im toataly new with TitanDB. Im using it with cassandra & Java: Configuration file: storage.backend=cassandra storage.hostname=@CASSANDRA_CLUSTER_INNER_ADDRESS@ Java code: TitanGraph tg = TitanFactory.open(/*the configuration above*/); if (tg.isOpen()) { TitanManagement tm = tg.getManagementSystem(); PropertyKey key = tm.getPropertyKey(name); /* The rest of the nice working code */ } The Java code works fine, I can query the graph, do CRUD operations etc... Now, I want to query the graph

GraphFactory message: GraphFactory could not instantiate this Graph implementation [com.thinkaurelius.titan.core.TitanFactory]

╄→гoц情女王★ 提交于 2019-12-12 03:48:45
问题 I'm trying to make graph queries via a gremlin-shell to a Cassandra backend (locally or remotely). I downloaded a stock Gremlin Server distribution and then installed Titan (as described here in the manual-installation). http://s3.thinkaurelius.com/docs/titan/0.9.0-M1/server.html I added all the property settings and classpath : ~/gremlin-server-3.0.0.M6$ cat conf/titan-cassandra.properties gremlin.graph=com.thinkaurelius.titan.core.TitanFactory storage.backend=cassandrathrift storage

error while exporting neo4j to Graphml

怎甘沉沦 提交于 2019-12-12 03:13:58
问题 I'm trying to export Neo4j graph (with 4318 nodes & 8145 Relationships) for testing using gremlin-groovy-2.3.0 using: g = new Neo4jGraph('/tmp/mygraph'); g.saveGraphML('mygraph.xml'); but getting list of errors when typing the 1st command in console ( gremlin-groovy-2.3.0/bin/gremlin.bat ), Last line of error: Error: Component: 'org.neo4j.kernel.StoreLockerLifecycleAdapter@5e1a7112 was successfully initialized, but failed to start I have copied the Neo4j database ( \data\graph.db ) to Gremli

Gremlin drop() isn't working via java api

自闭症网瘾萝莉.ら 提交于 2019-12-12 02:52:53
问题 I'm using titan db 1.0.0 backed by a local dynamodb instance (which uses the 3.0 tinkerpop stack). I've spent more time than I'd like to admit trying to figure out why drop() wasn't working. In my use case I'm trying to remove a specific edge found via a traversal, but even graph.traversal().V().drop() wasn't working. I did much googling, but perhaps not with the right keywords. I finally figured out the issue which I'll specify in my answer. Hopefully others find this useful. 回答1: I finally

create multiple edges having vertex id number 0 to 49

被刻印的时光 ゝ 提交于 2019-12-12 02:08:25
问题 This can be a bit problem occuring for me as i am working for more time than needed . Can you tell me can i add an edge between two vertices and here i have 50 vertices and i cant find a way to add edge on it having vertex id 0 to 49 . Till now I have use gremlin> (0..<50)each{g.addEdge(V[it],V[it+1]).next()} No such property: V for class: groovysh_evaluate gremlin> (0..<=49)each{g.addEdge(g.getVertex([NodeID]),g.getVertex([NodeID+1]),'abc')} groovysh_parse: 2: unexpected token: = @ line 2,

How to use GremlinPipeLine sideEffect in java

二次信任 提交于 2019-12-12 01:53:58
问题 I would like to know how to implement the following gremlin query g.V.has("mgrNo",T.neq,"0").sideEffect{g.V.has("empNo",it.mgrNo).next().addEdge("manages",it)} in java using GremlinPipeLine . I getting confused while implementing from the .next() onwards. GremlinPipeline pipe = new GremlinPipeline(graph).V().has("mgrNo",T.neq,0).sideEffect(new PipeFunction<Vertex, Object>(){ @Override public Object compute(Vertex vertex) { @SuppressWarnings("rawtypes") GremlinPipeline pipeline =