import GraphProperty from "@arcgis/core/rest/knowledgeGraph/GraphProperty.js";const GraphProperty = await $arcgis.import("@arcgis/core/rest/knowledgeGraph/GraphProperty.js");- Inheritance:
- GraphProperty→
Accessor
- 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
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| properties | | |
Properties
| Property | Type | Class |
|---|---|---|
| | ||
declaredClass readonly inherited | ||
| | ||
| | ||
| | ||
| | ||
| | ||
| | ||
| | ||
| | ||
| | ||
| | ||
| | ||
| | ||
| |
defaultVisibility
- Type
- boolean
Specifies whether the property is visible by default.
- Default value
- true
fieldType
- 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
- Type
- EsriGeometryType | null | undefined
Specifies the geometry type for the property. Will not be present if property is not of type geometry.
role
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 } ]}Methods
fromJSON
- Signature
-
fromJSON (json: any): any
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
| Parameter | Type | Description | Required |
|---|---|---|---|
| json | 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
- Signature
-
toJSON (): any
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.