GSQL Insert command specify local edge, not global edge

I’ve run into a problem that can be shown with a simplified insert statement:

 CREATE QUERY inserttest(STRING policyRoleID, STRING resourceID) FOR GRAPH rcarpentinsights {
  /* Write query logic here */
  INSERT INTO HAS_ACCESS (FROM, TO, role) VALUES(policyRoleID PRMPolicyRole, resourceID PRMResource, "therole");
  PRINT "inserttest works!";
}

An error is shown on it:

Insering global edge type 'HAS_ACCESS' using local vertex type 'PRMPolicyRole' is not allowed.

It won’t let the query be run or compiled.

Also tried seeing if it would allow it to be created in gsql:

GSQL > @/Users/rcarpent/Documents/c/python/tigerGraph/upsertEdgeIssue/insert.gsql
 
Semantic Check Error in query inserttest (SEM-1505): line 3, col 2
Insering global edge type 'HAS_ACCESS' using local vertex type 'PRMPolicyRole'
is not allowed.
The query inserttest cannot be added!

There is a global HAS_ACCESS edge definition. But there is also a local edge HAS_ACCESS definition that should apply in that graph that includes the PRMPolicyRole to PRMResource types. That local edge definition was created fine and shows in both the web UI and with ls command in gsql. That edge as seen in the web ui schema:

Using the tigergraph REST API allows the edge to be created successfully. Payload json:

{
  "vertices": {},
  "edges": {
    "PRMPolicyRole": {
      "namespace-3/policy/more-access/admin/role/32-only": {
        "HAS_ACCESS": {
          "PRMResource": {
            "namespace-3/vdi.desktop-vm-kind.v1/jbragg10-desktop-vm-01": {
              "role": {
                "value": "therole"
              }
            }
          }
        }
      }
    }
  }
}

Posting the payload:

curl -v -X POST --upload-file upsertEdge.json https://hostname:9000/graph/graphname

Is successful:

{"version":{"edition":"enterprise","api":"v2","schema":100},"error":false,"message":"","results":[{"accepted_vertices":0,"accepted_edges":1}],"code":"REST-0002"}* Closing connection 0

And the edge that it creates is seen in the UI.

What can be changed in the query for it to be accepted and recognize the local edge definition in the way the REST API is able to recognize it?

1 Like

this has been fixed in our next release. Thanks for reporting.

1 Like