OntoPop
Search…
Graph API
API for querying the OntoPop Graph Database.
Last Updated: 01 March 2022 • Page Author: Jillur Quddus
Note that the OntoPop Graph API is under continuous development. OntoPop version 2.x provides a basic Graph API that is detailed on this page. Based on your OntoPop implementation use-case, you may wish to expose the Gremlin API (either directly or indirectly via a Gremlin server or another type of proxy based on the security requirements of your project) of the underlying graph database engine (for example Azure Cosmos DB or JanusGraph) which may offer a richer set of features to satisfy your expected query patterns in the event that the current OntoPop Graph API does not.

1. Gremlin Query

The structure and format of the response bodies returned from the OntoPop Gremlin Query API endpoint are implementation-specific i.e. they are dependent upon the underlying graph database engine that has been deployed (e.g. JanusGraph, Azure Cosmos DB, TinkerGraph etc.). Different graph database vendors implement (either partially or fully) the Apache TinkerPop framework in different ways and support different serializers. Thus the response bodies in the examples below (which query a JanusGraph graph database cluster) do NOT represent a standard response schema.
Please refer to the Get Graph endpoint in order to retrieve a standard and consistent response body schema representing an entire directed property graph model of a W3C Web Ontology Language (OWL) ontology.

Overview

Execute a Gremlin query against a W3C Web Ontology Language (OWL) ontology modelled as a directed property graph and managed by the OntoPop graph database.
HTTP Request Method
POST
API Endpoint
/graph/ontologies/{id}/query/gremlin

Path Variables

Name
Description
Example
id (integer)
ID of the ontology to query
13

Request Body

Property
Description
Example
gremlin (string) *
Gremlin query
g.V().has('iri', 'http://webprotege.stanford.edu/R734t4iI6j8MPmpJsIqO2v4').valueMap()

Headers

Key
Value
Description
Content-Type
application/json
See request body above
X-API-Key
Issued API Key
See API Authentication for further details.

Responses

HTTP Status
Description
Response Schema
200 OK
Gremlin query successfully executed.
Vendor-specific.
401 Unauthorized
Gremlin query request unauthorized.
N/A
500 Internal Server Error
Internal server error.
N/A

Examples

Note that some graph database engines only support string-based IDs (such as Azure Cosmos DB). In this case, you should enclose any filtering vertex IDs or edge IDs in your Gremlin queries with single quotes.

1. Filter Vertices - Get vertex (class) by Vertex ID

Example Request
{
"gremlin": "g.V(897040)"
}
Response HTTP 200 OK
{
"requestId": "a8ef2108-e447-4649-a9f2-5a3e96fb940f",
"status": {
"message": "",
"code": 200,
"attributes": {
"@type": "g:Map",
"@value": []
}
},
"result": {
"data": {
"@type": "g:List",
"@value": [
{
"@type": "g:Vertex",
"@value": {
"id": {
"@type": "g:Int64",
"@value": 897040
},
"label": "class",
"properties": {
"iri": [
{
"@type": "g:VertexProperty",
"@value": {
"id": {
"@type": "janusgraph:RelationIdentifier",
"@value": {
"relationId": "qe4i-j85s-27t1"
}
},
"value": "http://webprotege.stanford.edu/R734t4iI6j8MPmpJsIqO2v4",
"label": "iri"
}
}
],
"latestWebhookEventId": [
{
"@type": "g:VertexProperty",
"@value": {
"id": {
"@type": "janusgraph:RelationIdentifier",
"@value": {
"relationId": "qewy-j85s-29dx"
}
},
"value": {
"@type": "g:Int64",
"@value": 60
},
"label": "latestWebhookEventId"
}
}
],
"vertexId": [
{
"@type": "g:VertexProperty",
"@value": {
"id": {
"@type": "janusgraph:RelationIdentifier",
"@value": {
"relationId": "qfb6-j85s-2ayt"
}
},
"value": {
"@type": "g:Int64",
"@value": 33752713048
},
"label": "vertexId"
}
}
],
"ontologyId": [
{
"@type": "g:VertexProperty",
"@value": {
"id": {
"@type": "janusgraph:RelationIdentifier",
"@value": {
"relationId": "qg3m-j85s-28lh"
}
},
"value": {
"@type": "g:Int32",
"@value": 48
},
"label": "ontologyId"
}
}
],
"subdomain": [
{
"@type": "g:VertexProperty",
"@value": {
"id": {
"@type": "janusgraph:RelationIdentifier",
"@value": {
"relationId": "qfpe-j85s-4l51"
}
},
"value": "Confirm",
"label": "subdomain"
}
}
],
"vertexKey": [
{
"@type": "g:VertexProperty",
"@value": {
"id": {
"@type": "janusgraph:RelationIdentifier",
"@value": {
"relationId": "qgw2-j85s-2a6d"
}
},
"value": "http://webprotege.stanford.edu/R734t4iI6j8MPmpJsIqO2v4_48",
"label": "vertexKey"
}
}
],
"definition": [
{
"@type": "g:VertexProperty",
"@value": {
"id": {
"@type": "janusgraph:RelationIdentifier",
"@value": {
"relationId": "qghu-j85s-4flx"
}
},
"value": "The action taken by an Entity to improve the Condition of, and remedy Defects present on, an Asset.",
"label": "definition"
}
}
],
"dataSource": [
{
"@type": "g:VertexProperty",
"@value": {
"id": {
"@type": "janusgraph:RelationIdentifier",
"@value": {
"relationId": "qhaa-j85s-4ged"
}
},
"value": "Confirm",
"label": "dataSource"
}
}
],
"example": [
{
"@type": "g:VertexProperty",
"@value": {
"id": {
"@type": "janusgraph:RelationIdentifier",
"@value": {
"relationId": "qhoi-j85s-4kcl"
}
},
"value": "Road Works",
"label": "example"
}
}
]
}
}
}
]
},
"meta": {
"@type": "g:Map",
"@value": []
}
}
}

2. Filter Vertices - Get vertex (class) by IRI

Example Request
{
"gremlin": "g.V().has('iri', 'http://webprotege.stanford.edu/R734t4iI6j8MPmpJsIqO2v4')"
}
Response HTTP 200 OK
{
"requestId": "a8ef2108-e447-4649-a9f2-5a3e96fb940f",
"status": {
"message": "",
"code": 200,
"attributes": {
"@type": "g:Map",
"@value": []
}
},
"result": {
"data": {
"@type": "g:List",
"@value": [
{
"@type": "g:Vertex",
"@value": {
"id": {
"@type": "g:Int64",
"@value": 897040
},
"label": "class",
"properties": {
"iri": [
{
"@type": "g:VertexProperty",
"@value": {
"id": {
"@type": "janusgraph:RelationIdentifier",
"@value": {
"relationId": "qe4i-j85s-27t1"
}
},
"value": "http://webprotege.stanford.edu/R734t4iI6j8MPmpJsIqO2v4",
"label": "iri"
}
}
],
"latestWebhookEventId": [
{
"@type": "g:VertexProperty",
"@value": {
"id": {
"@type": "janusgraph:RelationIdentifier",
"@value": {
"relationId": "qewy-j85s-29dx"
}
},
"value": {
"@type": "g:Int64",
"@value": 60
},
"label": "latestWebhookEventId"
}
}
],
"vertexId": [
{
"@type": "g:VertexProperty",
"@value": {
"id": {
"@type": "janusgraph:RelationIdentifier",
"@value": {
"relationId": "qfb6-j85s-2ayt"
}
},
"value": {
"@type": "g:Int64",
"@value": 33752713048
},
"label": "vertexId"
}
}
],
"ontologyId": [
{
"@type": "g:VertexProperty",
"@value": {
"id": {
"@type": "janusgraph:RelationIdentifier",
"@value": {
"relationId": "qg3m-j85s-28lh"
}
},
"value": {
"@type": "g:Int32",
"@value": 48
},
"label": "ontologyId"
}
}
],
"subdomain": [
{
"@type": "g:VertexProperty",
"@value": {
"id": {
"@type": "janusgraph:RelationIdentifier",
"@value": {
"relationId": "qfpe-j85s-4l51"
}
},
"value": "Confirm",
"label": "subdomain"
}
}
],
"vertexKey": [
{
"@type": "g:VertexProperty",
"@value": {
"id": {
"@type": "janusgraph:RelationIdentifier",
"@value": {
"relationId": "qgw2-j85s-2a6d"
}
},
"value": "http://webprotege.stanford.edu/R734t4iI6j8MPmpJsIqO2v4_48",
"label": "vertexKey"
}
}
],
"definition": [
{
"@type": "g:VertexProperty",
"@value": {
"id": {
"@type": "janusgraph:RelationIdentifier",
"@value": {
"relationId": "qghu-j85s-4flx"
}
},
"value": "The action taken by an Entity to improve the Condition of, and remedy Defects present on, an Asset.",
"label": "definition"
}
}
],
"dataSource": [
{
"@type": "g:VertexProperty",
"@value": {
"id": {
"@type": "janusgraph:RelationIdentifier",
"@value": {
"relationId": "qhaa-j85s-4ged"
}
},
"value": "Confirm",
"label": "dataSource"
}
}
],
"example": [
{
"@type": "g:VertexProperty",
"@value": {
"id": {
"@type": "janusgraph:RelationIdentifier",
"@value": {
"relationId": "qhoi-j85s-4kcl"
}
},
"value": "Road Works",
"label": "example"
}
}
]
}
}
}
]
},
"meta": {
"@type": "g:Map",
"@value": []
}
}
}

3. Filter Vertices - Get vertices (classes and their IRIs) by arbitrary properties

Example Request
{
"gremlin": "g.V().has('dataSource', within('Confirm', 'NTIS')).valueMap('iri')"
}
Response HTTP 200 OK
{
"requestId": "abc8e3ec-c795-4f6c-a8ee-d889f14e55ce",
"status": {
"message": "",
"code": 200,
"attributes": {
"@type": "g:Map",
"@value": []
}
},
"result": {
"data": {
"@type": "g:List",
"@value": [
{
"@type": "g:Map",
"@value": [
"iri",
{
"@type": "g:List",
"@value": [
"http://webprotege.stanford.edu/R734t4iI6j8MPmpJsIqO2v4"
]
}
]
},
{
"@type": "g:Map",
"@value": [
"iri",
{
"@type": "g:List",
"@value": [
"http://webprotege.stanford.edu/R7l0LqjYK03DLCUM5XgsbGk"
]
}
]
},
{
"@type": "g:Map",
"@value": [
"iri",
{
"@type": "g:List",
"@value": [
"http://webprotege.stanford.edu/RCnRceKsHZf8Gt9UvDjM6We"
]
}
]
},
...
]
},
"meta": {
"@type": "g:Map",
"@value": []
}
}
}

4. Get Edges - Get vertex outgoing edges (class parents)

Example Request
{
"gremlin": "g.V().has('iri', 'http://webprotege.stanford.edu/R734t4iI6j8MPmpJsIqO2v4').outE()"
}
Response HTTP 200 OK
{
"requestId": "2d8de32c-7582-4e62-b2a0-a84c5468df51",
"status": {
"message": "",
"code": 200,
"attributes": {
"@type": "g:Map",
"@value": []
}
},
"result": {
"data": {
"@type": "g:List",
"@value": [
{
"@type": "g:Edge",
"@value": {
"id": {
"@type": "janusgraph:RelationIdentifier",
"@value": {
"relationId": "w35u-j85s-2fpx-a0bk"
}
},
"label": "subClassOf",
"inVLabel": "class",
"outVLabel": "class",
"inV": {
"@type": "g:Int64",
"@value": 466976
},
"outV": {
"@type": "g:Int64",
"@value": 897040
},
"properties": {
"relationship": {
"@type": "g:Property",
"@value": {
"key": "relationship",
"value": "Performed on"
}
},
"ontologyId": {
"@type": "g:Property",
"@value": {
"key": "ontologyId",
"value": {
"@type": "g:Int32",
"@value": 48
}
}
},
"targetVertexKey": {
"@type": "g:Property",
"@value": {
"key": "targetVertexKey",
"value": "http://webprotege.stanford.edu/R9H3QGGtwC0XhV4Mfk6Ceep_48"
}
},
"sourceVertexKey": {
"@type": "g:Property",
"@value": {
"key": "sourceVertexKey",
"value": "http://webprotege.stanford.edu/R734t4iI6j8MPmpJsIqO2v4_48"
}
},
"sourceVertexId": {
"@type": "g:Property",
"@value": {
"key": "sourceVertexId",
"value": {
"@type": "g:Int64",
"@value": 33752713048
}
}
},
"latestWebhookEventId": {
"@type": "g:Property",
"@value": {
"key": "latestWebhookEventId",
"value": {
"@type": "g:Int64",
"@value": 60
}
}
},
"targetVertexId": {
"@type": "g:Property",
"@value": {
"key": "targetVertexId",
"value": {
"@type": "g:Int64",
"@value": 242612863048
}
}
}
}
}
},
{
"@type": "g:Edge",
"@value": {
"id": {
"@type": "janusgraph:RelationIdentifier",
"@value": {
"relationId": "w2rm-j85s-2fpx-er4g"
}
},
"label": "subClassOf",
"inVLabel": "class",
"outVLabel": "class",
"inV": {
"@type": "g:Int64",
"@value": 688336
},
"outV": {
"@type": "g:Int64",
"@value": 897040
},
"properties": {
"sourceVertexId": {
"@type": "g:Property",
"@value": {
"key": "sourceVertexId",
"value": {
"@type": "g:Int64",
"@value": 33752713048
}
}
},
"sourceVertexKey": {
"@type": "g:Property",
"@value": {
"key": "sourceVertexKey",
"value": "http://webprotege.stanford.edu/R734t4iI6j8MPmpJsIqO2v4_48"
}
},
"relationship": {
"@type": "g:Property",
"@value": {
"key": "relationship",
"value": "Performed by"
}
},
"ontologyId": {
"@type": "g:Property",
"@value": {
"key": "ontologyId",
"value": {
"@type": "g:Int32",
"@value": 48
}
}
},
"targetVertexId": {
"@type": "g:Property",
"@value": {
"key": "targetVertexId",
"value": {
"@type": "g:Int64",
"@value": 2042871575048
}
}
},
"targetVertexKey": {
"@type": "g:Property",
"@value": {
"key": "targetVertexKey",
"value": "http://webprotege.stanford.edu/R8QQzkUbCD5WRXDQQSl0vX8_48"
}
},
"latestWebhookEventId": {
"@type": "g:Property",
"@value": {
"key": "latestWebhookEventId",
"value": {
"@type": "g:Int64",
"@value": 60
}
}
}
}
}
},
{
"@type": "g:Edge",
"@value": {
"id": {
"@type": "janusgraph:RelationIdentifier",
"@value": {
"relationId": "w2de-j85s-2fpx-iviw"
}
},
"label": "subClassOf",
"inVLabel": "class",
"outVLabel": "class",
"inV": {
"@type": "g:Int64",
"@value": 880664
},
"outV": {
"@type": "g:Int64",
"@value": 897040
},
"properties": {
"ontologyId": {
"@type": "g:Property",
"@value": {
"key": "ontologyId",
"value": {
"@type": "g:Int32",
"@value": 48
}
}
},
"relationship": {
"@type": "g:Property",
"@value": {
"key": "relationship",
"value": "Affected by"
}
},
"sourceVertexKey": {
"@type": "g:Property",
"@value": {
"key": "sourceVertexKey",
"value": "http://webprotege.stanford.edu/R734t4iI6j8MPmpJsIqO2v4_48"
}
},
"latestWebhookEventId": {
"@type": "g:Property",
"@value": {
"key": "latestWebhookEventId",
"value": {
"@type": "g:Int64",
"@value": 60
}
}
},
"targetVertexKey": {
"@type": "g:Property",
"@value": {
"key": "targetVertexKey",
"value": "http://webprotege.stanford.edu/R7OG9IJQRmrxb2LhojDfE46_48"
}
},
"targetVertexId": {
"@type": "g:Property",
"@value": {
"key": "targetVertexId",
"value": {
"@type": "g:Int64",
"@value": 1257106500048
}
}
},
"sourceVertexId": {
"@type": "g:Property",
"@value": {
"key": "sourceVertexId",
"value": {
"@type": "g:Int64",
"@value": 33752713048
}
}
}
}
}
},
...
]
},
"meta": {
"@type": "g:Map",
"@value": []
}
}
}

5. Get Edges - Get vertex incoming edges (sub-classes of this parent class)

Example Request
{
"gremlin": "g.V().has('iri', 'http://webprotege.stanford.edu/R734t4iI6j8MPmpJsIqO2v4').inE()"
}
Response HTTP 200 OK
{
"requestId": "b27b1c1e-a19e-4b80-96fe-290b7fba3a60",
"status": {
"message": "",
"code": 200,
"attributes": {
"@type": "g:Map",
"@value": []
}
},
"result": {
"data": {
"@type": "g:List",
"@value": [
{
"@type": "g:Edge",
"@value": {
"id": {
"@type": "janusgraph:RelationIdentifier",
"@value": {
"relationId": "g4ck-9hcw-2fpx-j85s"
}
},
"label": "subClassOf",
"inVLabel": "class",
"outVLabel": "class",
"inV": {
"@type": "g:Int64",
"@value": 897040
},
"outV": {
"@type": "g:Int64",
"@value": 442400
},
"properties": {
"ontologyId": {
"@type": "g:Property",
"@value": {
"key": "ontologyId",
"value": {
"@type": "g:Int32",
"@value": 48
}
}
},
"sourceVertexKey": {
"@type": "g:Property",
"@value": {
"key": "sourceVertexKey",
"value": "http://webprotege.stanford.edu/R89hr3L0oNOwO2C6z1V7rPS_48"
}
},
"targetVertexKey": {
"@type": "g:Property",
"@value": {
"key": "targetVertexKey",
"value": "http://webprotege.stanford.edu/R734t4iI6j8MPmpJsIqO2v4_48"
}
},
"relationship": {
"@type": "g:Property",
"@value": {
"key": "relationship",
"value": "Used in"
}
},
"latestWebhookEventId": {
"@type": "g:Property",
"@value": {
"key": "latestWebhookEventId",
"value": {
"@type": "g:Int64",
"@value": 60
}
}
},
"sourceVertexId": {
"@type": "g:Property",
"@value": {
"key": "sourceVertexId",
"value": {
"@type": "g:Int64",
"@value": 1978975783048
}
}
},
"targetVertexId": {
"@type": "g:Property",
"@value": {
"key": "targetVertexId",
"value": {
"@type": "g:Int64",
"@value": 33752713048
}
}
}
}
}
},
{
"@type": "g:Edge",
"@value": {
"id": {
"@type": "janusgraph:RelationIdentifier",
"@value": {
"relationId": "pmhm-gy4w-2fpx-j85s"
}
},
"label": "subClassOf",
"inVLabel": "class",
"outVLabel": "class",
"inV": {
"@type": "g:Int64",
"@value": 897040
},
"outV": {
"@type": "g:Int64",
"@value": 790736
},
"properties": {
"sourceVertexKey": {
"@type": "g:Property",
"@value": {
"key": "sourceVertexKey",
"value": "http://webprotege.stanford.edu/RDJpPq1h6rGjSoshUKgfI92_48"
}
},
"latestWebhookEventId": {
"@type": "g:Property",
"@value": {
"key": "latestWebhookEventId",
"value": {
"@type": "g:Int64",
"@value": 60
}
}
},
"relationship": {
"@type": "g:Property",
"@value": {
"key": "relationship",
"value": "Used in"
}
},
"targetVertexKey": {
"@type": "g:Property",
"@value": {
"key": "targetVertexKey",
"value": "http://webprotege.stanford.edu/R734t4iI6j8MPmpJsIqO2v4_48"
}
},
"sourceVertexId": {
"@type": "g:Property",
"@value": {
"key": "sourceVertexId",
"value": {
"@type": "g:Int64",
"@value": 1660895008048
}
}
},
"ontologyId": {
"@type": "g:Property",
"@value": {
"key": "ontologyId",
"value": {
"@type": "g:Int32",
"@value": 48
}
}
},
"targetVertexId": {
"@type": "g:Property",
"@value": {
"key": "targetVertexId",
"value": {
"@type": "g:Int64",
"@value": 33752713048
}
}
}
}
}
},
{
"@type": "g:Edge",
"@value": {
"id": {
"@type": "janusgraph:RelationIdentifier",
"@value": {
"relationId": "wc8z-kw7s-2fpx-j85s"
}
},
"label": "subClassOf",
"inVLabel": "class",
"outVLabel": "class",
"inV": {
"@type": "g:Int64",
"@value": 897040
},
"outV": {
"@type": "g:Int64",
"@value": 974872
},
"properties": {
"relationship": {
"@type": "g:Property",
"@value": {
"key": "relationship",
"value": "Improved through"
}
},
"latestWebhookEventId": {
"@type": "g:Property",
"@value": {
"key": "latestWebhookEventId",
"value": {
"@type": "g:Int64",
"@value": 60
}
}
},
"ontologyId": {
"@type": "g:Property",
"@value": {
"key": "ontologyId",
"value": {
"@type": "g:Int32",
"@value": 48
}
}
},
"targetVertexId": {
"@type": "g:Property",
"@value": {
"key": "targetVertexId",
"value": {
"@type": "g:Int64",
"@value": 33752713048
}
}
},
"sourceVertexKey": {
"@type": "g:Property",
"@value": {
"key": "sourceVertexKey",
"value": "http://webprotege.stanford.edu/RBNRwyHYDJAexW4IAn1ebkS_48"
}
},
"targetVertexKey": {
"@type": "g:Property",
"@value": {
"key": "targetVertexKey",
"value": "http://webprotege.stanford.edu/R734t4iI6j8MPmpJsIqO2v4_48"
}
},
"sourceVertexId": {
"@type": "g:Property",
"@value": {
"key": "sourceVertexId",
"value": {
"@type": "g:Int64",
"@value": 195852279048
}
}
}
}
}
},
...
]
},
"meta": {
"@type": "g:Map",
"@value": []
}
}
}

6. Get Edges - Get all vertex edges (incoming and outgoing)

Example Request
{
"gremlin": "g.V().has('iri', 'http://webprotege.stanford.edu/R734t4iI6j8MPmpJsIqO2v4').bothE()"
}
Response HTTP 200 OK
{
"requestId": "c52c020c-e2b0-4dae-8447-072ae771bbea",
"status": {
"message": "",
"code": 200,
"attributes": {
"@type": "g:Map",
"@value": []
}
},
"result": {
"data": {
"@type": "g:List",
"@value": [
{
"@type": "g:Edge",
"@value": {
"id": {
"@type": "janusgraph:RelationIdentifier",
"@value": {
"relationId": "w35u-j85s-2fpx-a0bk"
}
},
"label": "subClassOf",
"inVLabel": "class",
"outVLabel": "class",
"inV": {
"@type": "g:Int64",
"@value": 466976
},
"outV": {
"@type": "g:Int64",
"@value": 897040
},
"properties": {
"latestWebhookEventId": {
"@type": "g:Property",
"@value": {
"key": "latestWebhookEventId",
"value": {
"@type": "g:Int64",
"@value": 60
}
}
},
"sourceVertexId": {
"@type": "g:Property",
"@value": {
"key": "sourceVertexId",
"value": {
"@type": "g:Int64",
"@value": 33752713048
}
}
},
"ontologyId": {
"@type": "g:Property",
"@value": {
"key": "ontologyId",
"value": {
"@type": "g:Int32",
"@value": 48
}
}
},
"targetVertexKey": {
"@type": "g:Property",
"@value": {
"key": "targetVertexKey",
"value": "http://webprotege.stanford.edu/R9H3QGGtwC0XhV4Mfk6Ceep_48"
}
},
"sourceVertexKey": {
"@type": "g:Property",
"@value": {
"key": "sourceVertexKey",
"value": "http://webprotege.stanford.edu/R734t4iI6j8MPmpJsIqO2v4_48"
}
},
"targetVertexId": {
"@type": "g:Property",
"@value": {
"key": "targetVertexId",
"value": {
"@type": "g:Int64",
"@value": 242612863048
}
}
},
"relationship": {
"@type": "g:Property",
"@value": {
"key": "relationship",
"value": "Performed on"
}
}
}
}
},
{
"@type": "g:Edge",
"@value": {
"id": {
"@type": "janusgraph:RelationIdentifier",
"@value": {
"relationId": "w2rm-j85s-2fpx-er4g"
}
},
"label": "subClassOf",
"inVLabel": "class",
"outVLabel": "class",
"inV": {
"@type": "g:Int64",
"@value": 688336
},
"outV": {
"@type": "g:Int64",
"@value": 897040
},
"properties": {
"ontologyId": {
"@type": "g:Property",
"@value": {
"key": "ontologyId",
"value": {
"@type": "g:Int32",
"@value": 48
}
}
},
"sourceVertexKey": {
"@type": "g:Property",
"@value": {
"key": "sourceVertexKey",
"value": "http://webprotege.stanford.edu/R734t4iI6j8MPmpJsIqO2v4_48"
}
},
"latestWebhookEventId": {
"@type": "g:Property",
"@value": {
"key": "latestWebhookEventId",
"value": {
"@type": "g:Int64",
"@value": 60
}
}
},
"sourceVertexId": {
"@type": "g:Property",
"@value": {
"key": "sourceVertexId",
"value": {
"@type": "g:Int64",
"@value": 33752713048
}
}
},
"targetVertexKey": {
"@type": "g:Property",
"@value": {
"key": "targetVertexKey",
"value": "http://webprotege.stanford.edu/R8QQzkUbCD5WRXDQQSl0vX8_48"
}
},
"relationship": {
"@type": "g:Property",
"@value": {
"key": "relationship",
"value": "Performed by"
}
},
"targetVertexId": {
"@type": "g:Property",
"@value": {
"key": "targetVertexId",
"value": {
"@type": "g:Int64",
"@value": 2042871575048
}
}
}
}
}
},
{
"@type": "g:Edge",
"@value": {
"id": {
"@type": "janusgraph:RelationIdentifier",
"@value": {
"relationId": "w2de-j85s-2fpx-iviw"
}
},
"label": "subClassOf",
"inVLabel": "class",
"outVLabel": "class",
"inV": {
"@type": "g:Int64",
"@value": 880664
},
"outV": {
"@type": "g:Int64",
"@value": 897040
},
"properties": {
"sourceVertexKey": {
"@type": "g:Property",
"@value": {
"key": "sourceVertexKey",
"value": "http://webprotege.stanford.edu/R734t4iI6j8MPmpJsIqO2v4_48"
}
},
"latestWebhookEventId": {
"@type": "g:Property",
"@value": {
"key": "latestWebhookEventId",
"value": {
"@type": "g:Int64",
"@value": 60
}
}
},
"sourceVertexId": {
"@type": "g:Property",
"@value": {
"key": "sourceVertexId",
"value": {
"@type": "g:Int64",
"@value": 33752713048
}
}
},
"relationship": {
"@type": "g:Property",
"@value": {
"key": "relationship",
"value": "Affected by"
}
},
"targetVertexKey": {
"@type": "g:Property",
"@value": {
"key": "targetVertexKey",
"value": "http://webprotege.stanford.edu/R7OG9IJQRmrxb2LhojDfE46_48"
}
},
"ontologyId": {
"@type": "g:Property",
"@value": {
"key": "ontologyId",
"value": {
"@type": "g:Int32",
"@value": 48
}
}
},
"targetVertexId": {
"@type": "g:Property",
"@value": {
"key": "targetVertexId",
"value": {
"@type": "g:Int64",
"@value": 1257106500048
}
}
}
}
}
},
...
]
},
"meta": {
"@type": "g:Map",
"@value": []
}
}
}

7. Shortest Path - Get the shortest path between two vertices (classes)

Example Request
{
"gremlin": "g.V(897040).repeat(out().simplePath()).until(hasId(1032216)).path().limit(1)"
}
Response HTTP 200 OK
"requestId": "d088a014-0c6d-479f-8d55-0b3dfad12d7b",
"status": {
"message": "",
"code": 200,
"attributes": {
"@type": "g:Map",
"@value": []
}
},
"result": {
"data": {
"@type": "g:List",
"@value": [
{
"@type": "g:Path",
"@value": {
"objects": {
"@type": "g:List",
"@value": [
{
"@type": "g:Vertex",
"@value": {
"id": {
"@type": "g:Int64",
"@value": 897040
},
"label": "class"
}
},
{
"@type": "g:Vertex",
"@value": {
"id": {
"@type": "g:Int64",
"@value": 466976
},
"label": "class"
}
},
{
"@type": "g:Vertex",
"@value": {
"id": {
"@type": "g:Int64",
"@value": 1024024
},
"label": "class"
}
},
{
"@type": "g:Vertex",
"@value": {
"id": {
"@type": "g:Int64",
"@value": 1032216
},
"label": "class"
}
}
]
}
}
}
]
},
"meta": {
"@type": "g:Map",
"@value": []
}
}
}

8. Shortest Path - Get the length of the shortest path between two vertices (classes)

Example Request
{
"gremlin": "g.V(897040).repeat(out().simplePath()).until(hasId(1032216)).path().count(local).limit(1)"
}
Response HTTP 200 OK
{
"requestId": "bf510ec1-2981-48e4-8133-b77985beed02",
"status": {
"message": "",
"code": 200,
"attributes": {
"@type": "g:Map",
"@value": []
}
},
"result": {
"data": {
"@type": "g:List",
"@value": [
{
"@type": "g:Int64",
"@value": 4
}
]
},
"meta": {
"@type": "g:Map",
"@value": []
}
}
}
For further Gremlin query traversal examples, please visit Gremlin Recipes. And for further extensive details on the Apache TinkerPop framework, including all possible Gremlin graph traversal steps, please visit the Apache TinkerPop reference documentation.

2. Get Graph

Overview