简体   繁体   中英

How to upload RDF files to Virtuoso with Java

I am developing an automatic method of retrieving rdf files from a url and then populating them to my (remote) virtuoso store. Currently, I am using the Jena libs and the Virtuoso Jena Provider to do that, in particular I create a VirtGraph with a model and then I read the rdf file in this Model. Is there any way I can bypass using a model to read the rdf file and upload it directly to the store, using java?

You can use the Virtuoso JDBC driver as per any JDBC driver:

http://virtuoso.openlinksw.com/dataspace/dav/wiki/Main/VOSClient http://docs.openlinksw.com/virtuoso/VirtuosoDriverJDBC.html

The SPARQL query string needs to be prefixed with "SPARQL"

You should then use the LOAD expresssion from SPARQL Update ie:

SPARQL
LOAD <http://uri-of-rdf-resource>
INTO GRAPH <http://uri-of-target-graph>

The RDF resource needs to be dereferenceable for this to work

Alternatively, you can use a SPARQL Protocol compliant jdbc driver, operating on the Virtuoso SPARQL endpoint http://code.google.com/p/jdbc4sparql/ if you want to avoid the non-standard querystring prefix.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM