Comments (3)
The gremlin client sets language to gremlin-groovy, and the titan tutorial says it is using that language:
gremlin> theseus = graph.addVertex('human')
==>v[3328]
gremlin> theseus.property('name', 'theseus')
==>null
gremlin> cerberus = g.V().has('name', 'cerberus').next()
==>v[2816]
gremlin> battle = theseus.addEdge('battled', cerberus, 'time', 22)
==>e[7eo-2kg-iz9-268][3328-battled->2816]
I tried:
`gremlin`g.addV(label, 'god')\ntheseus=g.addV(label, 'human')\ncerberus=g.V().hasLabel('god').next()\ng.V().count()`
but the count was 0. The vertices were not created before the count(). So I tried:
return this.gremlin`cerberus=g.addV(label, 'god').next()`
.then(() => {
return this.gremlin`theseus=g.addV(label, 'human')`
})
.then(() => {
return this.gremlin`g.V().count()`;
})
.then(count => {
console.log('count: ', count);
return this.gremlin`g.V().hasLabel('human').addE('battled', cerberus, 'time', 22)`;
})
The count is now ok, but it says 'no such property: cerberus for class: Script62'.
I've probably missed something.. it seems like it should be a common task.
Perhaps your other project, gremlin-script, can generate a valid script?
from gremlin-javascript.
In you last script (.then(count => {...}
) cerebus is nothing.
try to add before somthing like cerebus = g.V().hasLabel('god')
BTW, I don't think this is an issue for the gremlin-javascript client, you might find more help there : https://groups.google.com/forum/#!forum/gremlin-users
Regards,
Flo
from gremlin-javascript.
thanks Dragma, but i'm not actually assuming that the promise resolutions are carrying state back to the client. I'm assuming a transaction on the server is carrying the variables, which would simplify matters. I did try plugging in g.V().hasLabel('god').. ideally it could be plugged directly into the .addE() expression, but no luck. I think perhaps this interface is designed more for query than mutation because there doesn't appear to be a way to pull, say, cerberus into a JS object then plug it in as a binding to a later expression. I don't really have time to dig into it at this point. Water finds a way...
from gremlin-javascript.
Related Issues (20)
- Is it supports the GraphSONMessageSerializerV3d0? HOT 1
- Publish latest version of Gremlin client HOT 1
- Confirming this library runs in the browser ? HOT 3
- Is direct graph management possible? HOT 1
- Multiple properties on a vertex is not supported HOT 2
- Gremlin Client NPM Version Clarification HOT 2
- Working example? HOT 2
- Unable to send a new query over wss before the last one is returned HOT 4
- Working GraphSON read/write example?
- CosmosDB x-ms-retry-after-ms header access HOT 2
- Gremlin.createClient is not a function HOT 2
- How to use functions like "within"
- buildChallengeResponse: SASL parameter is incorrectly set for Tinkerpop HOT 4
- Can't connect to JanusGraph on Compose HOT 2
- Error: Expected Stream, got object HOT 13
- Support for connecting to a graph cluster with multiple gremlin-servers HOT 1
- Silently throws away data from the response if it contains UTF-8 characters HOT 2
- Janusgraph Server connection intermittently throws error: not opened at WebSocket.send HOT 1
- TypeScript Definition Files HOT 2
- Error: this.connection.close is not a function
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gremlin-javascript.