Skip to content
import DataModel from "@arcgis/core/rest/knowledgeGraph/DataModel.js";
Inheritance:
DataModelAccessor
Since
ArcGIS Maps SDK for JavaScript 4.25

The data model defines the entity types and relationship types in a knowledge graph service as well as some additional settings. The DataModel resource allows users to query the properties of both entity and relationship types. By defining these types and their properties, the data model defines the schema of the graph.

Sample of a knowledge graph data model.

{
"dataModel": {
"declaredClass": "esri.rest.knowledgeGraph.DataModel",
"arcgisManaged": true,
"globalIdField": "globalid",
"identifierInfo": {
"IdentifierMappingInfo": {
"databaseNativeIdentifier": null,
"identifierInfoType": "esriIdentifierInfoTypeUniformProperty",
"uniformPropertyIdentifier": {
"identifierPropertyName": "globalid"
}
},
"identifierGenerationInfo": {
"uuidMethodHint": "esriUUIDESRI"
}
},
"timestamp": {},
"spatialReference": {
"latestWkid": 0,
"wkid": 4326,
"vcsWkid": 0,
"latestVcsWkid": 0
},
"strict": false,
"searchIndexes:": [
{
"analyzers": [
{
"name": "text_en"
}
],
"name": "esri__search_idx",
"searchProperties": [
{
"key": "Person",
"value": {
"propertyNames": [
"name",
"age"
]
}
}
],
"supportedCategory": null
}
],
"entityTypes": [
{
"declaredClass": "esri.rest.knowledgeGraph.EntityType",
"name": "company",
"alias": "Company",
"role": "Regular",
"strict": false,
"properties": [
{
"declaredClass": "esri.rest.knowledgeGraph.GraphProperty",
"name": "Name",
"alias": "Name",
"fieldType": "esriFieldTypeString",
"geometryType": "esriGeometryNull",
"hasM": false,
"hasZ": false,
"nullable": true,
"editable": true,
"required": false,
"defaultVisibility": true,
"systemMaintained": false,
"role": "esriGraphPropertyRegular",
"defaultValue": null
},
{
"declaredClass": "esri.rest.knowledgeGraph.GraphProperty",
"name": "id",
"alias": "id",
"fieldType": "esriFieldTypeOID",
"geometryType": "esriGeometryNull",
"hasM": false,
"hasZ": false,
"nullable": false,
"editable": false,
"required": true,
"defaultVisibility": true,
"systemMaintained": true,
"role": "esriGraphPropertyRegular",
"defaultValue": null
}
],
"fieldIndexes": [
{
"declaredClass": "esri.rest.knowledgeGraph.FieldIndex",
"name": "esri__id_idx",
"unique": true,
"ascending": true,
"description": "",
"fieldNames": [
"id"
]
},
{
"declaredClass": "esri.rest.knowledgeGraph.FieldIndex",
"name": "esri__name_idx",
"unique": true,
"ascending": true,
"description": "",
"fieldNames": [
"name"
]
}
]
}
],
"relationshipTypes": [
{
"declaredClass": "esri.rest.knowledgeGraph.RelationshipType",
"name": "employed_by",
"alias": "Employed By",
"role": "Regular",
"strict": false,
"properties": [
{
"declaredClass": "esri.rest.knowledgeGraph.GraphProperty",
"name": "id",
"alias": "id",
"fieldType": "esriFieldTypeGUID",
"geometryType": "esriGeometryNull",
"hasM": false,
"hasZ": false,
"nullable": false,
"editable": false,
"required": true,
"defaultVisibility": true,
"systemMaintained": true,
"role": "esriGraphPropertyRegular",
"defaultValue": null
},
{
"declaredClass": "esri.rest.knowledgeGraph.GraphProperty",
"name": "start_date",
"alias": "Start Date",
"fieldType": "esriFieldTypeDate",
"geometryType": "esriGeometryNull",
"hasM": false,
"hasZ": false,
"nullable": false,
"editable": false,
"required": true,
"defaultVisibility": true,
"systemMaintained": false,
"role": "esriGraphPropertyRegular",
"defaultValue": null
}
],
"fieldIndexes": [
{
"ascending": true,
"description": "index on id field",
"fieldNames": [
"id"
],
"name": "esri_id_idx",
"unique": "true"
}
],
"endpoints": [
{
"originEntityType": "Person",
"destinationEntityType": "Company"
}
]
}
]
}
}
See also

Constructors

Constructor

Constructor
Parameters
ParameterTypeDescriptionRequired
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.

arcgisManaged

readonly Property
Type
boolean

Indicates if the data in the graph is managed by ArcGIS Knowledge. This is true for hosted knowledge graph services and ArcGIS managed external data stores where ArcGIS Knowledge can create, update and delete data. This property is false for user managed external graph stores, in which the data and data model are read only from ArcGIS Knowledge.

Note

Currently the only supported external graph store is Neo4j

declaredClass

readonlyinherited Property
Type
string
Inherited from: Accessor

The name of the class. The declared class name is formatted as esri.folder.className.

domains

autocast Property
Type
Domain[]

Specifies a default value for the object type.

entityTypes

readonly Property
Type
EntityType[]

A list of the entity types contained in the knowledge graph including their associated properties.

identifierInfo

readonly Property
Type
DataModelIdentifierInfo

Information about the global ID for the knowledge graph.

Example
"identifierInfo": {
"IdentifierMappingInfo": {
"databaseNativeIdentifier": null,
"identifierInfoType": "esriIdentifierInfoTypeUniformProperty",
"uniformPropertyIdentifier": {
"identifierPropertyName": "globalid"
}
},
"identifierGenerationInfo": {
"uuidMethodHint": "esriUUIDESRI"
}
}

metaEntityTypes

readonly Property
Type
EntityType[]
Since
ArcGIS Maps SDK for JavaScript 4.30

A list of the meta entity types in the knowledge graph and their associated properties. metaEntityTypes are types that store information about the records, or specific properties on records in the graph. For example, provenance tracks where information in the knowledge graph originated. Each provenance record associates the value stored in a property of an entity or a relationship with a specific source.

provenanceSourceTypeValues

readonly Property
Type
SourceTypeValueBehavior[]
Since
ArcGIS Maps SDK for JavaScript 4.31

A list of the provenance source type values and their behaviors in the knowledge graph.

relationshipTypes

readonly Property
Type
RelationshipType[]

A list of the relationship types in the knowledge graph including their associated properties.

searchIndexes

readonly Property
Type
SearchIndex[]

List of the search indexes in the knowledge graph.

spatialReference

readonly Property
Type
SpatialReference | null | undefined

Specifies spatial reference information for the knowledge graph.

strict

readonly Property
Type
boolean | null | undefined

Indicates whether users can make changes to the data model. If true, the data model cannot be modified and executeApplyEdits() will fail. If false, any user can make changes to the data model. The strict property of the data model can only be set by administrators or the knowledge graph service owner from the ArcGIS REST API Update (Edit Data Model).

timestamp

readonly Property
Type
Date

The date the data model was last updated.

Methods

MethodSignatureClass
fromJSON
inherited static
fromJSON(json: any): any
toJSON
inherited
toJSON(): any

fromJSON

inheritedstatic Method
Signature
fromJSON (json: any): any
Inherited from: JSONSupportMixin

Creates a new instance of this class and initializes it with values from a JSON object generated from an ArcGIS product. The object passed into the input json parameter often comes from a response to a query operation in the REST API or a toJSON() method from another ArcGIS product. See the Using fromJSON() topic in the Guide for details and examples of when and how to use this function.

Parameters
ParameterTypeDescriptionRequired
json
any

A JSON representation of the instance in the ArcGIS format. See the ArcGIS REST API documentation for examples of the structure of various input JSON objects.

Returns
any

Returns a new instance of this class.

toJSON

inherited Method
Signature
toJSON (): any
Inherited from: JSONSupportMixin

Converts an instance of this class to its ArcGIS portal JSON representation. See the Using fromJSON() guide topic for more information.

Returns
any

The ArcGIS portal JSON representation of an instance of this class.

Type definitions

DataModelIdentifierInfo

Type definition

identifierMappingInfo

Property
Type
DataModelIdentifierInfoIdentifierMappingInfo

Information on the type and format of the universally unique identifier

identifierGenerationInfo

Property
Type
DataModelIdentifierInfoIdentifierGenerationInfo

Information on how the unique identifier is generated.

DataModelIdentifierInfoIdentifierMappingInfo

Type definition

identifierInfoType

Property
Type
EsriIdentifierInfoTypes

Indicates the type of the ID. esriIdentifierInfoTypeDatabaseNative is a durable, settable database native identifier. esriIdentifierInfoTypeUniformProperty is a user-defined property that guarantees named type category uniqueness & is uniformly named across the graph.

databaseNativeIdentifier

Property
Type
{}

Properties of database native identifier.

uniformPropertyIdentifier

Property
Type
DataModelIdentifierInfoIdentifierMappingInfoUniformPropertyIdentifier

Properties of the user defined unique identifier.

DataModelIdentifierInfoIdentifierMappingInfoUniformPropertyIdentifier

Type definition

identifierPropertyName

Property
Type
string

The name of the unique identifier property for all records.

DataModelIdentifierInfoIdentifierGenerationInfo

Type definition

uuidMethodHint

Property
Type
EsriUuidMethodHintType

Information on the format of the unique identifier. esriUUIDESRI is a universally unique ID in Esri/Microsoft format: {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} UUID_RFC_4122 is a universally unique ID in RFC4122 lowercase format.