import GraphQueryResult from "@arcgis/core/rest/knowledgeGraph/GraphQueryResult.js";const GraphQueryResult = await $arcgis.import("@arcgis/core/rest/knowledgeGraph/GraphQueryResult.js");- Inheritance:
- GraphQueryResult→
Accessor
- Since
- ArcGIS Maps SDK for JavaScript 4.25
The results of a executeQuery() or executeSearch() on a knowledge graph service.
- See also
Constructors
Constructor
Constructor
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| properties | | |
See the properties table for a list of all the
properties that may be passed into the constructor.
Properties
Any properties can be set, retrieved or listened to. See the
Watch for changes
topic.
| Property | Type | Class |
|---|---|---|
declaredClass readonly inherited | ||
| |
resultRows
Property
- Type
- Array<GraphAnyValue[]>
An array of the result types that are returned from a search or query. Each item in the resultRows array matches the search or query constraints.
Examples
// Example of GraphQueryResult.resultRows returned from a// `MATCH (n:Supplier)-[r]->(m) RETURN [n.id, n.geometry, n, r, m], {var1: n}`// query on a knowledge graph that contains supply chain informationKnowledgeGraphModule.executeQuery( knowledgeGraph, //graph { //searchArguments openCypherQuery: "MATCH (n:Supplier)-[r]->(m) RETURN [n.id, n.geometry, n, r, m], {var1: n}", }).then((queryResult) => { //do something with the result console.log(queryResult)});//sample result of the above query"resultRows": [ [ //array of result types that meet query criteria [ //single return type that matches query return format. 1111, "Point", { //Supplier Entity "properties": { "Name": "Queen City Steel", }, "typeName": "Supplier", "id": "1111" }, { // 'supplies' relationship between Supplier and Plant "destinationId": "1111", "originId": "1236", "properties": { "material_supplied": "steel" }, "typeName": "supplies", "id": "A268", }, { //destination entity of 'supplies' for supplier 1111 "properties": { "Name": "Sky Manufacturing", }, "typeName": "Plant", "id": "1236" } ], { // anonymous object returned by the `{var1:n}` query parameter "properties": { "var1": { //the entity (n) returned in the var1 object "properties": { "Name": "Queen City Steel", }, "typeName": "Supplier", "id": "1111" } } } ]]