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