How can I view fresh data from gremlin console of OrientDB?
I'm trying to do it like this:
g = new OrientGraph("remote:localhost/base");
g.V()
But it doesn't show all the vertexes. If I do g.V() from web interface of the OrientDB studio I see all existing vertexes.
Related
I have the below query on OrientDB:
g.V().hasLabel('people').has('firstName',startingWith('V')).values('ID')
And I am getting a "Failed executing Gremlin query" response. I know there are 'people' with first name that start with "V", but even if there weren't it should return empty results. Any ideas why this could be happening?
You are probably running OrientDB version 3.0.x which is aligned to Gremlin 3.3.x.
These new text predicates, like startingWith, where added in Gremlin 3.4.x, and available in OriendDB version 3.1.x, which is currently in milestone preview.
I am currently getting a "No edge created" exception while using OrientDB 2.1
As per the CREATE EDGE documentation (http://orientdb.com/docs/2.1/SQL-Create-Edge.html):
Beginning with version 2.1, when no edges are created OrientDB throws
a OCommandExecutionException error. This makes it easier to integrate
edge creation in transactions. In such cases, if the source or target
vertices don't exist, it rolls back the transaction.
I was wondering if there was some way to log/print out information regarding the vertices it is trying to create an edge between. I am using a JSON file to query for updates from a DB and transformer inside that JSON to create the edges using the IDs as parameters of the query results. Thanks
I solved my issue of getting ID information of the vertices by adding "log": "debug" to the JSON file.
I understand that it is possible to create a embedded OrientDB¹ server using:
OServer server = OServerMain.create();
What i don't understand is how to create or open a OrientGraph using the OrientGraphFactory. What is needed to connect both systems. (OServer, OrientGraph)?
I normally create my OrientGraph this way:
OrientGraphFactory factory = new OrientGraphFactory("plocal:" + options.getDirectory()).setupPool(5, 100);
OrientGraphNoTx noTx = factory.getNoTx();
I don't want to connect to my graph using "remote:" if possible since this would potentially create network layer within my embedded server.
My actual goals are:
Open the graph using the OrientDB workbench for inspection
Enable OrientDB Graph database distribution.
[1] http://orientdb.com/docs/2.1/Embedded-Server.html
I am currently running Titan Server (0.4) [via bin/titan.sh -c cassandra-es start] and load the sample data using rexster-console:
rexster[groovy]> g = rexster.getGraph("graph")
rexster[groovy]> GraphOfTheGodsFactory.load(g)
How can I do the same thing above using a RexsterClient in java? Essentially, Is it possible to get access to graph without me having to embed all this in client.execute()?
Thanks for your help.
Once you've created the graph you can access it with RexsterClient. You shouldn't need to recreate the graph again with it as the data is already in Cassandra. Just specify the graph name when constructing your RexsterClient instance (in the case of Titan Server the graph name is just "graph"):
RexsterClient client = RexsterClientFactory.open("localhost", "graph");
List<Map<String, Object>> results = client.execute("g.v(4).map");
That will initialize "g" and allow you to just issue some Gremlin against the Graph of the Gods sample data set. You can read more about the options for RexsterClient here.
when i run
rexster.getGraphNames()
my only result is graph, when i ran a gremlin instance directly over titan i had
tmp
and created a graph called
mygraph
i have been loooking around and havent found anything
Titan Server will only host a single instance of a graph. Therefore, rexster.getGraphNames() will always only return one graph and it will always be called graph.
Creating a graph called mygraph with the Gremlin REPL won't connect Titan Server to the graph unless you've configured it to do so and even then, it will still be referred to by Titan Server as just graph.