[orientdb] Re: Good query for for edges regarding start and end vertex.

2016-12-14 Thread Ray Neiheiser
I'd prefer a non sql solution for this.

Am Sonntag, 11. Dezember 2016 09:48:44 UTC-2 schrieb Ray Neiheiser:
>
> Anyone has an idea?
>
> Am Montag, 5. Dezember 2016 15:39:45 UTC-2 schrieb Ray Neiheiser:
>>
>> It's very strange also with:
>>
>> StreamSupport.stream(startNodes.spliterator(), false).flatMap(vertex1 -> 
>> StreamSupport.stream(vertex1.getEdges(Direction.OUT, 
>> relationshipId).spliterator(), false)).collect(Collectors.toList())
>> It seems like I am unable to detect the outgoing edges of the vertices.
>> They seem to be all null.
>>
>> I've added them like this:
>>
>>
>> Iterable startNodes = this.getVertexList(storage.getStartNode(), 
>> graph);
>> Iterable endNodes = this.getVertexList(storage.getEndNode(), graph);
>>
>> for (Vertex startNode : startNodes)
>> {
>> for (Vertex endNode : endNodes)
>> {
>> String edgeClass = "class:" + storage.getId();
>> Edge edge = startNode.addEdge(edgeClass, endNode);
>>
>> for (Map.Entry entry : 
>> storage.getProperties().entrySet())
>> {
>> edge.setProperty(entry.getKey(), entry.getValue());
>> }
>> edge.setProperty(Constants.TAG_HASH, 
>> HashCreator.sha1FromRelationship(storage));
>> edge.setProperty(Constants.TAG_SNAPSHOT_ID, snapshotId);
>> }
>> }
>> graph.commit();
>>
>> And it only detect ingoing vertices not the outgoing ones.
>>
>>
>> Am Freitag, 2. Dezember 2016 23:07:29 UTC-2 schrieb Ray Neiheiser:
>>>
>>> That seems like an option.
>>> But isn't there any option in gremlin/blueprints for it?
>>>
>>> Titan also uses gremlin and I can use:
>>>
>>> GraphTraversal tempOutput =  
>>> graph.traversal().V(nodeStartList.toArray()).bothE().filter(__.otherV().is(P.within(nodeEndList.toArray(;
>>>
>>> Which will give me exactly what I want.
>>>
>>>
>>> Am Freitag, 2. Dezember 2016 01:23:04 UTC-2 schrieb Ivan Mainetti:

 not sure if this may work for you, but you could query via sql 
 something like

 select from E where out contains [, , >>> ridn>] and in contains [, , ] and >>> property>="something"



 Il giorno mercoledì 30 novembre 2016 15:19:24 UTC+1, Ray Neiheiser ha 
 scritto:
>
> I have some performance problems with reading edges depending on their 
> start and end nodes. Is there a better way than checking every edges end 
> vertex of every start vertex?
>
> Iterable startNodes = 
> getVertexList(relationshipStorage.getStartNode(), graph);
> Iterable endNodes = 
> getVertexList(relationshipStorage.getEndNode(), graph);
>
> List list = 
> StreamSupport.stream(startNodes.spliterator(), false)
> .flatMap(vertex1 -> 
> StreamSupport.stream(vertex1.getEdges(Direction.OUT, 
> relationshipId).spliterator(), false))
> .filter(edge -> 
> StreamSupport.stream(endNodes.spliterator(), false).anyMatch(vertex -> 
> edge.getVertex(Direction.OUT).equals(vertex)))
> .collect(Collectors.toList());
>
>

-- 

--- 
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 orient-database+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[orientdb] Re: Good query for for edges regarding start and end vertex.

2016-12-11 Thread Ray Neiheiser
Anyone has an idea?

Am Montag, 5. Dezember 2016 15:39:45 UTC-2 schrieb Ray Neiheiser:
>
> It's very strange also with:
>
> StreamSupport.stream(startNodes.spliterator(), false).flatMap(vertex1 -> 
> StreamSupport.stream(vertex1.getEdges(Direction.OUT, 
> relationshipId).spliterator(), false)).collect(Collectors.toList())
> It seems like I am unable to detect the outgoing edges of the vertices.
> They seem to be all null.
>
> I've added them like this:
>
>
> Iterable startNodes = this.getVertexList(storage.getStartNode(), 
> graph);
> Iterable endNodes = this.getVertexList(storage.getEndNode(), graph);
>
> for (Vertex startNode : startNodes)
> {
> for (Vertex endNode : endNodes)
> {
> String edgeClass = "class:" + storage.getId();
> Edge edge = startNode.addEdge(edgeClass, endNode);
>
> for (Map.Entry entry : 
> storage.getProperties().entrySet())
> {
> edge.setProperty(entry.getKey(), entry.getValue());
> }
> edge.setProperty(Constants.TAG_HASH, 
> HashCreator.sha1FromRelationship(storage));
> edge.setProperty(Constants.TAG_SNAPSHOT_ID, snapshotId);
> }
> }
> graph.commit();
>
> And it only detect ingoing vertices not the outgoing ones.
>
>
> Am Freitag, 2. Dezember 2016 23:07:29 UTC-2 schrieb Ray Neiheiser:
>>
>> That seems like an option.
>> But isn't there any option in gremlin/blueprints for it?
>>
>> Titan also uses gremlin and I can use:
>>
>> GraphTraversal tempOutput =  
>> graph.traversal().V(nodeStartList.toArray()).bothE().filter(__.otherV().is(P.within(nodeEndList.toArray(;
>>
>> Which will give me exactly what I want.
>>
>>
>> Am Freitag, 2. Dezember 2016 01:23:04 UTC-2 schrieb Ivan Mainetti:
>>>
>>> not sure if this may work for you, but you could query via sql something 
>>> like
>>>
>>> select from E where out contains [, , >> ridn>] and in contains [, , ] and >> property>="something"
>>>
>>>
>>>
>>> Il giorno mercoledì 30 novembre 2016 15:19:24 UTC+1, Ray Neiheiser ha 
>>> scritto:

 I have some performance problems with reading edges depending on their 
 start and end nodes. Is there a better way than checking every edges end 
 vertex of every start vertex?

 Iterable startNodes = 
 getVertexList(relationshipStorage.getStartNode(), graph);
 Iterable endNodes = 
 getVertexList(relationshipStorage.getEndNode(), graph);

 List list = 
 StreamSupport.stream(startNodes.spliterator(), false)
 .flatMap(vertex1 -> 
 StreamSupport.stream(vertex1.getEdges(Direction.OUT, 
 relationshipId).spliterator(), false))
 .filter(edge -> 
 StreamSupport.stream(endNodes.spliterator(), false).anyMatch(vertex -> 
 edge.getVertex(Direction.OUT).equals(vertex)))
 .collect(Collectors.toList());



-- 

--- 
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 orient-database+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[orientdb] Re: Good query for for edges regarding start and end vertex.

2016-12-05 Thread Ray Neiheiser
It's very strange also with:

StreamSupport.stream(startNodes.spliterator(), false).flatMap(vertex1 -> 
StreamSupport.stream(vertex1.getEdges(Direction.OUT, 
relationshipId).spliterator(), false)).collect(Collectors.toList())
It seems like I am unable to detect the outgoing edges of the vertices.
They seem to be all null.

I've added them like this:


Iterable startNodes = this.getVertexList(storage.getStartNode(), graph);
Iterable endNodes = this.getVertexList(storage.getEndNode(), graph);

for (Vertex startNode : startNodes)
{
for (Vertex endNode : endNodes)
{
String edgeClass = "class:" + storage.getId();
Edge edge = startNode.addEdge(edgeClass, endNode);

for (Map.Entry entry : 
storage.getProperties().entrySet())
{
edge.setProperty(entry.getKey(), entry.getValue());
}
edge.setProperty(Constants.TAG_HASH, 
HashCreator.sha1FromRelationship(storage));
edge.setProperty(Constants.TAG_SNAPSHOT_ID, snapshotId);
}
}
graph.commit();

And it only detect ingoing vertices not the outgoing ones.


Am Freitag, 2. Dezember 2016 23:07:29 UTC-2 schrieb Ray Neiheiser:
>
> That seems like an option.
> But isn't there any option in gremlin/blueprints for it?
>
> Titan also uses gremlin and I can use:
>
> GraphTraversal tempOutput =  
> graph.traversal().V(nodeStartList.toArray()).bothE().filter(__.otherV().is(P.within(nodeEndList.toArray(;
>
> Which will give me exactly what I want.
>
>
> Am Freitag, 2. Dezember 2016 01:23:04 UTC-2 schrieb Ivan Mainetti:
>>
>> not sure if this may work for you, but you could query via sql something 
>> like
>>
>> select from E where out contains [, , > >] and in contains [, , ] and > property>="something"
>>
>>
>>
>> Il giorno mercoledì 30 novembre 2016 15:19:24 UTC+1, Ray Neiheiser ha 
>> scritto:
>>>
>>> I have some performance problems with reading edges depending on their 
>>> start and end nodes. Is there a better way than checking every edges end 
>>> vertex of every start vertex?
>>>
>>> Iterable startNodes = 
>>> getVertexList(relationshipStorage.getStartNode(), graph);
>>> Iterable endNodes = 
>>> getVertexList(relationshipStorage.getEndNode(), graph);
>>>
>>> List list = 
>>> StreamSupport.stream(startNodes.spliterator(), false)
>>> .flatMap(vertex1 -> 
>>> StreamSupport.stream(vertex1.getEdges(Direction.OUT, 
>>> relationshipId).spliterator(), false))
>>> .filter(edge -> 
>>> StreamSupport.stream(endNodes.spliterator(), false).anyMatch(vertex -> 
>>> edge.getVertex(Direction.OUT).equals(vertex)))
>>> .collect(Collectors.toList());
>>>
>>>

-- 

--- 
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 orient-database+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[orientdb] Re: Good query for for edges regarding start and end vertex.

2016-12-02 Thread Ray Neiheiser
That seems like an option.
But isn't there any option in gremlin for it?

Titan also uses gremlin and I can use:

GraphTraversal tempOutput =  
graph.traversal().V(nodeStartList.toArray()).bothE().filter(__.otherV().is(P.within(nodeEndList.toArray(;

Which will give me exactly what I want.


Am Freitag, 2. Dezember 2016 01:23:04 UTC-2 schrieb Ivan Mainetti:
>
> not sure if this may work for you, but you could query via sql something 
> like
>
> select from E where out contains [, ,  >] and in contains [, , ] and  >="something"
>
>
>
> Il giorno mercoledì 30 novembre 2016 15:19:24 UTC+1, Ray Neiheiser ha 
> scritto:
>>
>> I have some performance problems with reading edges depending on their 
>> start and end nodes. Is there a better way than checking every edges end 
>> vertex of every start vertex?
>>
>> Iterable startNodes = 
>> getVertexList(relationshipStorage.getStartNode(), graph);
>> Iterable endNodes = 
>> getVertexList(relationshipStorage.getEndNode(), graph);
>>
>> List list = 
>> StreamSupport.stream(startNodes.spliterator(), false)
>> .flatMap(vertex1 -> 
>> StreamSupport.stream(vertex1.getEdges(Direction.OUT, 
>> relationshipId).spliterator(), false))
>> .filter(edge -> 
>> StreamSupport.stream(endNodes.spliterator(), false).anyMatch(vertex -> 
>> edge.getVertex(Direction.OUT).equals(vertex)))
>> .collect(Collectors.toList());
>>
>>

-- 

--- 
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 orient-database+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[orientdb] Re: Good query for for edges regarding start and end vertex.

2016-12-01 Thread Ivan Mainetti
not sure if this may work for you, but you could query via sql something 
like

select from E where out contains [, , ] 
and in contains [, , ] and =
"something"



Il giorno mercoledì 30 novembre 2016 15:19:24 UTC+1, Ray Neiheiser ha 
scritto:
>
> I have some performance problems with reading edges depending on their 
> start and end nodes. Is there a better way than checking every edges end 
> vertex of every start vertex?
>
> Iterable startNodes = 
> getVertexList(relationshipStorage.getStartNode(), graph);
> Iterable endNodes = 
> getVertexList(relationshipStorage.getEndNode(), graph);
>
> List list = 
> StreamSupport.stream(startNodes.spliterator(), false)
> .flatMap(vertex1 -> 
> StreamSupport.stream(vertex1.getEdges(Direction.OUT, 
> relationshipId).spliterator(), false))
> .filter(edge -> 
> StreamSupport.stream(endNodes.spliterator(), false).anyMatch(vertex -> 
> edge.getVertex(Direction.OUT).equals(vertex)))
> .collect(Collectors.toList());
>
>

-- 

--- 
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 orient-database+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[orientdb] Re: Good query for for edges regarding start and end vertex.

2016-12-01 Thread Ray Neiheiser
Exactly, I need to find edges knowing start and vertices and it's possible 
that I know edge label and property sometimes as well.

Am Mittwoch, 30. November 2016 20:19:45 UTC-2 schrieb Ivan Mainetti:
>
> please help me understand, you need to search edges knowing start and end 
> vertices?
>
>
> Il giorno mercoledì 30 novembre 2016 15:19:24 UTC+1, Ray Neiheiser ha 
> scritto:
>>
>> I have some performance problems with reading edges depending on their 
>> start and end nodes. Is there a better way than checking every edges end 
>> vertex of every start vertex?
>>
>> Iterable startNodes = 
>> getVertexList(relationshipStorage.getStartNode(), graph);
>> Iterable endNodes = 
>> getVertexList(relationshipStorage.getEndNode(), graph);
>>
>> List list = 
>> StreamSupport.stream(startNodes.spliterator(), false)
>> .flatMap(vertex1 -> 
>> StreamSupport.stream(vertex1.getEdges(Direction.OUT, 
>> relationshipId).spliterator(), false))
>> .filter(edge -> 
>> StreamSupport.stream(endNodes.spliterator(), false).anyMatch(vertex -> 
>> edge.getVertex(Direction.OUT).equals(vertex)))
>> .collect(Collectors.toList());
>>
>>

-- 

--- 
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 orient-database+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[orientdb] Re: Good query for for edges regarding start and end vertex.

2016-11-30 Thread Ivan Mainetti
please help me understand, you need to search edges knowing start and end 
vertices?


Il giorno mercoledì 30 novembre 2016 15:19:24 UTC+1, Ray Neiheiser ha 
scritto:
>
> I have some performance problems with reading edges depending on their 
> start and end nodes. Is there a better way than checking every edges end 
> vertex of every start vertex?
>
> Iterable startNodes = 
> getVertexList(relationshipStorage.getStartNode(), graph);
> Iterable endNodes = 
> getVertexList(relationshipStorage.getEndNode(), graph);
>
> List list = 
> StreamSupport.stream(startNodes.spliterator(), false)
> .flatMap(vertex1 -> 
> StreamSupport.stream(vertex1.getEdges(Direction.OUT, 
> relationshipId).spliterator(), false))
> .filter(edge -> 
> StreamSupport.stream(endNodes.spliterator(), false).anyMatch(vertex -> 
> edge.getVertex(Direction.OUT).equals(vertex)))
> .collect(Collectors.toList());
>
>

-- 

--- 
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 orient-database+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[orientdb] Re: Good query for for edges regarding start and end vertex.

2016-11-30 Thread Oleksandr Gubchenko
Hi,  did you tried it using indexes?

Il giorno mercoledì 30 novembre 2016 15:19:24 UTC+1, Ray Neiheiser ha 
scritto:
>
> I have some performance problems with reading edges depending on their 
> start and end nodes. Is there a better way than checking every edges end 
> vertex of every start vertex?
>
> Iterable startNodes = 
> getVertexList(relationshipStorage.getStartNode(), graph);
> Iterable endNodes = 
> getVertexList(relationshipStorage.getEndNode(), graph);
>
> List list = 
> StreamSupport.stream(startNodes.spliterator(), false)
> .flatMap(vertex1 -> 
> StreamSupport.stream(vertex1.getEdges(Direction.OUT, 
> relationshipId).spliterator(), false))
> .filter(edge -> 
> StreamSupport.stream(endNodes.spliterator(), false).anyMatch(vertex -> 
> edge.getVertex(Direction.OUT).equals(vertex)))
> .collect(Collectors.toList());
>
>

-- 

--- 
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 orient-database+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.