import GraphApplyEditsResult from "@arcgis/core/rest/knowledgeGraph/GraphApplyEditsResult.js";const GraphApplyEditsResult = await $arcgis.import("@arcgis/core/rest/knowledgeGraph/GraphApplyEditsResult.js");- Inheritance:
- GraphApplyEditsResult→
Accessor
- Since
- ArcGIS Maps SDK for JavaScript 4.25
The result of an executeApplyEdits() performed on a knowledge graph service's graph resource. Summarizes the edits to the graph and provides any errors encountered in performing the edits.
- See also
Examples
// sample executeApplyEdits() to add a new entityconst newEntity = new Entity({ typeName: "Supplier", properties: { Name: "Supplier 5", EmployeeCount: 681 }})
KnowledgeGraphModule.executeApplyEdits(graph, { entityAdds: [newEntity],}).then((editResult) => { console.log("Graph Add Result", editResult);});// Results of adding one entity to the `Supplier` entity type{ editResults:[{ adds:[ { id: "{AN4E4G85-41F1-49A4-8412-CACCC9906E88}", error: {errorCode: 0, errorMessage: ""} }], deletes:[], typeName: "Supplier", updates:[] }], hasError: false, error: undefined}// example results of a complex executeApplyEdits that involved// adding, updating and deleting multiple types.{ editResults:[{ adds:[ { id: "{AN4E4G85-41F1-49A4-8412-CACCC9906E88}", error: {errorCode: 0, errorMessage: ""} }], deletes:[], typeName: "Supplier", updates:[] },{ adds:[{ id: "{ANWIFHSAS-AW6F-G9W4-8412-A1A8W4F1A5S6F}", error: {errorCode: 0, errorMessage: ""} }], deletes:[{ id: "{AN4E4G85-Q15F4-49A4-8412-A1W8F4S6A5S4}", error: {errorCode: 0, errorMessage: ""} },{ id: "{AF15W4F8S-A1W5-A1W8F-G1E8-AF1W5F4S8F4W}", error: {errorCode: 0, errorMessage: ""} }], typeName: "Part", updates:[{ id: "{2WS8F4SA-41F1-S1E8-8412-F2G5S4D8GE1S}", error: {errorCode: 0, errorMessage: ""} }] }], hasError: false, error: undefined}// example of an error message due to misspelled entity type{ editResults:[], hasError: true, error: { errorCode: 112020, errorMessage: "The Entity/Relationship type definition, Suppplier, was not found." }}Constructors
Constructor
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| properties | | |
Properties
| Property | Type | Class |
|---|---|---|
| | ||
| | ||
declaredClass readonly inherited | ||
| | ||
| | ||
| |
cascadeProvenanceDeleteResults
Returns a list of the Provenance entities that were deleted as a result of the executeApplyEdits()
call with the cascadeProvenanceDeletes option enabled.
If hasError is true, cascadeProvenanceDeletes will be empty.
Example
cascadeProvenanceDeleteResults:[{ id: "{FB74F4DD-CBD7-4C94-BA89-0C044ECCC273}", error: {errorCode: 0, errorMessage: ""} }] cascadeRelationshipDeleteResults
Returns a list of objects for each relationship type
that was deleted by as a result of deleting its origin or destination entity during an executeApplyEdits()
call with the cascadeDeletes option enabled.
If hasError is true, cascadeRelationshipDeletes will be empty.
Example
cascadeRelationshipDeleteResults:[{ typeName: "supplies", cascadeRelationshipDeletes: [ { id: "{FB74F4DD-CBD7-4C94-BA89-0C044ECCC273}", error: {errorCode: 0, errorMessage: ""} originId: "{AN4E4G85-41F1-49A4-8412-CACCC9906E88}", destinationId: "{2WS8F4SA-41F1-S1E8-8412-F2G5S4D8GE1S}" } ] }] editResults
- Type
- Array<EditResultsObject>
Returns a list of objects for each entity type or relationship type that added, updated or deleted records by executeApplyEdits().
If hasError is true, editResults will be empty.
Example
editResults:[{ adds:[ { id: "{AN4E4G85-41F1-49A4-8412-CACCC9906E88}", error: {errorCode: 0, errorMessage: ""} }], deletes:[], typeName: "Supplier", updates:[] },{ adds:[{ id: "{ANWIFHSAS-AW6F-G9W4-8412-A1A8W4F1A5S6F}", error: {errorCode: 0, errorMessage: ""} }], deletes:[{ id: "{AN4E4G85-Q15F4-49A4-8412-A1W8F4S6A5S4}", error: {errorCode: 0, errorMessage: ""} },{ id: "{AF15W4F8S-A1W5-A1W8F-G1E8-AF1W5F4S8F4W}", error: {errorCode: 0, errorMessage: ""} }], typeName: "Part", updates:[{ id: "{2WS8F4SA-41F1-S1E8-8412-F2G5S4D8GE1S}", error: {errorCode: 0, errorMessage: ""} }]}], error
The error message explaining information about why executeApplyEdits() failed.
Will only be defined if hasError is true.
Example
// example of an error message due to misspelled entity type{ editResults:[], hasError: false, error: { errorCode: 112020, errorMessage: "The Entity/Relationship type definition, Suppplier, was not found." }} hasError
- Type
- boolean
If true there was an error processing executeApplyEdits().
The error message is captured in the error property.
- Default value
- false
Type definitions
EditResultsObject
EditResultsObject returns a list of all entities and relationships of each type that was added, updated or deleted from the KnowledgeGraph as well as any errors that occurred during the operation.
typeName
- Type
- string
The name of the EntityType or RelationshipType that had changed items.
adds
- Type
- Array<NamedObjectEditResults>
A list of objects containing the id and error information for every added entity or relationship.
updates
- Type
- Array<NamedObjectEditResults>
A list of objects containing the id and error information for every updated entity or relationship.
deletes
- Type
- Array<NamedObjectEditResults>
A list of objects containing the id and error information for every deleted entity or relationship.
Example
{ adds:[{ id: "{ANWIFHSAS-AW6F-G9W4-8412-A1A8W4F1A5S6F}", error: {errorCode: 0, errorMessage: ""} }], deletes:[{ id: "{AN4E4G85-Q15F4-49A4-8412-A1W8F4S6A5S4}", error: {errorCode: 0, errorMessage: ""} },{ id: "{AF15W4F8S-A1W5-A1W8F-G1E8-AF1W5F4S8F4W}", error: {errorCode: 0, errorMessage: ""} }], typeName: "Part", updates:[{ id: "{2WS8F4SA-41F1-S1E8-8412-F2G5S4D8GE1S}", error: {errorCode: 0, errorMessage: ""} }]} NamedObjectEditResults
NamedObjectEditResults contains the id of the GraphNamedObject
(Entity or Relationship) that
was added, updated or deleted from the KnowledgeGraph as well as any errors that occurred during the operation.
id
- Type
- string
The id of the Entity or Relationship that was added, updated or deleted from the knowledge graph.
Example
// typical structure{ id: "{2WS8F4SA-41F1-S1E8-8412-F2G5S4D8GE1S}", //id of entity or relationship added, updated or deleted error: {errorCode: 0, errorMessage: ""}} CascadeRelationshipDeleteResults
cascadeRelationshipDeletesResults returns a list of all relationships of each type that were deleted from the KnowledgeGraph due to one of their endpoints being deleted, as well as any errors that occurred during the operation.
Example
{ typeName: "supplies", cascadeRelationshipDeletes: [ { id: "{FB74F4DD-CBD7-4C94-BA89-0C044ECCC273}", error: {errorCode: 0, errorMessage: ""} originId: "{AN4E4G85-41F1-49A4-8412-CACCC9906E88}", destinationId: "{2WS8F4SA-41F1-S1E8-8412-F2G5S4D8GE1S}" } ]} NamedObjectCascadeRelationshipDeleteResults
NamedObjectCascadeRelationshipDeleteResults contains the id of the Relationship that
was deleted from the KnowledgeGraph along with its origin id, destination id and error information.
- Supertypes
- NamedObjectEditResults
Example
// typical structure{ id: "{FB74F4DD-CBD7-4C94-BA89-0C044ECCC273}", error: {errorCode: 0, errorMessage: ""} originId: "{AN4E4G85-41F1-49A4-8412-CACCC9906E88}", destinationId: "{2WS8F4SA-41F1-S1E8-8412-F2G5S4D8GE1S}"} CascadeProvenanceDeleteResults
CascadeProvenanceDeleteResults contains the id of the Provenance GraphNamedObject
that was deleted from the KnowledgeGraph as well as any errors that occurred during the operation,
when edits were applied with cascadeProvenanceDelete set to true.
Example
// typical structure{ id: "{2WS8F4SA-41F1-S1E8-8412-F2G5S4D8GE1S}", //id of Provenance entity deleted error: {errorCode: 0, errorMessage: ""}}