22NC8
Status description
error: data exception - graph type contains duplicated tokens. The graph type includes a label, a relationship type, or an alias with the name { $token } more than once.
Explanation
This error occurs when a graph type definition attempts to use the same name for more than one label, relationship type, or alias within the same scope. Each label, relationship type, or alias must have a unique name to avoid ambiguity in the graph schema. To resolve this error, ensure all labels, relationship types, and aliases are uniquely named within the graph type definition.
Example scenarios
Let’s take the following example scenarios:
Aliases
For example, try to define two node element types using the same alias as follows:
ALTER CURRENT GRAPH TYPE SET {
( p: Person => { prop :: STRING } ),
( p: Property => { prop :: STRING } )
}
The query returns an error with GQLSTATUS 22NC9 and the status description:
error: data exception - graph type contains duplicated tokens. The graph type includes a label, a relationship type, or an alias with the name 'p' more than once.
To fix this, rename one of the aliases, for example:
ALTER CURRENT GRAPH TYPE SET {
( pers: Person => { prop :: STRING } ),
( prop: Property => { prop :: STRING } )
}
Identifiers
For example, try to define two relationship element types using the same relationship type as follows:
ALTER CURRENT GRAPH TYPE SET {
()-[n:REL => { prop :: STRING }]->(),
()-[m:REL => { prop :: STRING }]->()
}
The query returns an error with GQLSTATUS 22NC9 and the status description:
error: data exception - graph type contains duplicated tokens. The graph type includes a label, a relationship type, or an alias with the name ':REL' more than once.
To fix this, delete the duplicate relationship type definition, since they are both equivalent:
ALTER CURRENT GRAPH TYPE SET {
()-[n:REL => { prop :: STRING }]->()
}
Glossary
- $action
-
Freeform description of an action.
- $alias
-
An alias name,
mydb-alias. - $aliasList
-
A list of alias names, for example,
mydb-alias1, mydb-alias2. - $allocType
-
Allocation type (
primaryorsecondary). - $arg
-
Procedure or function argument, for example,
database,pause,dryrun, etc. - $argType
-
Argument type, either input or output.
- $auth
-
Auth provider name, for example,
ldap,native. - $boltServerState
-
Bolt server state, for example,
READY. - $boltMsgLenLimit
-
Bolt message length limit, for example,
1000. - $bytes
-
Number of bytes.
- $cause
-
Freeform description of what caused the error.
- $cfgSetting
-
Configuration setting key, for example,
server.https.enabled. - $clause
-
A Cypher clause, for example,
USE,MATCH. - $clause
-
A list of Cypher clauses, for example,
USE, MATCH. - $cmd
-
A Cypher command, for example,
DROP DATABASE,PROFILE,SHOW PROCEDURES. - $component
-
A component of something, for example, hours/minutes within a time, a subset input within the whole input,
TOPOLOGYclause within the wholeCREATE/ALTER DB … SET TOPOLOGY, etc. - $constr
-
Constraint name, for example,
book_isbn. - $constrDescrOrName
-
Constraint description,
(:Label {property0, property1, property2, property1, property3}). - $context
-
Freeform description of a context, where something is invalid or unsupported,
OPTIONS,URL,username, etc. - $coordinates
-
Coordinate value, for example,
[3.15, 4.012, 5.905]. - $count
-
Number of something, for example,
3. - $countAllocs
-
Desired number of servers to use.
- $countSeeders
-
Number of seeding servers.
- $crs
-
Coordinate reference system, for example,
WGS84. - $db
-
Database name, for example,
myDb. - $dbList
-
A list of database names.
- $dim
-
Number representing index or point dimenionality.
- $edition
-
Neo4j edition, for example, Community or Enterprise.
- $endpointType
-
One of
startorendof a relationship. - $entityId
-
ID of a node or a relationship.
- $entityType
-
A node or a relationship.
- $expr
-
Cypher expression, for example,
1 + n.prop. - $exprType
-
Freeform expression type, for example,
EXISTS,COUNT,COLLECT. - $feat
-
Freeform feature description.
- $field
-
Input field, for example, of a procedure, function, or deserialization.
- $fun
-
Function name, for example,
collect(). - $funClass
-
User-defined function implementation class name, for example,
MyFunctionClass. - $funType
-
Function type, e.g. non-deterministic or aggregate.
- $graph
-
The name of a graph, for example,
myGraph. - $graphTypeDependence
-
Graph type dependencency for constraint, one of
UNDESIGNATED,INDEPENDENT, orDEPENDENT. - $graphTypeElement
-
An element of a graph type, for example
(:Node ⇒ { name :: STRING}), or(:Source)-[:REL ⇒]→(:Target). - $graphTypeReference
-
Graph type reference, for example,
(:Node ⇒)orp. - $graphTypeOperation
-
Graph type operation, for example, one of
SET,ADD,DROPorALTER. - $hint
-
Freeform description of a hint, for example,
USING INDEX n:N(prop). - $hintList
-
A list of free form descriptions of hints like
USING INDEX n:N(prop). - $idx
-
Index name,
my_index. - $idxDescr
-
Index description, for example,
INDEX :Person(name). - $idxDescrOrName
-
Index descriptor or name.
- $idxOrConstr
-
Index or constraint name, for example,
my_indexorbook_isbn. - $idxOrConstrPat
-
Index or constraint pattern, for example,
CREATE CONSTRAINT bar IF NOT EXISTS FOR (n:L) REQUIRE (n.p1) IS NODE KEY. - $idxType
-
Index type, for example, text, vector, etc.
- $input
-
Piece of user input.
- $inputList
-
A list of user inputs.
- $item
-
Freeform description of an item.
- $keyword
-
Cypher keyword, for example,
MERGE. - $label
-
Label name, for example,
Person. - $labelExpr
-
Label expression, for example,
(n:Movie|Person). - $labelList
-
A list of label names, for example,
Person, Actor. - $lower
-
The lowest accepted number of a range.
- $mapKey
-
Map key.
- $mapKeyList
-
A list of map keys, for example,
first and secondin the map{first: 1, second: 2}. - $matchMode
-
GPM match mode, for example,
REPEATABLE ELEMENTS. - $msg
-
Freeform message.
- $msgTitle
-
Freeform message title.
- $namespaceList
-
A list of namespaces of procedures, for example,
apoc.math.. - $operation
-
A mathematical operation, for example,
/ by zero,>. - $option
-
Option name
- $optionList
-
A list of option names.
- $param
-
Parameter name, for example,
$pattern. - $paramList
-
A list of parameters, for example
$pattern, $prop. - $pat
-
Pattern, for example,
(:Person). - $pathMode
-
GPM path mode, for example,
ACYCLIC. - $pathModeList
-
A list of GPM path modes, for example,
TRAIL, ACYCLIC. - $port
-
Port name, for example,
6362. - $portList
-
A list of port names, for example,
6362, 6000, 7000. - $pos
-
A position, for example, in a sequence, for example,
2 - $pred
-
A predicate, for example,
x = 3. - $predList
-
A list of predicates, for example,
'x = 3', 'y > 4'. - $preparserInput
-
Piece of preparser input.
- $proc
-
Procedure name, for example,
db.labels(). - $procClass
-
User-defined procedure implementation class name, for example,
MyProcedureClass. - $procExeMode
-
Procedure execution mode, one of
READ,WRITE,SCHEMA, andDBMS. - $procField
-
User-defined procedure implementation class argument name, for example,
myArgument. - $procFieldType
-
User-defined procedure implementation class argument type, one of
inputoroutput. - $procFun
-
Procedure or function name or ID, for example,
db.labels()orcollect(). - $procMethod
-
User-defined procedure implementation class method name, for example,
myProcedureMethod - $procParam
-
User-defined procedure implementation parameter name.
- $procParamFmt
-
Freeform user-defined procedure implementation parameter format, for example,
com.example.*. - $propKey
-
Property key name, for example,
name. - $propKeyList
-
A list of property key names, for example,
name, age, hometown. - $query
-
A statement that retrieves or writes information to a database, for example,
MATCH (n) WHERE n.prop. - $reasonList
-
A list of reasons of the failure.
- $relType
-
Relationship type name, for example,
KNOWS. - $replacement
-
A free-form text, a replacement of a deprecated feature, a Cypher command, etc.
- $role
-
RBAC role name, for example,
admin,public,receptionist. - $routingPolicy
-
Routing policy name.
- $runtime
-
Cypher runtime name. One of
slotted,pipelined, andparallel. - $schemaDescr
-
Schema descriptor, for example,
(:Label1 {prop1}). - $schemaDescrType
-
Freeform type of schema descriptor, for example,
label property existence constraint. - $selector
-
GPM path selector, for example,
ALL PATHS,SHORTEST 2, etc. - $selectorType
-
Selector type.
- $server
-
Server name or ID, for example,
25a7efc7-d063-44b8-bdee-f23357f89f01. - $serverList
-
A list of server names or IDs, for example,
'server-1', 'server-2'. - $serverType
-
Server type,
PRIMARY(primaryConstrained),SECONDARY(secondaryConstrained), orNONE. - $serverAddress
-
Server address, for example,
localhost:20025. - $sig
-
Procedure or function signature, for example,
date(input = DEFAULT_TEMPORAL_ARGUMENT :: ANY) :: DATE - $storeFormat
-
Store format name. One of "aligned", "block", "standard", "high_limit".
- $syntax
-
Cypher syntax or keyword.
- $temporal
-
Temporal value, for example,
2025-02-18. - $timeAmount
-
Integral amount of time unit (a number).
- $timeUnit
-
Common time unit name, for example,
seconds,minutes,hours. - $token
-
Token name, for example,
MyLabel,MyRelationshipType,myPropertyKey. - $tokenId
-
Token ID.
- $tokenType
-
One of a label, a relationship type, or a property key.
- $transactionId
-
The transaction ID of a running query.
- $typeDescription
-
Freeform description of a type e.g. 'a list'.
- $upper
-
The highest accepted number of a range.
- $url
-
A URL, for example, https://example.com.
- $user
-
A user name, for example,
neo4j. - $value
-
Some value.
- $valueList
-
A list of values.
- $valueType
-
Cypher value type, for example,
STRING,BOOLEAN,INTEGER,LIST<STRING>, etc. - $valueTypeList
-
A list of Cypher value types.
- $variable
-
Variable name, for example,
n. - $variableList
-
A list of variable names, for example,
a, b, c.