Shared publicly  - 
 
SPASQL And SPARQL

Finally got round to juxtaposition example re. SPASQL (SPARQL inside Virtuoso's SQL Processor) and SPARQL.

When I encounter data that needs tweaking, I just go to one of WebID, Digest Authentication, or OAuth protected SPARQL endpoints and execute SPASQL or SPARQL.

Given an Ontology URI: http://vocab.deri.ie/pdo
Ontology Document URI/URL: http://vocab.deri.ie/pdo.ttl .

I can fix some of the quirks (proper denotations and missing rdfs:isDefinedBy relationships etc..)  I see via using either of the SPASQL or SPARQL statements below.

Virtuoso SPASQL:

# Add the following triples (3-column records) 
# To a Named Graph (a named relation like a SQL table)
# From a query against an existing Named Graph (like query a SQL table as the basis for adding some new data to the same table)
#

INSERT INTO <http://vocab.deri.ie/pdo.ttl
{ ?s rdfs:isDefinedBy <http://vocab.deri.ie/pdo> . 
<http://vocab.deri.ie/pdo> <http://open.vocab.org/terms/defines> ?s.
<http://vocab.deri.ie/pdo> a owl:Ontology .
?s <http://www.w3.org/2007/05/powder-s#describedby> <http://vocab.deri.ie/pdo.ttl> .
<hhttp://vocab.deri.ie/pdo.ttl> foaf:primaryTopic ?s.
}
FROM <http://vocab.deri.ie/pdo.ttl>
WHERE {   {?s rdfs:subClassOf ?o} 
 UNION 
 {?s rdfs:subPropertyOf ?o} 
 UNION 
 {?s owl:equivalentClass ?o} 
 UNION 
 {?s owl:equivalentProperty ?o} 
 UNION 
 {?s a ?o}
}

SPARQL 1.1 Update Language:

# Ditto, but using SPARQL 1.1 Update Language syntax

INSERT {GRAPH <http://vocab.deri.ie/pdo.ttl
{ ?s rdfs:isDefinedBy <http://vocab.deri.ie/pdo> . 
<http://vocab.deri.ie/pdo> <http://open.vocab.org/terms/defines> ?s.
<http://vocab.deri.ie/pdo> a owl:Ontology .
?s <http://www.w3.org/2007/05/powder-s#describedby> <http://vocab.deri.ie/pdo.ttl> .
<http://vocab.deri.ie/pdo.ttl> foaf:primaryTopic ?s .
}
}
WHERE {GRAPH <http://vocab.deri.ie/pdo.ttl> { 
{?s rdfs:subClassOf ?o} 
UNION 
{?s rdfs:subPropertyOf ?o} 
UNION {?s owl:equivalentClass ?o} 
UNION {?s owl:equivalentProperty ?o} 
UNION {?s a ?o}

}

#SPASQL   #SPARQL   #LinkedData  
1
Add a comment...