new KnowledgeGraphService(url, options)
Usage
import { KnowledgeGraphService } from '@supermapgis/iclient-ol';
new KnowledgeGraphService(url, options);<script type="text/javascript" src="https://iclient.supermap.io/dist/openlayers/iclient-ol.js"></script>
<script>
new ol.supermap.KnowledgeGraphService({paramsNames});
</script>
openlayers/services/KnowledgeGraphService.js, line 6
| 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
-> ol.Observable
Methods
-
findShortestPath(params, callback){Promise}
openlayers/services/KnowledgeGraphService.js, line 33 -
获取开始节点和结束节点之间的最短路径。
Name Type Description paramsKnowledgeGraphService.findShortestPathParams 参数。
callbackRequestCallback 可选 回调函数,该参数未传时可通过返回的 promise 获取结果。
- Version:
- 11.2.0
Returns:
Type Description Promise Promise 对象。 -
getGraphMap(params, callback){Promise}
openlayers/services/KnowledgeGraphService.js, line 75 -
获取图谱图序列化数据。
Name Type Description paramsstring 图谱名称。
callbackRequestCallback 可选 回调函数,该参数未传时可通过返回的 promise 获取结果。
Returns:
Type Description Promise Promise 对象。 -
getGraphMapData(graphMapName){Promise}
openlayers/services/KnowledgeGraphService.js, line 86 -
将 SuperMap iServer GraphMap 服务的数据格式转换为 KnowledgeGraph 的数据格式。
Name Type Description graphMapNamestring 图谱名称。
Returns:
Type Description Promise Promise 对象。 -
getGraphMaps(callback){Promise}
openlayers/services/KnowledgeGraphService.js, line 65 -
获取图谱列表。
Name Type Description callbackRequestCallback 可选 回调函数,该参数未传时可通过返回的 promise 获取结果。
Returns:
Type Description Promise Promise 对象。 -
query(cypherQuery, callback){Promise}
openlayers/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