These functions are only available for vertex aliases (defined in the FROM
clause of a SELECT
statement); they cannot be applied to vertex variables in other contexts.
Security Roles: In order to use these functions, a user must have admin
or designer
roles on the base graph. These funcitons cannot be used on a tag-based graph.
isTaggable()
This function returns true if the vertex is taggable.
getTags()
This function returns the vertex's tags as a set. If the vertex has no tags or is untaggable, it returns an empty set.
Tip: getTags()
can be used within a PRINT
statement:
PRINT R [R.getTags()];
or PRINT R WITH TAGS
which is syntax sugar, except that it won’t print "R.getTags()": []
for non-taggable vertices.
hasTags(STRING tag1,... STRING tagN)
This function returns true
if the vertex has every tag provided in the argument list and returns false
if it does not.
The output of the query would be:
intersectTags(VERTEX v2)
This function returns the common tags between the vertex and another vertex as a set.
differenceTags(VERTEX v2)
This function returns the difference in tags between the vertex and another vertex as a set.
addTags(STRING tag1,... STRING tagN)
This function adds the tags provided in the argument list to the vertex.
removeTags(STRING tag1,... STRING tagN)
This function removes the tags provided in the argument list from the vertex.
removeAllTags()
This function removes all tags from the vertex.
Function
Description
Return type
v.isTaggable()
Return true if v is of a taggable vertex type.
BOOL
v.getTags()
Return v's set of tags. If v is untaggable, it returns an empty set.
SET<STRING>
v.hasTags(
STRING tag1,...
STRING tagN)
Return true if v has every tag in the argument list of tags.
BOOL
v.intersectTags(
VERTEX v2)
Return the set of tags that v and v2 have in common.
SET<STRING>
v.differenceTags(
VERTEX v2)
Return the set of tags that v has but v2 does not have.
SET<STRING>
v.addTags(
STRING tag1,...
STRING tagN)
Add the given tags to v.
n/a
v.removeTags(
STRING tag1,...
STRING tagN)
Remove the given tags from v.
n/a
v.removeAllTags()
Remove all tags from V.
n/a