Re: getEdgesBetweenVertexes syntax

89 views
Skip to first unread message

David Forslund

unread,
May 3, 2012, 1:42:55 PM5/3/12
to OrientDB
I'm trying to use the "getEdgesBetweenVertexes" method and have had some
trouble understanding its syntax. I have defined an EdgeType and would
like to use that to discriminate on the edges. The two optional
arguments are labels and types. Is the types argument the edgetype?
Also, what field is the "label"? Can I pass a null argument for the
labels if I want to just specify the type?

Thanks,

Dave

Luca Garulli

unread,
May 4, 2012, 5:04:51 AM5/4/12
to orient-...@googlegroups.com
Hi David,
this is the Javadoc of the method:

* Returns all the edges between the vertexes iVertex1 and iVertex2 with label between the array of labels passed as iLabels and
* with class between the array of class names passed as iClassNames.
* @param iVertex1
*          First Vertex
* @param iVertex2
*          Second Vertex
* @param iLabels
*          Array of strings with the labels to get as filter
* @param iClassNames
*          Array of strings with the name of the classes to get as filter
* @return The Set with the common Edges between the two vertexes. If edges aren't found the set is empty

So use it as:

db.getEdgesBetweenVertexes(v1, v2, null, new String[ "EdgeType" ]);

Lvc@

David Forslund

unread,
May 4, 2012, 12:11:27 PM5/4/12
to orient-...@googlegroups.com
Thanks!   What fields or attributes of edges does the "label" correspond to?

Dave

Luca Garulli

unread,
May 4, 2012, 12:16:53 PM5/4/12
to orient-...@googlegroups.com
Hi,
"label" is a field like any other. In TinkerPop Blueprints model "label" has a special treatment. This is the reason of it, but consider it as a normal field.

Lvc@

David Forslund

unread,
May 4, 2012, 12:32:45 PM5/4/12
to orient-...@googlegroups.com
So it filters on the presence of a field by its name but not its value?  

Thanks,

Dave

Luca Garulli

unread,
May 4, 2012, 12:52:05 PM5/4/12
to orient-...@googlegroups.com
It filters on the field "label" with the value received as argument. For example:

db.getEdgesBetweenVertexes(v1, v2, "special", new String[ "Knows" ]); 

returns all the edges between vertexes v1 and v2 with label "special" of type "Knows"

Lvc@

David Forslund

unread,
May 4, 2012, 1:20:55 PM5/4/12
to orient-...@googlegroups.com
If I am understanding then, the third argument is looking for a field called "label" with the specified value.  
It doesn't look at other fields. 

Is that correct?

Thanks,

Dave

Luca Garulli

unread,
May 4, 2012, 1:27:20 PM5/4/12
to orient-...@googlegroups.com
Yes
Reply all
Reply to author
Forward
0 new messages