person
type, and vertices of post
type. Two tags (A and B) are used to tag them. For example, vertex 1 and vertex 9 both have tag A. Vertex 3 and vertex 11 both have tag A and B. A tag-based graph named tagA
will only present to its users those base graph vertices that have tag A (the bottom-left graph). The other tag-based graph named tagB
will only present to its users those base graph vertices that have tag B (the bottom-right graph).ACCESS_TAG
WRITE_SCHEMA
READ_DATA, WRITE_DATA
WRITE_LOADINGJOB
, EXECUTE_LOADINGJOB
ACCESS_TAG
and WRITE_DATA
privileges on the base graph can create and run a DML query that sets tags on selected individual vertices.EXECUTE_LOADINGJOB
, WRITE_LOADINGJOB
and ACCESS_TAG
privileges on the base graph can create and run a loading job that explicitly sets tags on the newly loaded base graph vertices.designer
or querywriter
) can create an ordinary loading or upsert job which inserts new vertices. The new vertices will be automatically tagged according to the tag-based graph's schema definition. querywriter
and queryreader
built-in roles) can query and update the tag-based graph as they would do any other graph. The data filtering for querying or data tagging for insertion is applied automatically.querywriter
and queryreader
roles) can run some DDL operations which they should not be able to.ACCESS_TAG
privilege.ADD TAG
before it can be used. Each base graph defines its own set of tags. However, there is a global maximum number of different tags, currently set at 64.ADD TAG
can only be used inside a SCHEMA_CHANGE JOB
. An example is below:ls
to see a list of defined tags:DROP TAG
command not only removes the given tag(s) from the catalog of available tags, but also deletes them from each vertex to which it is attached. You can drop multiple tags in one statement.ADD TAG
, DROP TAG
also needs to be inside a SCHEMA_CHANGE JOB
:DROP TAG
is executed, the specified tags will be made invalid, and then the foreground process will complete. A background process will continue to run to remove the tags from all data. In the meantime, each dropped tag still takes up one of the 64 slots for tags. The slot(s) will become available once the background process finishes.TAGGABLE
is a boolean property of a vertex type that can be set with CREATE VERTEX
initially or with ALTER VERTEX
in a schema change job:WITH
clause below when creating a vertex type:WITH TAGGABLE="false".
socialNet
.socialNet
graph, create a tag-based graph called vipNet
which includes person
vertices which are tagged 'vip
'. Also include all post
vertices and all friend
, posted
and liked
edges."&
operator to combine the tags:mixedNet
will only include the person
vertices having both the public
and vip
tags, and posts having all three of the public
, tech
and dummy
tags.admin
or designer
) can create and run a DML query that sets tags on selected individual vertices.admin
or designer
) can create and run a loading job that explicitly sets tags on the newly loaded vertices.designer
or querywriter
) can create an ordinary Loading or Upsert Job which inserts new vertices. The new vertices will be automatically tagged according to the tag-based graph's schema definition. FROM
clause of a SELECT
statement); they cannot be applied to vertex variables in other contexts.v.addTags()
function to tag a vertex.READ_DATA
, WRITE_DATA
, WRITE_QUERY
, ACCESS_TAG
addTags()
is shown below. This query will add tags to person vertices to achieve the same effect as a base graph loading job example in the previous section.TAGS
clauseLOAD
statement has an optional clause for explicit tagging of loaded data. The tagging clause has two keywords, TAGS
and BY:
TAGS(<tag_list>)
specifies the tags to be set.BY
specifies how to merge tags if the targeted vertex exists in the graph BY OR:
Add the given tags to the existing set of tags.BY OVERWRITE:
Replace the existing tags with the given ones.WRITE_LOADINGJOB
, EXECUTE_LOADINGJOB
, ACCESS_TAG
vip
and public
on the person
vertex data coming from a certain file. We have three files: persons1
, persons2
, persons3
.TAGS
clause can specify a tag with a string literal ("vip"
) so every vertex gets the same tag, or with a token reference by position ($2
) or by name (quot;label"
) from the source file, so each vertex gets a data-dependent tag. If the tag clause refers to a non-existent tag, the loading job will still run, but the data will not be loaded at runtime. The loading job log will report these non-loaded vertices.posts1
, posts2
, and posts3
.vipNet
, the person
vertices will automatically be tagged with vip
.vipNet2
also includes person:vip
), then when one adds a vertex via the tag-based graph, the other tag-based graph may also see it.socialNet
or any graph derived from socialNet
which contains person
. The difference is in the effect: running it with vipNet
will apply the vip
tag. Running it with a different tag-based graph would apply different tags. Users of a given tag-based graph automatically insert and query data for that tag-based graph.vipNet
only includes vertices with the tag vip
. We can verify this by running a simple query to return all person vertices in vipNet
:WRITE_SCHEMA
and ACCESS_TAG
privileges can create, modify and drop tags, as well as create tag-based graphs for all graphs.ACCESS_TAG
privilege (e.g.admin
and designer
roles) can create/drop tags, and tag vertices. Users that have both the ACCESS_TAG
privilege and WRITE_SCHEMA
privilege (e.g. admin
and designer
roles) can create/drop tag-based graphs of the base graph.ACCESS_TAG
privilege on the base graph are able to access the base graph as their roles allow, but they do not have access to the tags on the base graph. They cannot see whether any vertex type on the graph is taggable or if there are tag-based graphs of the base graph.admin
or designer
roles will inherit their base graph role on the tag-based graph. Additionally, the creator of the tag-based graph becomes an admin of the tag-based graph. admin
role on a graph wants to grant a group of users access to a selective set of vertices.B
with the taggable vertex types, with T
as their tag expression.B
to the target users.T1
. In the future, you also want the ability to give other users access to vertices based on the vertex class.admin
user can do the following setup.T1, T2, … Tn
for all the classes in your source file in a schema change job.TAGS() BY
clause to explicitly add tags to the ingested vertices.B
, grant roles that have the appropriate privileges for the graph B
to target users.admin
user on a graph wants to give a group of users read/write access for a specific class of vertices. The users would be able to insert new vertices into the graph and query the data, and all the data they insert into the graph are tagged as the same class.B
as if it is a normal graph. They can ingest new data, as well as operate on those vertices from the base graph that have the tag T
.