How can I access the API of OntoRefine?

半世苍凉 提交于 2019-12-13 03:28:50

问题


In our current project we have a lot of data in table form that we want to transform to RDF. OpenRefine offers the possibility to create projects or update data via an API (see: https://github.com/OpenRefine/OpenRefine/wiki/OpenRefine-API).

Is it possible to use this API with OntoRefine and if so, how do I do it? Or are we better advised to use OpenRefine?

This question was similarly asked a little over a year ago but had not received an answer. (How to integrate tabular data into GraphDB automatically?)


回答1:


OntoRefine is an extension and improvement on top of OpenRefine. The functionality offered by OpenRefine, including the API, should all be present in the GraphDB version. In terms of implementation, you shouldn't need much more than a simple HTTP client.

Here's a sample using a previously created OntoRefine project.

public static void main(String[] args) throws URISyntaxException, IOException {
    CloseableHttpClient client = HttpClientBuilder.create().build();
    HttpGet post = new HttpGet(new URI("http://localhost:7200/orefine/command/core/get-models?project=1987845723285"));
    HttpEntity entity = client.execute(post).getEntity();
    System.out.println(EntityUtils.toString(entity));
}

Of course, you can also use the OpenRefine libraries, such as refine-java, for example.



来源:https://stackoverflow.com/questions/53829569/how-can-i-access-the-api-of-ontorefine

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!