%META:TOPICPARENT{name="VirtTipsAndTricksGuide"}%
---+ How can I use the LOAD command to import RDF data?
SPARQL INSERT can be done using the LOAD command:
SPARQL INSERT INTO <..> { .... } [[FROM ...] { ... }]
SPARQL LOAD [INTO ]
-- will be the Graph IRI of the loaded data:
SPARQL LOAD
---++Examples
---+++Load from Resource URL
In order to load data from resource URL for ex: http://www.w3.org/People/Berners-Lee/card#i , execute the following command with isql:
SQL> SPARQL LOAD ;
callret-0
VARCHAR
_______________________________________________________________________________
Load into graph -- done
1 Rows. -- 703 msec.
SQL>
---+++Load from file
1 Create DAV collection which is visible to the public, for ex: http://localhost:8890/DAV/tmp
1 Upload to the DAV collection a file, for example with name listall.rq and with the following content:
SPARQL
PREFIX rdf:
PREFIX rdfs:
PREFIX sioc:
SELECT ?x ?p ?o
FROM
WHERE
{
?x rdf:type sioc:User .
?x ?p ?o.
?x sioc:id ?id .
FILTER REGEX(str(?id), "^King")
}
ORDER BY ?x
1 Execute the following command from isql:
SQL>SPARQL LOAD bif:concat ("http://", bif:registry_get("URIQADefaultHost"), "/DAV/tmp/listall.rq") into graph ;
callret-0
VARCHAR
_______________________________________________________________________________
Load into graph -- done
1 Rows. -- 321 msec.
---+++Directly LOAD triples using iSQL
Triples can be directly loaded into Virtuoso specifying the literal values to inserted, by executing a command of the following form from isql:
SQL>SPARQL INSERT INTO graph
{
.
.
.
.
};
---++Related
* [[VirtTipsAndTricksGuide][Virtuoso Tips and Tricks Collection]]
* [[http://docs.openlinksw.com/virtuoso/rdfinsertmethods.html][RDF Insert Methods in Virtuoso]]