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

Specifies the properties for entity types and relationship types defined in the graph schema by the data model. Each instance of a specified graph object type will include these properties.

Examples
//The `EntityType` 'person' may have the following properties.
[{
name: "first_name"
alias: "First Name",
defaultValue: null,
defaultVisibility: true,
editable: true,
fieldType: "esriFieldTypeString",
geometryType: "esriGeometryNull",
hasM: false,
hasZ: false,
nullable: true,
required: false,
searchable: false,
systemMaintained: false
},
{
name: "age",
alias: "Age",
defaultValue: null,
defaultVisibility: true,
editable: true,
fieldType: "esriFieldTypeNumber",
geometryType: "esriGeometryNull",
hasM: false,
hasZ: false,
nullable: false,
required: false,
searchable: true,
systemMaintained: false
}]
//example of a RelationshipType definition including properties.
{
"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": "esriFieldTypeString",
"geometryType": "esriGeometryNull",
"hasM": false,
"hasZ": false,
"nullable": false,
"editable": true,
"required": true,
"defaultVisibility": true,
"systemMaintained": false,
"role": "esriGraphPropertyRegular",
"defaultValue": null
}]
}

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.

alias

Property
Type
string | null | undefined

The display name for the property.

declaredClass

readonlyinherited Property
Type
string
Inherited from: Accessor

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

defaultValue

Property
Type
unknown | null

Specifies a default value for the object type.

defaultVisibility

Property
Type
boolean

Specifies whether the property is visible by default.

Default value
true

domain

Property
Type
string | null | undefined

The name of the domain for values of this property, if applicable

editable

Property
Type
boolean

Specifies whether the property is editable.

Default value
true

fieldType

Property
Type
EsriFieldType

Specifies the field type for the property.

Example
// possible field types
"esriFieldTypeSmallInteger"
"esriFieldTypeInteger"
"esriFieldTypeSingle"
"esriFieldTypeDouble"
"esriFieldTypeLong"
"esriFieldTypeString"
"esriFieldTypeDate"
"esriFieldTypeOID"
"esriFieldTypeGeometry"
"esriFieldTypeBlob"
"esriFieldTypeRaster"
"esriFieldTypeGUID"
"esriFieldTypeGlobalID"
"esriFieldTypeXML"
"esriFieldTypeBigInteger"
"esriFieldTypeTimestampOffset"
"esriFieldTypeTimeOnly"
"esriFieldTypeDateOnly"

geometryType

Property
Type
EsriGeometryType | null | undefined

Specifies the geometry type for the property. Will not be present if property is not of type geometry.

hasM

Property
Type
boolean | null | undefined

Specifies whether the property has an m-value. This only applies if the property is of type geometry.

hasZ

Property
Type
boolean | null | undefined

Specifies whether property has a z-value. This only applies if the property is of type geometry.

name

Property
Type
string

The name of the property.

nullable

Property
Type
boolean | null | undefined

Specifies whether the property can be null.

Default value
true

required

Property
Type
boolean

Specifies whether the property is required.

Default value
false

role

Property
Type
EsriGraphPropertyRoles

Specifies the role of the property. Entity types with the GraphObjectType.role document have properties with specific roles.

Default value
"esriGraphPropertyUNSPECIFIED"
Example
{
"declaredClass": "esri.rest.knowledgeGraph.EntityType",
"name": "documents",
"alias": "Documents",
"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": "esriGraphPropertyDocumentName",
"defaultValue": null
},
{
"declaredClass": "esri.rest.knowledgeGraph.GraphProperty",
"name": "text",
"alias": "text",
"fieldType": "esriFieldTypeString",d
"geometryType": "esriGeometryNull",
"hasM": false,
"hasZ": false,
"nullable": false,
"editable": false,
"required": true,
"defaultVisibility": true,
"systemMaintained": true,
"role": "esriGraphPropertyDocumentText",
"defaultValue": null
}
]
}

systemMaintained

Property
Type
boolean | null | undefined

Specifies if the property is system maintained.

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.