数据模型定义了知识图谱服务中的实体类型和关系类型以及一些附加设置。DataModel 资源允许用户查询实体和关系类型的属性。通过定义这些类型及其属性,数据模型定义了图谱的模式。
知识图谱数据模型示例。
{
"dataModel": {
"declaredClass": "geoscene.rest.knowledgeGraph.DataModel",
"arcgisManaged": true,
"globalIdField": "globalid",
"identifierInfo": {
"IdentifierMappingInfo": {
"databaseNativeIdentifier": null,
"identifierInfoType": "geosceneIdentifierInfoTypeUniformProperty",
"uniformPropertyIdentifier": {
"identifierPropertyName": "globalid"
}
},
"identifierGenerationInfo": {
"uuidMethodHint": "geosceneUUIDESRI"
}
},
"timestamp": {},
"spatialReference": {
"latestWkid": 0,
"wkid": 4326,
"vcsWkid": 0,
"latestVcsWkid": 0
},
"strict": false,
"searchIndexes:": [
{
"analyzers": [
{
"name": "text_en"
}
],
"name": "geoscene__search_idx",
"searchProperties": [
{
"key": "Person",
"value": {
"propertyNames": [
"name",
"age"
]
}
}
],
"supportedCategory": null
}
],
"entityTypes": [
{
"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"
]
}
]
}
],
"relationshipTypes": [
{
"declaredClass": "geoscene.rest.knowledgeGraph.RelationshipType",
"name": "employed_by",
"alias": "Employed By",
"role": "Regular",
"strict": false,
"properties": [
{
"declaredClass": "geoscene.rest.knowledgeGraph.GraphProperty",
"name": "id",
"alias": "id",
"fieldType": "geosceneFieldTypeGUID",
"geometryType": "geosceneGeometryNull",
"hasM": false,
"hasZ": false,
"nullable": false,
"editable": false,
"required": true,
"defaultVisibility": true,
"systemMaintained": true,
"role": "geosceneGraphPropertyRegular",
"defaultValue": null
},
{
"declaredClass": "geoscene.rest.knowledgeGraph.GraphProperty",
"name": "start_date",
"alias": "Start Date",
"fieldType": "geosceneFieldTypeDate",
"geometryType": "geosceneGeometryNull",
"hasM": false,
"hasZ": false,
"nullable": false,
"editable": false,
"required": true,
"defaultVisibility": true,
"systemMaintained": false,
"role": "geosceneGraphPropertyRegular",
"defaultValue": null
}
],
"fieldIndexes": [
{
"ascending": true,
"description": "index on id field",
"fieldNames": [
"id"
],
"name": "geoscene_id_idx",
"unique": "true"
}
],
"endpoints": [
{
"originEntityType": "Person",
"destinationEntityType": "Company"
}
]
}
]
}
}
属性概述
名称 | 类型 | 描述 | 类 |
---|---|---|---|
Boolean | 指示图谱中的数据是否由 GeoScene Knowledge 管理。 更多详情 | DataModel | |
String | 类的名称。 更多详情 | Accessor | |
EntityType[] | 包含在知识图谱中的实体类型列表,包括其关联的属性。 更多详情 | DataModel | |
Object | 有关知识图谱的全局 ID 的信息。 更多详情 | DataModel | |
RelationshipType[] | 知识图谱中的关系类型列表,包括其关联的属性。 更多详情 | DataModel | |
SearchIndex[] | 知识图谱中的搜索索引列表。 更多详情 | DataModel | |
SpatialReference | 指定知识图谱的空间参考信息。 更多详情 | DataModel | |
Boolean | 指示用户是否可以更改数据模型。 更多详情 | DataModel | |
Date | 上次更新数据模型的日期。 更多详情 | DataModel |
属性详细信息
-
arcgisManaged Booleanreadonly
-
指示图谱中的数据是否由 GeoScene Knowledge 管理。当为
true
时,适用于托管的知识图谱服务和 GeoScene 管理的外部数据存储,GeoScene Knowledge 可以在这些存储中创建、更新和删除数据。对于用户管理的外部图谱存储,此属性为false
,其中的数据和数据模型仅从 GeoScene Knowledge 中读取。注
目前,唯一支持的外部图谱存储是 Neo4j
-
类的名称。声明的类名称格式化为
geoscene.folder.className
。
-
entityTypes EntityType[]readonly
-
包含在知识图谱中的实体类型列表,包括其关联的属性。
-
identifierInfo Objectreadonly
-
有关知识图谱的全局 ID 的信息。
- 属性
-
identifierMappingInfo Object
关于通用唯一标识符的类型和格式的信息
- 规范
-
identifierInfoType String
指示 ID 的类型。
geosceneIdentifierInfoTypeDatabaseNative
是一个持久的、可设置的数据库本机标识符。geosceneIdentifierInfoTypeUniformProperty
是一个用户定义的属性,它保证了命名类型类别的唯一性,并在整个图谱中统一命名。可能值:"geosceneIdentifierInfoTypeUniformProperty"|"geosceneIdentifierInfoTypeDatabaseNative"
databaseNativeIdentifier Object数据库本机标识符的属性。
uniformPropertyIdentifier Object用户定义的唯一标识符的属性。
- 规范
-
identifierPropertyName String
所有记录的唯一标识符属性的名称。
identifierGenerationInfo Object有关如何生成唯一标识符的信息。
uuidMethodHint String关于唯一标识符格式的信息。
geosceneUUIDESRI
是 GeoScene/Microsoft 格式的通用唯一 ID:{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}UUID_RFC_4122
是 RFC4122 小写格式的通用唯一 ID。可能值:"geosceneUUIDESRI"|"UUID_RFC_4122"
示例"identifierInfo": { "IdentifierMappingInfo": { "databaseNativeIdentifier": null, "identifierInfoType": "geosceneIdentifierInfoTypeUniformProperty", "uniformPropertyIdentifier": { "identifierPropertyName": "globalid" } }, "identifierGenerationInfo": { "uuidMethodHint": "geosceneUUIDESRI" } }
-
relationshipTypes RelationshipType[]readonly
-
知识图谱中的关系类型列表,包括其关联的属性。
-
searchIndexes SearchIndex[]readonly
-
知识图谱中的搜索索引列表。
-
-
指定知识图谱的空间参考信息。
- 默认值:null
-
strict Booleanreadonly
-
指示用户是否可以更改数据模型。如果为
true
,则无法修改数据模型,knowledgeGraphService.executeApplyEdits() 将失败。如果为false
,则任何用户都可对数据模型进行更改。数据模型的 strict 属性只能由管理员或知识图谱服务所有者从 GeoScene REST API 更新 (编辑数据模型) 中进行设置。
-
timestamp Datereadonly
-
上次更新数据模型的日期。
方法概述
名称 | 返回值类值 | 描述 | 类 |
---|---|---|---|
添加一个或多个与对象生命周期相关联的句柄 更多详情 | Accessor | ||
* | 创建此类的新实例并使用从 GeoScene 产品生成的 JSON 对象值对其进行初始化。 更多详情 | DataModel | |
Boolean | 如果存在指定的句柄组,则返回 true。 更多详情 | Accessor | |
移除对象拥有的句柄组。 更多详情 | Accessor | ||
Object | 将此类的实例转换为其 GeoScene Portal JSON 表示。 更多详情 | DataModel |
方法详细说明
-
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 ObjectGeoScene 格式实例的 JSON 表示。
返回类型 描述 * 返回该类的新实例。
-
如果存在指定的句柄组,则返回 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 表示。