incubator-hugegraph icon indicating copy to clipboard operation
incubator-hugegraph copied to clipboard

Optimize the semantics of ifNotExist

Open Linary opened this issue 6 years ago • 3 comments

Linary avatar Feb 26 '20 03:02 Linary

check two schema all the same when create with ifNotExist(). to avoid issues like #977

javeme avatar May 02 '20 05:05 javeme

Check for 4 types of schema: propertyKey,vertexLabel,indexLabel,and edgeLabel. If the two or more create statements as the code follows are identical, the system will only create one schema quietly.

        schema.propertyKey("name").asText().ifNotExist().create();
        schema.propertyKey("name").asText().checkExist(false).create();

If the two or more create statements as the code follows with same name and at least one property different, the system will throw an ExistedException.

        schema.propertyKey("name").asText().ifNotExist().create();
        schema.propertyKey("name").asDouble().checkExist(false).create();

houzhizhen avatar May 28 '20 06:05 houzhizhen

There is a bug executing the following statement twice:

graph.schema().vertexLabel('person').useCustomizeStringId().ifNotExist().create();
graph.schema().edgeLabel('next').sourceLabel('person').targetLabel('person').ifNotExist().create();

image

javeme avatar Jun 15 '20 13:06 javeme