Trouble understanding what going on creating edge

125 views
Skip to first unread message

GoorMoon

unread,
Mar 13, 2015, 6:40:27 AM3/13/15
to orient-...@googlegroups.com
Hello,

Then i create following database

CREATE CLASS Widget EXTENDS V
CREATE PROPERTY
Widget.Name STRING
CREATE PROPERTY
Widget.out_VersionOf LINKSET


CREATE CLASS
WidgetVersion EXTENDS V
CREATE PROPERTY
WidgetVersion.Version INTEGER
CREATE PROPERTY
WidgetVersion.in_VersionOf LINKSET


CREATE CLASS
VersionOf EXTENDS E


CREATE VERTEX
Widget SET Name='Widget 1'
CREATE VERTEX
Widget SET Name='Widget 2'
CREATE VERTEX
Widget SET Name='Widget 3', out_VersionOf={}


CREATE VERTEX
WidgetVersion SET Version=1
CREATE VERTEX
WidgetVersion SET Version=2
CREATE VERTEX
WidgetVersion SET Version=3, in_VersionOf={}


INFO CLASS Widget


Class................: Widget
Super class..........: V
Default cluster......: widget (id=12)
Supported cluster ids: [12]
Cluster selection....: round-robin
PROPERTIES
------------------------------------+----------------+-----------------------------------+----------------------+------------------+-----------------+-----------+-----------+----------------+
 NAME                          | TYPE        | LINKED TYPE/CLASS  | MANDATORY | READONLY | NOT NULL |    MIN  |    MAX | COLLATE  |
------------------------------------+----------------+--------------------  -------------+----------------------+------------------+-----------------+-----------+-----------+----------------+
 Name                           | STRING    | null                              | false                | false           | false          |            |             | default      |
 out_VersionOf               | LINKSET  | null                              | false                | false           | false          |            |             | default      |
------------------------------------+----------------+----------------------------------+-----------------------+------------------+-----------------+-----------+-----------+----------------+

SELECT FROM Widget


----+--------+-------------+------------+----------------------
#   |@RID |@CLASS|Name     |out_VersionOf
----+--------+-------------+------------+----------------------
0   |#12:0 |Widget    |Widget 1 |null
1   |#12:1 |Widget    |Widget 2 |null
2   |#12:2 |Widget    |Widget 3 |[0]
----+--------+-------------+------------+---------------------

INFO CLASS WidgetVersion


Class................: WidgetVersion
Super class..........: V
Default cluster......: widgetversion (id=13)
Supported cluster ids: [13]
Cluster selection....: round-robin
PROPERTIES
------------------------------------+----------------+-----------------------------------+----------------------+------------------+-----------------+-----------+-----------+----------------+
 NAME                          | TYPE        | LINKED TYPE/CLASS  | MANDATORY | READONLY | NOT NULL |    MIN  |    MAX | COLLATE  |
------------------------------------+----------------+--------------------  -------------+----------------------+------------------+-----------------+-----------+-----------+----------------+
 Version                         | STRING    | null                              | false                | false           | false          |            |             | default      |
 in_VersionOf                 | LINKSET  | null                              | false                | false           | false          |            |             | default      |
------------------------------------+----------------+----------------------------------+-----------------------+------------------+-----------------+-----------+-----------+----------------+

SELECT FROM WidgetVersion



----+---------+---------------------+------------+--------------------
#   |@RID |@CLASS         |Version  |in_VersionOf
----+---------+---------------------+------------+--------------------
0   |#13:0  |WidgetVersion |1            |null
1   |#13:1  |WidgetVersion |2            |null
2   |#13:2  |WidgetVersion |3            |[0]
----+---------+---------------------+------------+-------------------

-- All setup is done lets create some edges

CREATE EDGE VersionOf FROM #12:0 TO #13:0


Error: com.orientechnologies.orient.core.exception.OCommandExecutionException: Error on execution of command: sql.create EDGE VersionOf FROM #12:0 TO #13:0

Error: java.lang.IllegalStateException: Type of field provided in schema 'LINKSET can not be used for link creation.

CREATE EDGE VersionOf FROM #12:2 TO #13:2


Created edge '[VersionOf#14:0{out:#12:2,in:#13:2} v3]' in 0.006000 sec(s).

Colin

unread,
Mar 13, 2015, 5:30:28 PM3/13/15
to orient-...@googlegroups.com
Hi,

Which version of OrientDB are you using?

-Colin

Orient Technologies

The Company behind OrientDB

GoorMoon

unread,
Mar 13, 2015, 6:21:47 PM3/13/15
to orient-...@googlegroups.com
2.0.5 community

GoorMoon

unread,
Mar 14, 2015, 4:48:11 AM3/14/15
to orient-...@googlegroups.com
Checked again in orientdb 1.7.9 same problem.

nagaraja sosale ramaswamy

unread,
Mar 15, 2015, 2:01:51 AM3/15/15
to orient-...@googlegroups.com
i'm able to reproduce the problem on 2.0.5 community.

GoorMoon

unread,
Mar 15, 2015, 3:19:39 AM3/15/15
to orient-...@googlegroups.com
Thanks,
I'm trying to figure out if this is a bug or expected behavior

Luca Garulli

unread,
Mar 15, 2015, 6:06:44 AM3/15/15
to orient-database
Hi Gordon,
Use LINKBAG instead of LINKSET to create edges container.

Lvc@

--

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

GoorMoon

unread,
Mar 15, 2015, 6:27:38 AM3/15/15
to orient-...@googlegroups.com
Luca,
I will try a later.

But look to the example if LINKSET property is null i can't create edge
If LINKSET property is [], i can create edge.

GoorMoon

unread,
Mar 15, 2015, 3:37:16 PM3/15/15
to orient-...@googlegroups.com
Luca,

With LINKBAG property this is work even if it NULL.
Should I always use LINKBAG to create EDGE. In the documentation written that I can use as LINKLIST and as LINKSET

Colin

unread,
Mar 16, 2015, 10:51:26 AM3/16/15
to orient-...@googlegroups.com
When manually creating Edge properties (in/out) on a Vertex for use with the graph interface, always use LINKBAG.  That's what is used internally and what it expects.

The documentation about relationships is talking about using the document interface and manually handling relationships through link, linklist, linkset, linkmap.

-Colin

Orient Technologies

The Company behind OrientDB



GoorMoon

unread,
Mar 16, 2015, 4:04:38 PM3/16/15
to orient-...@googlegroups.com
Colin,

Thank you for answer, things are clear now.
Reply all
Reply to author
Forward
0 new messages