How to import JSON-LD into Virtuoso

懵懂的女人 提交于 2020-08-08 12:01:38

问题


I'm using Virtuoso at AWS.

I want to get JSON-LD Data using SPARQL query. Because I'm making opendata that is JSON-LD Content-type.

But, I can not import JSON-LD file into Virtuoso Conductor.

So, do you know how to import JSON-LD into Virtuoso?


回答1:


To import JSON-LD into Virtuoso you need to install the Virtuoso Sponger Middleware module. Once installed, you can use Sponger pragmas and/or URL patterns to facilitate imports from documents comprised of JSON-LD content.

SPARQL pragma example:

define get:soft "replace" 
SELECT * FROM <{JSONLD-DOC-URL}> 
WHERE {?s ?p ?o}.

Web Service URL Patterns:

  • first time

    http://{your-virtuoso-instance-cname}/about/html/{JSONLD-DOC-URL}
    
  • to replace/overwrite data stored in Virtuoso hosted named graph (internal document)

    http://{your-virtuoso-instance-cname}/about/html/{JSONLD-DOC-URL}?sponger:get=replace
    
  • to add/append to data already stored in Virtuoso hosted named graph (internal document)

    http://{your-virtuoso-instance-cname}/about/html/{JSONLD-DOC-URL}?sponger:get=add
    


来源:https://stackoverflow.com/questions/32298456/how-to-import-json-ld-into-virtuoso

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