Closed healiseu closed 3 years ago
@luigidellaquila Further to the observations I made above, I found that you can specify LINKEDCLASS attribute during the creation of the property with an SQL command like
CREATE PROPERTY Person.address LINK Address
But this breaks consistency with the
ALTER PROPERTY Person.address LINKEDCLASS Address
Hi, I am testing CREATE PROPERTY commands with LINK and LINKEDCLASS attributes on OrientDB 2.1.6 and I found the following inconsistency between SQL and HTTP RESTful commands:
This is executed without any problem and you can create LINK records without specifying LINKEDCLASS attribute. I noticed also that you cannot specify LINKEDCLASS during the creation of property and you have to do it secondary with ALTER command
but when you try
You get an error message
Syntax error: property named dptr is declared as LINK but linked type is not declared: property / <database> / <class-name> / <property-name> / <property-type> / <link-type>
Note that the error message is not correct, it shows there is confusion between link-type and linked-class.... andThis works, property is created with LINK and LINKEDCLASS attributes !!!
From the examples above It is clear that in the first case LINKEDCLASS is OPTIONAL but in the second case LINKEDCLASS is MANDATORY. That does not make sense, I think in both case it should be optional, following the schemaless records choice.
By the way, in the manual pages referring to Restful creation of properties the examples are wrong e.g.
String Property Example: HTTP POST request: http://localhost:2480/class/demo/simpleField should be
http://localhost:2480/property/<database>/demo/simpleField