Skip to main content

TigerGraph

Samples Overview

Qarbine provides a wide variety of sample templates, and queries. Some are application oriented examples, while others are database administrator (DBA) oriented.

Below are a few of the component samples to consider. Review the Qarbine Catalog for the latest components. See the latest set of TigerGraph components in the folder depicted below.

  

  

Schemas

This general purpose template is at “Qarbine_admin/Cached schemas for prompted data service”. It displays information on all of the cached schemas. These schemas are saved as users interact with data tools such as the Data Source Designer, Query by Example, and Report by Example. If a particular collection is not shown in the output, simply open one of these tools and select it from the collection drop down to create it. Then rerun the template.

Running the template prompts for a data service and database (graph).

  

Below are sample snippets from running the template.

    

Graph Schema

This template is at “example/TigerGraph/DBA/List relationship schema”. It provides information about vertex and edge types. Running the template prompts for a data service and database (graph).

  

Below is a sample snippet from running the template.

  

Click on an “Attributes…” button to see the details in a dialog. The attributes of a vertex are shown below.

  

The attributes of an edge are shown below.

  

Below is another output example.

  

Vertex and Edge Census

This template is at “example/TigerGraph/DBA/Vertex and edge census”. It provides count information about vertex and edge types. Running the template prompts for a data service and database (graph).

  

Below is a sample snippet from running the template.

  

Below is another output example.

  

Miscellaneous Queries

Qarbine provides many convenience queries to interact with TigerGraph. For more information see the Qarbine TigerGraph querying guide. Below are some of the queries.

**** **** **** ****
list graphslist collectionsvertexCount NAMEedgeCount NAMEdescribe queriesdescribe query NAMEdescribe edgesdescribe indicesdescribe dataSourcesdescribe privilegesdescribe rolesdescribe groupsdescribe usersdescribe packagesdescribe statsdescribe metricsdescribe versions

These one liners can be used within Qarbine Data Sources to obtain tabular output.

Roles

This template is at “example/TigerGraph/DBA/Describe roles”. It provides information on the defined roles. Below is a sample snippet from running the template.

  

Users

This template is at “example/TigerGraph/DBA/Describe users”. It provides information on user sign on, roles, and permissions. Below is a sample snippet from running the template.

  

Stored Queries

This template is at “example/TigerGraph/DBA/List queries”. It provides basic information on stored queries. Below is a sample snippet from running the template.

  

Stored Queries with Details

This template is at “example/TigerGraph/DBA//Describe queries with code details”. It provides detailed information on stored queries. Below is a sample snippet from running the template.

  

To see the stored query code click

  

Below is a sample text dialog displaying the code.

  

The template uses the following technique to print any stored query parameters. The body lines of interest are shown below.

  

The first body line uses a TigerGraph aware function to extract the stored query parameters.

args = tigerGraphQueryArgs(@current)

The 2nd and 3rd body lines each have a process condition of

  

If there are parameters then the “Parameters” heading is emitted and the list is turned into a paragraph using listToParagraph. The signature is

string = listToParagraph(aList, sortKeys, elementFieldsList, skipFieldsList,
lineBetweenElements, treatAsKeyValuePair, maxElements, skipNumbering)

In our use the arguments are:

  1. @args is the stored query parameter list
  1. null indicates no sorting option
  1. [‘name’, ‘type’] are the fields from each parameter to output
  1. null indicates there are no fields to skip
  1. true indicates to add a line between each list element