我可以使用带有此主体的/rest/data/import/upload/{repositoryID}/url
方法将MonDO本体加载到GraphDB Free 9中:
{
"context": "http://purl.obolibrary.org/obo/mondo.owl",
"data": "https://github.com/monarch-initiative/mondo/releases/download/current/mondo.owl",
"format": "RDF/XML"
}
我也可以通过Workbench加载它,但是不能以编程方式加载它:
http://data.bioontology.org/ontologies/ICD9CM/submissions/17/download?apikey=8b5b7825-538d-40e0-9e9e-5ab9274a9aeb
我将format
行设置为“ Turtle”,得到202条响应,但是工作台未显示任何导入。好像有时我在工作台的导入页面上看到错误消息,但是我不知道要采取什么纠正措施。
例如,如果我故意通过工作台以错误的格式(RDF / XML)导入ICD9,那么我会看到
RDF解析错误:序言中不允许内容。 [第2行,第1栏]
答案 0 :(得分:1)
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”的方式提供文件格式。希望这会有所帮助。
答案 1 :(得分:0)
curl 'http://localhost:7200/rest/data/import/upload/abc/url' -H 'Content-Type: application/json;charset=UTF-8' -H 'Accept: application/json, text/plain, */*' --data-binary '{"type":"url","name":"http://www.w3.org/TR/owl-guide/wine.rdf","format":"","data":"http://www.w3.org/TR/owl-guide/wine.rdf","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}}'
哪里
abc
-是存储库ID http://www.w3.org/TR/owl-guide/wine.rdf
-是要导入的URL 1534939094325
-自纪元以来的当前时间戳(以bash
为单位,等效于date +%s
)如果要执行定期更新,建议您将每个文件放在自己的图形中(使用"context":"<file's url>"
),然后将其替换为"replaceGraphs":"<file's url>"
。数据库将创建增量并仅更新更改的语句。
答案 2 :(得分:0)
借助于Ontotext的Sava,我能够构造此最小的curl命令,从而成功地从NCBO BioPortal加载了ICD9CM Turtle文件。
curl -d \
'{"type":"url","format":"text/turtle","data":"http://data.bioontology.org/ontologies/ICD9CM/submissions/17/download?apikey=8b5b7825-538d-40e0-9e9e-5ab9274a9aeb","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
样式我并不是声称知道这些决定的所有后果。
library(httr)
post.endpoint <- "http://localhost:7200//rest/data/import/upload/disease_diagnosis_dev/url"
update.body <- '{
"type":"url",
"format":"text/turtle",
"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"))