Sitelet https://github.com/ArcadeData/arcadedb/issues/690
Skip to content

Support validation with Gremlin "addVertex" through Postgres driver #690

Description

@docbacardi

ArcadeDB Version: 22.12.1-SNAPSHOT

JDK Version: openjdk version "11.0.17" 2022-10-18

OS: Ubuntu 22.04.1 LTS

Expected behavior

I have created a vertex type with 2 properties with the following SQL commands:

chicken@asteroid:~$ psql --host=localhost testdatabase root
Password for user root: 
psql (14.5 (Ubuntu 14.5-0ubuntu0.22.04.1), server 10.5)
Type "help" for help.

testdatabase=> CREATE VERTEX TYPE ChipID;
     operation      | typeName 
--------------------+----------
 create vertex type | ChipID
(1 row)

INSERT 0 1
testdatabase=> CREATE PROPERTY ChipID.name STRING (mandatory true, notnull true, readonly true);
    operation    | typeName | propertyName | mandatory | notnull | readonly 
-----------------+----------+--------------+-----------+---------+----------
 create property | ChipID   | name         | \x01      | \x01    | \x01
(1 row)

testdatabase=> CREATE PROPERTY ChipID.uid STRING (mandatory true, notnull true, readonly true);
    operation    | typeName | propertyName | mandatory | notnull | readonly 
-----------------+----------+--------------+-----------+---------+----------
 create property | ChipID   | uid          | \x01      | \x01    | \x01
(1 row)

Both name and uid are "readonly", which means they have to be present at creation time. It is expected that the following command fails:

testdatabase=> {gremlin} g.addV('ChipID').property('name', 'a').property('uid', 'b');
ERROR:  Error on executing query: The property 'name' is mandatory, but not found on document: @ChipID[uid=b]

I'm looking for a way to create a ChipID vertex through the Postgres Driver in Gremlin.

A Gremlin graph has an "addVertex" method which looks like the right choice, but I have no idea how to access it.
Both graph and testdatabase (the name of my database) did not work:

testdatabase=> {gremlin} graph.addVertex('ChipID', 'name', 'a', 'uid', 'b');
ERROR:  Syntax error on executing query: groovy.lang.MissingPropertyException: No such property: graph for class: Script23
testdatabase=> {gremlin} testdatabase.addVertex('ChipID', 'name', 'a', 'uid', 'b');
ERROR:  Syntax error on executing query: groovy.lang.MissingPropertyException: No such property: testdatabase for class: Script24

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions