首页 > 解决方案 > 将本地文件上传到 GraphDB

问题描述

尝试使用以下 curl 命令将本地海龟文件上传到 GraphDB(免费版),运行在http://localhost:7200/.

curl -X POST 'http://localhost:7200/repositories/testrepository1/statements' -H "Content-Type:text/turtle" -T "/home/Desktop/onto.ttl"

尽管这个 curl 命令在执行时没有返回任何错误,但是本地文件onto.ttl并没有上传到testrepository1

我正在免费使用 9.7.0 版的 graphDB。

如果有人帮助我,将不胜感激。提前致谢!

标签: file-uploadgraphdbturtle-rdf

解决方案


您使用了错误的 mime 类型 - 它应该是 application/x-turtle 而不是 text/turtle。该请求将如下所示:

curl -X POST -H "Content-Type:application/x-turtle" -T "/home/Desktop/onto.ttl" http://localhost:7200/repositories/testrepository1/statements

推荐阅读