Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Help - Vertices inserted via Rexster - Unable to read vertices from Gremlin console gremlin.sh
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post will appear after it is approved by moderators
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Jean-Armel Luce  
View profile  
 More options Nov 14 2012, 5:51 am
From: Jean-Armel Luce <jaluc...@gmail.com>
Date: Wed, 14 Nov 2012 02:51:34 -0800 (PST)
Local: Wed, Nov 14 2012 5:51 am
Subject: Help - Vertices inserted via Rexster - Unable to read vertices from Gremlin console gremlin.sh

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:

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)

Then, I have inserted a few vertices using REST requests, such as
http://localhost:8182/graphs/titan&type=IA&name=IA_386653723

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.

Maybe it is the same problem as Renato ?
(https://groups.google.com/forum/?fromgroups=#!topic/gremlin-users/5dI...).
In this case, I don't understand how to manage transactions with Rexster.

Please, could you tell me what is wrong ?

Thanks.

Jean Armel

  rexster.xml
9K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stephen Mallette  
View profile  
 More options Nov 14 2012, 6:06 am
From: Stephen Mallette <spmalle...@gmail.com>
Date: Wed, 14 Nov 2012 06:06:27 -0500
Local: Wed, Nov 14 2012 6:06 am
Subject: Re: [TinkerPop] Help - Vertices inserted via Rexster - Unable to read vertices from Gremlin console gremlin.sh
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.

Stephen


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jean-Armel Luce  
View profile  
 More options Nov 14 2012, 7:29 am
From: Jean-Armel Luce <jaluc...@gmail.com>
Date: Wed, 14 Nov 2012 04:29:41 -0800 (PST)
Local: Wed, Nov 14 2012 7:29 am
Subject: Re: [TinkerPop] Help - Vertices inserted via Rexster - Unable to read vertices from Gremlin console gremlin.sh

Hello Stephen,

It is workiong now.

Thanks for your help.

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 ?

Jean Armel


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Marko Rodriguez  
View profile  
 More options Nov 14 2012, 9:57 am
From: Marko Rodriguez <okramma...@gmail.com>
Date: Wed, 14 Nov 2012 07:57:44 -0700
Local: Wed, Nov 14 2012 9:57 am
Subject: Re: [TinkerPop] Help - Vertices inserted via Rexster - Unable to read vertices from Gremlin console gremlin.sh

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).

Note that there are plans to make this simply:
        graph.commit()
        graph.rollback()

                https://github.com/tinkerpop/blueprints/issues/317

Finally, see:
        https://github.com/tinkerpop/blueprints/wiki/Graph-Transactions

Good luck,
Marko.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jean-Armel Luce  
View profile  
 More options Nov 14 2012, 12:47 pm
From: Jean-Armel Luce <jaluc...@gmail.com>
Date: Wed, 14 Nov 2012 09:47:18 -0800 (PST)
Local: Wed, Nov 14 2012 12:47 pm
Subject: Re: [TinkerPop] Help - Vertices inserted via Rexster - Unable to read vertices from Gremlin console gremlin.sh

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jean-Armel Luce  
View profile  
 More options Nov 16 2012, 3:23 am
From: Jean-Armel Luce <jaluc...@gmail.com>
Date: Fri, 16 Nov 2012 00:23:46 -0800 (PST)
Local: Fri, Nov 16 2012 3:23 am
Subject: Re: [TinkerPop] Help - Vertices inserted via Rexster - Unable to read vertices from Gremlin console gremlin.sh

Found. A unique key is defined as below :

indexname =
g.makeType().name("name").dataType(String.class).indexed().unique().functio nal().makePropertyKey();
g.stopTransaction(SUCCESS);

And now my property is unique :
gremlin> indexname.isUnique();
==>true

And now in my graph, it is imposible to have 2 different vertices with the
same name :-)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »