curl 'http://localhost:7200/rest/data/import/upload/w2/url' -H 'Content-Type: application/json;charset=UTF-8' -H 'Accept: application/json,text/plain,*/*' --data-binary '{"type":"url","name":"http://data.bioontology.org/ontologies/ICD9CM/submissions/17/download?apikey=8b5b7825-538d-40e0-9e9e-5ab9274a9aeb","format":"text/turtle","data":"http://data.bioontology.org/ontologies/ICD9CM/submissions/17/download?apikey=8b5b7825-538d-40e0-9e9e-5ab9274a9aeb","status":"NONE","message":"","context":"","replaceGraphs":[],"baseURI":null,"forceSerial":false,"timestamp":1534939094325,"parserSettings":{"preserveBNodeIds":false,"failOnUnknownDataTypes":false,"verifyDataTypeValues":false,"normalizeDataTypeValues":false,"failOnUnknownLanguageTags":false,"verifyLanguageTags":true,"normalizeLanguageTags":false,"verifyURISyntax":true,"verifyRelativeURIs":true,"stopOnError":true}}
GraphDB处理api密钥,但是您应该以up或“ format”:“ text / turtle”的方式提供文件格式。希望这会有所帮助。
,
curl 'http://localhost:7200/rest/data/import/upload/abc/url' -H 'Content-Type: application/json;charset=UTF-8' -H 'Accept: application/json,"name":"http://www.w3.org/TR/owl-guide/wine.rdf","format":"","data":"http://www.w3.org/TR/owl-guide/wine.rdf","stopOnError":true}}'
哪里
-
abc
-是存储库ID
-
http://www.w3.org/TR/owl-guide/wine.rdf
-是要导入的URL
-
1534939094325
-自纪元以来的当前时间戳(以bash
为单位,等效于date +%s
)
如果要执行定期更新,建议您将每个文件放在自己的图形中(使用"context":"<file's url>"
),然后将其替换为"replaceGraphs":"<file's url>"
。数据库将创建增量并仅更新更改的语句。
,
借助于Ontotext的Sava,我能够构造此最小的curl命令,从而成功地从NCBO BioPortal加载了ICD9CM Turtle文件。
curl -d \
'{"type":"url","context":"http://data.bioontology.org/ontologies/ICD9CM/"}' \
-H 'Content-Type: application/json;charset=UTF-8' \
-X POST http://localhost:7200/rest/data/import/upload/disease_diagnosis_dev/url
- 我遗漏了许多键,包括
timestamp
和所有parserSettings
。
- 我使用的是
- d ... -X POST
卷曲样式而不是--data-binary
样式
我并不是声称知道这些决定的所有后果。
这是我在R中的方法
library(httr)
post.endpoint <- "http://localhost:7200//rest/data/import/upload/disease_diagnosis_dev/url"
update.body <- '{
"type":"url","context": "http://purl.bioontology.org/ontology/ICD9CM/","data": "http://data.bioontology.org/ontologies/ICD9CM/submissions/17/download?apikey=9cf735c3-a44a-404f-8b2f-c49d48b2b8b2"
}'
post.result <- POST(post.endpoint,body = update.body,content_type("application/json"))
本文链接:https://www.f2er.com/3012691.html