new KnowledgeGraphService(url, options)
Usage
// 浏览器
<script type="text/javascript" src="https://iclient.supermap.io/dist/leaflet/iclient-leaflet.js"></script>
<script>
new L.supermap.KnowledgeGraphService(url, options);
</script>
// ES6 Import
import { KnowledgeGraphService } from '@supermapgis/iclient-leaflet';
new KnowledgeGraphService(url, options);
leaflet/services/KnowledgeGraphService.js, line 7
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
url |
string |
服务地址。 |
||||||||||||||||||||
options |
Object |
参数。
|
- Version:
- 11.1.0
Example
new KnowledgeGraphService(url)
.query(param,function(result){
//doSomething
})
Extends
Events
-
inherited destroy
leaflet/services/ServiceBase.js, line 52 -
资源释放成功后触发。
Properties:
Name Type Description this
ServiceBase this 对象。
-
inherited initialized
leaflet/services/ServiceBase.js, line 39 -
构造函数构造成功后触发。
Properties:
Name Type Description this
ServiceBase this 对象。
Methods
-
inherited destroy()
leaflet/services/ServiceBase.js, line 47 -
释放资源,将引用的资源属性置空。
-
findShortestPath(params, callback){Promise}
leaflet/services/KnowledgeGraphService.js, line 34 -
获取开始节点和结束节点之间的最短路径。
Name Type Description params
KnowledgeGraphService.findShortestPathParams 参数。
callback
RequestCallback 可选 回调函数,该参数未传时可通过返回的 promise 获取结果。
- Version:
- 11.2.0
Returns:
Type Description Promise Promise 对象。 -
getGraphMap(params, callback){Promise}
leaflet/services/KnowledgeGraphService.js, line 75 -
获取图谱图序列化数据。
Name Type Description params
string 图谱名称。
callback
RequestCallback 回调函数。
Returns:
Type Description Promise Promise 对象。 -
getGraphMapData(graphMapName){Promise}
leaflet/services/KnowledgeGraphService.js, line 86 -
将 SuperMap iServer GraphMap 服务的数据格式转换为 KnowledgeGraph 的数据格式。
Name Type Description graphMapName
string 图谱名称。
Returns:
Type Description Promise Promise 对象。 -
getGraphMaps(callback){Promise}
leaflet/services/KnowledgeGraphService.js, line 65 -
获取图谱列表。
Name Type Description callback
RequestCallback 回调函数。
Returns:
Type Description Promise Promise 对象。 -
query(cypherQuery, callback){Promise}
leaflet/services/KnowledgeGraphService.js, line 45 -
通过查询语句查询知识图谱数据。
Name Type Description cypherQuery
string 查询条件。
callback
RequestCallback 可选 回调函数,该参数未传时可通过返回的 promise 获取结果。
Returns:
Type Description Promise Promise 对象。
Type Definitions
-
findShortestPathParamsObject
-
Properties:
Name Type Description startID
string 开始节点的id
endID
string 结束节点id