这是所有可在图谱结构或图谱查询上表示的对象的父类 - Entity、Relationship、Path 和匿名对象。匿名对象是除 entity
、relationship
或 path
以外的任何对象。
构造函数
属性概述
所有属性都可以设置、获取和监听。请参阅使用属性主题。
名称 | 类型 | 描述 | 类 |
---|---|---|---|
String | 类的名称。 更多详情 | Accessor | |
Object | 图谱对象的属性。 更多详情 | GraphObject |
属性详细信息
-
类的名称。声明的类名称格式化为
geoscene.folder.className
。
-
properties Object
-
示例
//example of properties structure that includes geometry "properties": { "shape": { "declaredClass": "geoscene.geometry.Point", "cache": {}, "hasM": false, "hasZ": false, "latitude": 53.589000000000009, "longitude": -0.9633, "type": "point", "extent": null, "spatialReference": { "wkid": 4326 }, "x": -0.9633, "y": 53.589000000000009 }, "Name": "Suncommon", "Employee_Count": 400, "Address": "123 Broadway, New York, New York", "EnergyType": "solar" }
//two entities of different entity types with different properties [{ "declaredClass": "geoscene.rest.knowledgeGraph.Entity", "properties": { "Name": "Suncommon", "Employee_Count": 400, "energyType": "solar" }, "typeName": "Company", "id": "1256" }, { "declaredClass": "geoscene.rest.knowledgeGraph.Entity", "properties": { "Name": "Empire State Building", "height": 1454, "heightUnits": "feet", "city": "New York" }, "typeName": "Building", "id": "B7889541" }]
//two relationships of different relationship types with different properties [{ "declaredClass": "geoscene.rest.Relationship.Relationship", "properties": { "start_date": "2020-04-17", "employee_id": "4589", "office": "152 Building A" }, "typeName": "Employed_by", "id": "B7889541" }, { "declaredClass": "geoscene.rest.Relationship.Relationship", "properties": { "quantity": 125000, "frequency": "bi-weekly", "contact_person": "Betty White" }, "typeName": "buys_part", "id": "B7889541" }]
方法概述
名称 | 返回值类值 | 描述 | 类 |
---|---|---|---|
添加一个或多个与对象生命周期相关联的句柄 更多详情 | Accessor | ||
* | 创建此类的新实例并使用从 GeoScene 产品生成的 JSON 对象值对其进行初始化。 更多详情 | GraphObject | |
Boolean | 如果存在指定的句柄组,则返回 true。 更多详情 | Accessor | |
移除对象拥有的句柄组。 更多详情 | Accessor | ||
Object | 将此类的实例转换为其 GeoScene Portal JSON 表示。 更多详情 | GraphObject |
方法详细说明
-
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 表示。