>
> g.v['12:615']
should be
g.v('12:615')
note the lower case "v" and the () instead of []
In
> g.V['12:615']
the
> g.V
is getting all vertices in g, then getting the property
'12:615'
from them, since this does not exist you get nulls.
I would beware using g.V since it will return ALL vertices
http://orientdb.com/docs/2.0/orientdb.wiki/Graph-Database-Tinkerpop.html
Has some info that will be useful to you.
Say you have a class
MyV
with indices
MyV.myid UNIQUE_HASH_INDEX STRING
MyV.kind NOTUNIQUE STRING
then
> g.getVertices("MyV.kind", "baz")._()
will get you a gremlin pipe of everything in the index MyV.kind
getVertices needs the "._()" in order to turn the result into a gremlin
pipeline.
to get one vertex you can do
> g.getVertexByKey("MyV.myid", "foobar")
or
> g.getVertices("MyV.myid", "foobar")._()[[0] //will error if doesn't exist
If you do
> g.getVertices("myid", "foobar")
orientdb should check if you have an index "V.myid" and use that if it
exists.
It is kinda tricky telling if the indices are used sometimes.
Hope this helps!
On Tuesday, April 21, 2015 at 4:32:54 PM UTC-7, William Marshall wrote:
>
> I am attempting to use Gremlin (in this case I'm actually using the
> gremlin.bat file included with OrientDB 2.0.7) to return the values of
> Vertex #12:615. Unfortunately, the syntax shown in the Retrieve a Vertex
> <http://orientdb.com/docs/2.0/orientdb.wiki/Gremlin.html#retrieve-a-vertex>
> section of Gremlin API page of your documentation is not working for me. I
> either get an error or a bunch of NULLs (see below).
>
> The Vertex I am trying to access is #12:615, which is a Vertex of the
> Schema-Mixed *Company *class. As per the documentation
> <http://orientdb.com/docs/2.0/orientdb-etl.wiki/Import-from-CSV-to-a-Graph.html>for
>
> ETL imports, it has both *id *and *name* properties in addition to a
> Company.id Index.
>
> In this particular case, I expect to return the following values (Copied
> from OrientDB Studio results):
> {
> "result": [
> {
> "@type": "d",
> "@rid": "#12:615",
> "@version": 5,
> "@class": "Company",
> "id": 1044619,
> "name": "Test Company 1",
> "address1": "1234 Welcome St.",
> "address2": null,
> "city": "Starter City",
> "state": "GA",
> "postalCode": "31020",
> "country": "US",
> "latitude": 32.648320,
> "longitude": -83.444530,
> "stockSymbol": "NYSE:TC1",
> "website": "www.company.test",
> "yearEstablished": 2015,
> "@fieldTypes": "latitude=d,longitude=d"
> }
> ],
> "notification": "Query executed in 0.096 sec. Returned 1 record(s)"
> }
>
> *Results:*
> gremlin> g.v['12:615']
> No such property: v for class: com.tinkerpop.blueprints.impls.orient.
> OrientGraph
> Display stack trace? [yN] n
> gremlin> g.V['12:615']
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>null
> ==>
> ...
--
---
You received this message because you are subscribed to the Google Groups
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.