I am able to query the vertices by their id from my browser : http://localhost:8182/graphs/titan/vertices/4 returns : {"version":"2.1.0","results":{"name":"IA_386653723","type":"IA","_id":4,"_t ype":"vertex"},"queryTime":6.840465}
From gremlin console (bin/gremlin.sh), I am able to query the vertex by its id, but I am not able to map it (error The value is already used by another vertex and the key is unique) gremlin> v = g.v(4) ==>v[4] gremlin> v.map The value is already used by another vertex and the key is unique
And I am unable to query the vertices by their name, neither from my browser, nor from gremlin console.
From gremlin console gremlin.sh, an error NoSuchElementException is thrown : gremlin> ia = g.V('name', 'IA_386653723').next() java.util.NoSuchElementException Display stack trace? [yN] n
It looks that the index I have created thtrough gremlin.sh is not taken into account by Rexster.
I'm not sure if you have some abridged code, but like Renato and the
post you reference, I don't see where you are committing the
transaction in your script from the Gremlin console. You need the
final line i added to your script:
confcass = new BaseConfiguration();
confcass.setProperty("storage.backend","cassandra");
confcass.setProperty("storage.hostname","localhost");
confcass.setProperty("port",9160);
confcass.setProperty("storage.keyspace","titan");
g = TitanFactory.open(confcass);
g.createKeyIndex('name', Vertex.class)
g.stopTransaction(SUCCESS)
As far as transactions in rexster go, a request to the standard REST
API is encapsulated within a transaction. So, if you POST a vertex
Rexster will commit that as a transaction.
> I am able to query the vertices by their id from my browser :
> http://localhost:8182/graphs/titan/vertices/4 > returns :
> {"version":"2.1.0","results":{"name":"IA_386653723","type":"IA","_id":4,"_t ype":"vertex"},"queryTime":6.840465}
> From gremlin console (bin/gremlin.sh), I am able to query the vertex by its
> id, but I am not able to map it (error The value is already used by another
> vertex and the key is unique)
> gremlin> v = g.v(4)
> ==>v[4]
> gremlin> v.map
> The value is already used by another vertex and the key is unique
> And I am unable to query the vertices by their name, neither from my
> browser, nor from gremlin console.
> From gremlin console gremlin.sh, an error NoSuchElementException is thrown :
> gremlin> ia = g.V('name', 'IA_386653723').next()
> java.util.NoSuchElementException
> Display stack trace? [yN] n
> It looks that the index I have created thtrough gremlin.sh is not taken into
> account by Rexster.
For your information, I tried previously the command stopTransaction(true) as explained by Marko to Renato, but I got a syntax error. And I didn't find anywhere this right syntax in the documentation. Maybe I didn't look at the right place ?
On Wednesday, November 14, 2012 12:06:29 PM UTC+1, Stephen Mallette wrote:
> I'm not sure if you have some abridged code, but like Renato and the > post you reference, I don't see where you are committing the > transaction in your script from the Gremlin console. You need the > final line i added to your script:
> As far as transactions in rexster go, a request to the standard REST > API is encapsulated within a transaction. So, if you POST a vertex > Rexster will commit that as a transaction.
> Stephen
> On Wed, Nov 14, 2012 at 5:51 AM, Jean-Armel Luce <jalu...@gmail.com<javascript:>> > wrote: > > Hello,
> > I am using titan with rexster and Cassandra :
> > titan 0.1.0 > > rexster 2.1.0 > > cassandra 1.1.5 (1 single node in my VM)
> > My rexster.xml file is attached to this mail
> > Through Gremlin console (gremlin.sh), I have created an index on > property > > name:
> > From gremlin console (bin/gremlin.sh), I am able to query the vertex by > its > > id, but I am not able to map it (error The value is already used by > another > > vertex and the key is unique) > > gremlin> v = g.v(4) > > ==>v[4] > > gremlin> v.map > > The value is already used by another vertex and the key is unique
> > And I am unable to query the vertices by their name, neither from my > > browser, nor from gremlin console.
> > From gremlin console gremlin.sh, an error NoSuchElementException is > thrown : > > gremlin> ia = g.V('name', 'IA_386653723').next() > > java.util.NoSuchElementException > > Display stack trace? [yN] n
> > It looks that the index I have created thtrough gremlin.sh is not taken > into > > account by Rexster.
> And I didn't find anywhere this right syntax in the documentation. Maybe I didn't look at the right place ?
> Jean Armel
> On Wednesday, November 14, 2012 12:06:29 PM UTC+1, Stephen Mallette wrote:
> I'm not sure if you have some abridged code, but like Renato and the > post you reference, I don't see where you are committing the > transaction in your script from the Gremlin console. You need the > final line i added to your script:
> As far as transactions in rexster go, a request to the standard REST > API is encapsulated within a transaction. So, if you POST a vertex > Rexster will commit that as a transaction.
> Stephen
> On Wed, Nov 14, 2012 at 5:51 AM, Jean-Armel Luce <jalu...@gmail.com> wrote: > > Hello,
> > I am using titan with rexster and Cassandra :
> > titan 0.1.0 > > rexster 2.1.0 > > cassandra 1.1.5 (1 single node in my VM)
> > My rexster.xml file is attached to this mail
> > Through Gremlin console (gremlin.sh), I have created an index on property > > name:
> > I am able to query the vertices by their id from my browser : > > http://localhost:8182/graphs/titan/vertices/4 > > returns : > > {"version":"2.1.0","results":{"name":"IA_386653723","type":"IA","_id":4,"_t ype":"vertex"},"queryTime":6.840465}
> > From gremlin console (bin/gremlin.sh), I am able to query the vertex by its > > id, but I am not able to map it (error The value is already used by another > > vertex and the key is unique) > > gremlin> v = g.v(4) > > ==>v[4] > > gremlin> v.map > > The value is already used by another vertex and the key is unique
> > And I am unable to query the vertices by their name, neither from my > > browser, nor from gremlin console.
> > From gremlin console gremlin.sh, an error NoSuchElementException is thrown : > > gremlin> ia = g.V('name', 'IA_386653723').next() > > java.util.NoSuchElementException > > Display stack trace? [yN] n
> > It looks that the index I have created thtrough gremlin.sh is not taken into > > account by Rexster.
> And I didn't find anywhere this right syntax in the documentation. Maybe I > didn't look at the right place ?
> Jean Armel
> On Wednesday, November 14, 2012 12:06:29 PM UTC+1, Stephen Mallette wrote:
>> I'm not sure if you have some abridged code, but like Renato and the >> post you reference, I don't see where you are committing the >> transaction in your script from the Gremlin console. You need the >> final line i added to your script:
>> As far as transactions in rexster go, a request to the standard REST >> API is encapsulated within a transaction. So, if you POST a vertex >> Rexster will commit that as a transaction.
>> Stephen
>> On Wed, Nov 14, 2012 at 5:51 AM, Jean-Armel Luce <jalu...@gmail.com> >> wrote: >> > Hello,
>> > I am using titan with rexster and Cassandra :
>> > titan 0.1.0 >> > rexster 2.1.0 >> > cassandra 1.1.5 (1 single node in my VM)
>> > My rexster.xml file is attached to this mail
>> > Through Gremlin console (gremlin.sh), I have created an index on >> property >> > name:
>> > From gremlin console (bin/gremlin.sh), I am able to query the vertex by >> its >> > id, but I am not able to map it (error The value is already used by >> another >> > vertex and the key is unique) >> > gremlin> v = g.v(4) >> > ==>v[4] >> > gremlin> v.map >> > The value is already used by another vertex and the key is unique
>> > And I am unable to query the vertices by their name, neither from my >> > browser, nor from gremlin console.
>> > From gremlin console gremlin.sh, an error NoSuchElementException is >> thrown : >> > gremlin> ia = g.V('name', 'IA_386653723').next() >> > java.util.NoSuchElementException >> > Display stack trace? [yN] n
>> > It looks that the index I have created thtrough gremlin.sh is not taken >> into >> > account by Rexster.
On Wednesday, November 14, 2012 6:47:18 PM UTC+1, Jean-Armel Luce wrote:
> Hi, Thanks Marko.
> I am now able to create and query vertices. I have fun :-)
> And now, I would like to have a unique key on property name. > I tried > name = g.makeType().name("name").unique() > g.createKeyIndex('name', Vertex.class)
> and of course g.stopTransaction(SUCCESS); > (g.commit() doen't work. Probably my version is too old)
> But I was able to create 2 different vertices with the same name. Is it > normal. > Is it possible to create a unique index ?
> Jean Armel
> On Wednesday, November 14, 2012 3:57:52 PM UTC+1, Marko A. Rodriguez wrote:
>> Hi,
>> For your information, I tried previously the command >> stopTransaction(true) as explained by Marko to Renato, but I got a syntax >> error.
>> The argument isn't a boolean, but a Conclusion enum.
>> graph.stopTransaction(SUCCESS) >> or >> graph.stopTransaction(Conclusion.SUCCESS).
>> And I didn't find anywhere this right syntax in the documentation. Maybe >> I didn't look at the right place ?
>> Jean Armel
>> On Wednesday, November 14, 2012 12:06:29 PM UTC+1, Stephen Mallette wrote:
>>> I'm not sure if you have some abridged code, but like Renato and the >>> post you reference, I don't see where you are committing the >>> transaction in your script from the Gremlin console. You need the >>> final line i added to your script:
>>> As far as transactions in rexster go, a request to the standard REST >>> API is encapsulated within a transaction. So, if you POST a vertex >>> Rexster will commit that as a transaction.
>>> Stephen
>>> On Wed, Nov 14, 2012 at 5:51 AM, Jean-Armel Luce <jalu...@gmail.com> >>> wrote: >>> > Hello,
>>> > I am using titan with rexster and Cassandra :
>>> > titan 0.1.0 >>> > rexster 2.1.0 >>> > cassandra 1.1.5 (1 single node in my VM)
>>> > My rexster.xml file is attached to this mail
>>> > Through Gremlin console (gremlin.sh), I have created an index on >>> property >>> > name:
>>> > From gremlin console (bin/gremlin.sh), I am able to query the vertex >>> by its >>> > id, but I am not able to map it (error The value is already used by >>> another >>> > vertex and the key is unique) >>> > gremlin> v = g.v(4) >>> > ==>v[4] >>> > gremlin> v.map >>> > The value is already used by another vertex and the key is unique
>>> > And I am unable to query the vertices by their name, neither from my >>> > browser, nor from gremlin console.
>>> > From gremlin console gremlin.sh, an error NoSuchElementException is >>> thrown : >>> > gremlin> ia = g.V('name', 'IA_386653723').next() >>> > java.util.NoSuchElementException >>> > Display stack trace? [yN] n
>>> > It looks that the index I have created thtrough gremlin.sh is not >>> taken into >>> > account by Rexster.