Use of SPARUL to add triples to a Named Graph.
Imagine a situation where you seek to create mappings between datasets across Linked Data Spaces. For example, we have two datasets across the schema.org and schema.rdfs.org data spaces and we seek to mint owl:equivalentClass and owl:equivalentProperty relations across the aforementioned data spaces in a third dataspace hosted by a Virtuoso instance.
You can write an ordinary CONSTRUCT statement, ensure that it generates the triples intended to be added, and then replace the leading CONSTRUCT keyword with the INSERT INTO
The example below shows how CONSTRUCT is used to manufacture the triples required by the Virtuoso hosted dataset.
CONSTRUCT { ?s <http://www.w3.org/2002/07/owl#equivalentClass> `iri (bif:replace(?o,'http://schema.rdfs.org/', 'http://schema.org/'))` } FROM <http://www.openlinksw.com/schemas/rdfs> WHERE { ?s <http://www.w3.org/2002/07/owl#equivalentClass> ?o };
htp://cname/sparql
SPARQL endpoint.
SPARQL INSERT INTO <http://www.openlinksw.com/schemas/rdfs> { ?s <http://www.w3.org/2002/07/owl#equivalentClass> `iri (bif:replace(?o,'http://schema.rdfs.org/', 'http://schema.org/'))` } FROM <http://www.openlinksw.com/schemas/rdfs> WHERE { ?s <http://www.w3.org/2002/07/owl#equivalentClass> ?o } ;