SPARQL INSERT can be done using the LOAD command:
SPARQL INSERT INTO <..> { .... } [[FROM ...] { ... }]
SPARQL LOAD <x> [INTO <y>]
-- <ResourceURL> will be the Graph IRI of the loaded data:
SPARQL LOAD <ResourceURL>
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 <http://www.w3.org/People/Berners-Lee/card#i>; callret-0 VARCHAR _______________________________________________________________________________ Load <http://www.w3.org/People/Berners-Lee/card#i> into graph <http://www.w3.org/People/Berners-Lee/card#i> -- done 1 Rows. -- 703 msec. SQL>
SPARQL PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX sioc: <http://rdfs.org/sioc/ns#> SELECT ?x ?p ?o FROM <http://mygraph.com> WHERE { ?x rdf:type sioc:User . ?x ?p ?o. ?x sioc:id ?id . FILTER REGEX(str(?id), "^King") } ORDER BY ?x
SQL>SPARQL LOAD bif:concat ("http://", bif:registry_get("URIQADefaultHost"), "/DAV/tmp/listall.rq") into graph <http://myNewGraph.com>; callret-0 VARCHAR _______________________________________________________________________________ Load <http://localhost:8890/DAV/tmp/listall.rq> into graph <http://myNewGraph.com> -- done 1 Rows. -- 321 msec.
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 <http://mygraph.com>
{
<http://myopenlink.net/dataspace/Kingsley#this>
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
<http://rdfs.org/sioc/ns#User> .
<http://myopenlink.net/dataspace/Kingsley#this>
<http://rdfs.org/sioc/ns#id>
<Kingsley> .
<http://myopenlink.net/dataspace/Caroline#this>
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
<http://rdfs.org/sioc/ns#User> .
<http://myopenlink.net/dataspace/Caroline#this>
<http://rdfs.org/sioc/ns#id>
<Caroline> .
};