logo
down
shadow

How to select optional graph structures with Gremlin?


How to select optional graph structures with Gremlin?

By : Ant
Date : November 19 2020, 01:01 AM
it helps some times I am using Gremlin to query a graph stored in TitanDB. , You could do:
code :
g.V('description',CONTAINS,'developer').as('user').transform{it.bothE.toList()}.as('relationship').select
gremlin> g.E(12).drop()
gremlin> g.V().hasLabel('person').as('u').
......1>       map(bothE().fold()).as('r').
......2>       select('u','r')
==>[u:v[1],r:[e[9][1-created->3],e[7][1-knows->2],e[8][1-knows->4]]]
==>[u:v[2],r:[e[7][1-knows->2]]]
==>[u:v[4],r:[e[10][4-created->5],e[11][4-created->3],e[8][1-knows->4]]]
==>[u:v[6],r:[]]


Share : facebook icon twitter icon
DSE Graph with Java Driver, how to build a graph using Tinkerpop/Gremlin APIs like in Titan?

DSE Graph with Java Driver, how to build a graph using Tinkerpop/Gremlin APIs like in Titan?


By : Maricar Quitiol
Date : March 29 2020, 07:55 AM
should help you out April 28th 2017 update
Now the graph fluent API functionality can be used through this dependency:
code :
<dependency>
    <groupId>com.datastax.dse</groupId>
    <artifactId>dse-java-driver-graph</artifactId>
    <version>1.2.3</version>
</dependency> 
<dependency>
    <groupId>com.datastax.cassandra</groupId>
    <artifactId>dse-driver</artifactId>
    <version>1.1.1-beta1</version>
</dependency>
<dependency>
    <groupId>com.datastax.cassandra</groupId>
    <artifactId>java-dse-graph</artifactId>
    <version>1.0.0-beta1</version>
</dependency>
        DseCluster dseCluster = DseCluster.builder()
                .addContactPoint(HOST_IP)
                .build();
        DseSession dseSession = dseCluster.connect();
        GraphTraversalSource g = DseGraph.traversal(dseSession, new GraphOptions().setGraphName(GRAPH_NAME));

        GraphTraversal<Vertex,Vertex> gT = g.addV("User").property("uuid","testuuid");

        GraphStatement graphStatement =  DseGraph.statementFromTraversal(gT);
        GraphResultSet grs = dseSession.executeGraph(graphStatement.setGraphName(GRAPH_NAME));
        System.out.println(grs.one().asVertex());
Gremlin-server create a graph by loading data from csv files from gremlin-python

Gremlin-server create a graph by loading data from csv files from gremlin-python


By : Martin
Date : March 29 2020, 07:55 AM
hope this fix your issue TinkerPop does not really provide bulk-loading tools and relies on the native features of the graph databases to expose such functionality. The only bulk-loading tool TinkerPop does have is the BulkLoaderVertexProgram which you can use to load massive graphs in a parallel distributed fashion. Other than that (especially if you don't have a large graph) you would simply write a Gremlin script to read your source data and then using Gremlin mutation steps (i.e. addV() and addE()) load data into your graph. If you are loading in one time fashion, I would just execute such a script from the Gremlin Console and generate your graph.
So, again, three options:
Gremlin: is it possible to filter on optional properties? (graph database is Neptune)

Gremlin: is it possible to filter on optional properties? (graph database is Neptune)


By : NurAeni Ratnawati
Date : March 29 2020, 07:55 AM
fixed the issue. Will look into that further I have a graph with a single vertex: , There's nothing wrong with your or() filter, it should just work.
code :
gremlin> g = TinkerGraph.open().traversal()
==>graphtraversalsource[tinkergraph[vertices:0 edges:0], standard]
gremlin> g.addV().property(id, 'a').property('x', 'foo').iterate()
gremlin> g.V().has('x', 'foo').or(__.hasNot('y'), __.has('y', 'bar'))
==>v[a]
gremlin> g.V().has('x', 'foo').not(__.values('y').is(neq('bar')))
==>v[a]
gremlin console on Rexster (http://localhost:8182/doghouse/main/gremlin/graph) not working

gremlin console on Rexster (http://localhost:8182/doghouse/main/gremlin/graph) not working


By : AlphaMoment
Date : March 29 2020, 07:55 AM
This might help you You are mixing and matching syntax/technology from TinkerPop 2.x with 3.x. Rexster is a TinkerPop 2.x based system. You are trying to then use TinkerPop 3.x based Titan 1.0 with Gremlin syntax like TinkerFactory.createModern() and TinkerGraph.open() that creates TinkerGraph databases as part of Titan. I would say:
Don't use anything TinkerPop 2.x at this point. That version has not been maintained for many years. Do not use Titan - it is no longer maintained. Consider JanusGraph (Titan's successor) or other TinkerPop 3.x systems. If you are just getting started with graphs/TinkerPop, then simply start with TinkerGraph and Gremlin Console. Follow the Getting Started Tutorial and then read the Gremlin Console Tutorial. Finally, get familiar with the Practical Gremlin book.
tinkerpop3 Gremlin java client/cluster with org.apache.tinkerpop.gremlin.structure.Graph integration

tinkerpop3 Gremlin java client/cluster with org.apache.tinkerpop.gremlin.structure.Graph integration


By : Mikor
Date : March 29 2020, 07:55 AM
Hope that helps
Can I integrate these two part for writing query to graph database? instead of use gremlin string literal for query?
code :
gremlin> translator = org.apache.tinkerpop.gremlin.groovy.jsr223.GroovyTranslator.of("g")
==>translator[g:gremlin-groovy]
gremlin> translator.translate(g.V().out('knows').has('name','josh').asAdmin().getBytecode())
==>g.V().out("knows").has("name","josh")
Related Posts Related Posts :
  • Looking for simplest option to render Razor cshtml pages in a console application without any web server
  • Evaluating variables at a specific time in Modelica
  • When I run the Application, only "web" engine is running in GlassFish. "webservices" is not started
  • How To Set MIME Type Of Google Drive File
  • Remove Missing Values in Weka
  • Reloading a UICollectionView using reloadData method returns immediately before reloading data
  • carrot2 - can I cluster documents from a folder?
  • StreamSocket has no Close Implementation in C#
  • Rails, Foundation 4, Respond.js not working properly in IE8
  • How can i create imagesurface from cairo xlib's Graphics Context using cairo and x11 Api's?
  • CKEditor "overflow: scroll" on parent causes toolbar to freeze at initial position
  • Differences between components and controls in ENYO
  • Photoshop making isometric?
  • Does Intel IPP 8.0 support in-place operations?
  • What is Object dictionary in CANOpen?
  • Example of orbBasic Indexed User Variables
  • convert to ABSOLUTE in logback
  • How to conditionally download file using p:fileDownload
  • Error on pod install
  • Set HTTP GET Parameters in Finagle
  • different attack that uses sql injection
  • How can I change my xampp username not as 'root'
  • AMQP Content header payload structure
  • Apache POI formula evaluation not working for Excel IF
  • How can I trace RESTEasy's dispatch?
  • Map Freezes on iOS 7 with Google Maps SDK 1.4
  • Comparing lists, is the subset list within the first list
  • Non-ascii character highlight in Sublime Text 2
  • Installing Magit in Aquamacs
  • Receiving error - System.Net.Mail.SmtpException: 4.3.2 try again later
  • Coreaudio render callback in monotouch
  • The command 'yarn --v' also initiates 'yarn install' and installs packages automatically. Why is this happening?
  • save multiple matches in a list (grep or awk)
  • Can a number register be used in a groff request?
  • Mapping FAQ with RASA for large dataset (2000+)
  • Fragment not receiving LiveData updates after remove + add
  • FitText.js makes text bigger rather than smaller
  • ARM - Implementing stack with load/store multiple register values
  • How to check if a ChromeCast Session is already in progress
  • ngForm inside a Carousel Slide in UI Bootstrap not working
  • Clearing attributes in Tritium
  • "vagrant up" failing: Vagrant VM failed to remain in the running state
  • ftsearch returning empty docs
  • What are the advantages of setting "hive.exec.parallel" to false in Hive ?
  • Creating a root certificate in FiddlerCore
  • How to access app.config in a blueprint?
  • DB2 RECORDSET table name converted to uppercase
  • Resizing the superview according to the subviews
  • IExpress - Disable Compression
  • Getting InvalidProtocolBufferException while running oozie job
  • What are the differences between Play run and start?
  • How can I share props in ReasonReact?
  • Task.Delay is skipped
  • Parsley.js Password Confirm doesn‘t work
  • How to get all registred 'browser:resource' in Plone
  • Overriding page_list controller inside a package in Concrete5.6.1.2
  • Robolectric 2.x - dependent jars are downloading while running the tests
  • Setting Flyout to Main Frame Navigation(Windows 8.1 app store)
  • Build project - Nuget Error
  • How to recover admin password for SonarQube
  • shadow
    Privacy Policy - Terms - Contact Us © ourworld-yourmove.org