GraphObjectType

AMD: require(["geoscene/rest/knowledgeGraph/GraphObjectType"], (GraphObjectType) => { /* code goes here */ });
ESM: import GraphObjectType from "@geoscene/core/rest/knowledgeGraph/GraphObjectType.js";
类: geoscene/rest/knowledgeGraph/GraphObjectType
继承于:GraphObjectType Accessor
起始版本:GeoScene Maps SDK for JavaScript 4.25
beta

图谱模式中定义的实体类型关系类型的父对象。

另请参阅
示例
//sample structure of an entity type
{
 "declaredClass": "geoscene.rest.knowledgeGraph.EntityType",
 "name": "company",
 "alias": "Company",
 "role": "Regular",
 "strict": false,
 "properties": [
   {
     "declaredClass": "geoscene.rest.knowledgeGraph.GraphProperty",
     "name": "Name",
     "alias": "Name",
     "fieldType": "geosceneFieldTypeString",
     "geometryType": "geosceneGeometryNull",
     "hasM": false,
     "hasZ": false,
     "nullable": true,
     "editable": true,
     "required": false,
     "defaultVisibility": true,
     "systemMaintained": false,
     "role": "geosceneGraphPropertyRegular",
     "defaultValue": null
   },
   {
     "declaredClass": "geoscene.rest.knowledgeGraph.GraphProperty",
     "name": "id",
     "alias": "id",
     "fieldType": "geosceneFieldTypeOID",
     "geometryType": "geosceneGeometryNull",
     "hasM": false,
     "hasZ": false,
     "nullable": false,
     "editable": false,
     "required": true,
     "defaultVisibility": true,
     "systemMaintained": true,
     "role": "geosceneGraphPropertyRegular",
     "defaultValue": null
   }
 ],
 "fieldIndexes": [
   {
     "declaredClass": "geoscene.rest.knowledgeGraph.FieldIndex",
     "name": "geoscene__id_idx",
     "unique": true,
     "ascending": true,
     "description": "",
     "fieldNames": [
       "id"
     ]
   },
   {
     "declaredClass": "geoscene.rest.knowledgeGraph.FieldIndex",
     "name": "geoscene__name_idx",
     "unique": true,
     "ascending": true,
     "description": "",
     "fieldNames": [
       "name"
     ]
   }
 ]
}

构造函数

new GraphObjectType(properties)
参数
properties Object
optional

有关可能传递给构造函数的所有属性的列表,请参见属性

属性概述

所有属性都可以设置、获取和监听。请参阅使用属性主题。
显示继承属性 隐藏继承属性
名称 类型 描述
String

图谱对象类型的显示名称。

更多详情
GraphObjectType
String

类的名称。

更多详情
Accessor
FieldIndex[]

指定图谱对象类型的索引字段

更多详情
GraphObjectType
String

图谱对象类型的名称。

更多详情
GraphObjectType
GraphProperty[]

指定图谱对象类型 (如 EntityTypeRelationshipType) 的属性

更多详情
GraphObjectType
String

对象类型在知识图谱中的角色。

更多详情
GraphObjectType

属性详细信息

alias String

图谱对象类型的显示名称。

declaredClass Stringreadonly inherited

类的名称。声明的类名称格式化为 geoscene.folder.className

fieldIndexes FieldIndex[]

指定图谱对象类型的索引字段knowledgeGraphService.executeSearch() 将包含索引文本和 GUID 字段中的内容。

name String

图谱对象类型的名称。

properties GraphProperty[]

指定图谱对象类型 (如 EntityTypeRelationshipType) 的属性

role String

对象类型在知识图谱中的角色。指定具有其他对象无法使用的功能的对象。例如,文档实体类型具有 'Document’ 的特定角色。默认情况下,Document 实体类型 (以及关联的 HasDocument 关系) 包含在所有知识图谱服务中。

默认值:"Regular"

方法概述

显示继承的方法 隐藏继承的方法
名称 返回值类值 描述

添加一个或多个与对象生命周期相关联的句柄

更多详情
Accessor
*

创建此类的新实例并使用从 GeoScene 产品生成的 JSON 对象值对其进行初始化。

更多详情
GraphObjectType
Boolean

如果存在指定的句柄组,则返回 true。

更多详情
Accessor

移除对象拥有的句柄组。

更多详情
Accessor
Object

将此类的实例转换为其 GeoScene Portal JSON 表示。

更多详情
GraphObjectType

方法详细说明

addHandles(handleOrHandles, groupKey)inherited

添加一个或多个与对象的生命周期相关联的句柄。当对象被销毁时,将移除句柄。

// Manually manage handles
const handle = reactiveUtils.when(
  () => !view.updating,
  () => {
    wkidSelect.disabled = false;
  },
  { once: true }
);

this.addHandles(handle);

// Destroy the object
this.destroy();
参数
handleOrHandles WatchHandle|WatchHandle[]

对象销毁后,标记为要移除的句柄。

groupKey *
optional

标识句柄应添加到的组的键。组中的所有句柄稍后都可使用 Accessor.removeHandles() 进行删除。如果未提供键,则句柄将被添加到默认组。

fromJSON(json){*}static

创建此类的新实例并使用从 GeoScene 产品生成的 JSON 对象值对其进行初始化。传入到输入 json 参数的对象通常来自对 REST API 中查询操作的响应或来自另一个 GeoScene 产品的 toJSON() 方法。

参数
json Object

GeoScene 格式实例的 JSON 表示。

返回
类型 描述
* 返回该类的新实例。
hasHandles(groupKey){Boolean}inherited

如果存在指定的句柄组,则返回 true。

参数
groupKey *
optional

组键。

返回
类型 描述
Boolean 如果存在指定的句柄组,则返回 true
示例
// Remove a named group of handles if they exist.
if (obj.hasHandles("watch-view-updates")) {
  obj.removeHandles("watch-view-updates");
}
removeHandles(groupKey)inherited

移除对象拥有的句柄组。

参数
groupKey *
optional

要移除的组键或组键的数组或集合。

示例
obj.removeHandles(); // removes handles from default group

obj.removeHandles("handle-group");
obj.removeHandles("other-handle-group");
toJSON(){Object}

将此类的实例转换为其 GeoScene Portal JSON 表示。有关详细信息,请参阅使用 fromJSON() 指南主题。

返回
类型 描述
Object 此类实例的 GeoScene Portal JSON 表示。

您的浏览器不再受支持。请升级您的浏览器以获得最佳体验。