-- Cleanup SPARQL CLEAR GRAPH ; SPARQL DROP SPIN LIBRARY ; -- Load Rules from data source -- SPARQL -- DEFINE get:soft "no-sponge" -- LOAD INTO ; -- LOAD Rules using TTLP to exclude ldp: relations injected by LDP container rules in use at idehen.net TTLP (' @prefix sp: . @prefix spl: . @prefix spin: . @prefix rdf: . @prefix rdfs: . @prefix xsd: . @prefix foaf: . @prefix rel: . @prefix wdrs: . @prefix schema: . @prefix sioc: . @prefix owl: . sioc:Item a rdfs:Class ; rdfs:label "An Item"^^xsd:string ; spin:rule [ a sp:Construct, spin:Rule ; rdfs:label "Latitude Rule -- via RDF-Turtle Document"; rdfs:comment """Handler for different kinds of Latitude oriented fields (relations). This particular rule has been loaded into Virtuoso via SQL (using SPASQL functionality)""" ; sp:text """ CONSTRUCT { ?this <#hasLatitude> ?n. } WHERE { FILTER (contains(str(?p),"latitude") || contains(str(?p),"Latitude") ) . ?this ?p ?n } """ ; schema:uri <#LatitudeRule1> ] ; spin:rule [ a sp:Construct, spin:Rule; rdfs:label "Longitude Rule -- via RDF-Turtle Document" ; rdfs:comment """Handler for different kinds of Longitude oriented fields (relations). This particular rule has been loaded into Virtuoso via SQL (using SPASQL functionality)""" ; sp:text """ CONSTRUCT { ?this <#hasLongitude> ?n. } WHERE { FILTER (contains(str(?p),"longitude") || contains(str(?p),"Longitude") ) . ?this ?p ?n } """ ; schema:uri <#LongitudeRule1> ] . ','', 'urn:spin:rule:geospatial:lib4', 4096 ) ; SPARQL SELECT COUNT (*) FROM WHERE {?s ?p ?o} ; -- Remove rdf:type relations that have ldp:Resource, rdf:Resource as objects -- SPARQL DELETE WHERE { GRAPH { ?p ?o }}; -- Remove even more: -- SPARQL DELETE WHERE { GRAPH { ?p ?o }}; -- SPARQL DELETE WHERE { GRAPH { ?p ?o } }; -- SPARQL -- select distinct ?o from where {?s a ?o} ; -- Generate Macros EXEC ('SPARQL ' || SPARQL_SPIN_GRAPH_TO_DEFSPIN('urn:spin:rule:geospatial:lib4')); -- Test Queries -- Data Set #1 SPARQL DEFINE get:soft "soft" DEFINE input:macro-lib SELECT ?x ?y ?z FROM WHERE { ?x a sioc:Item . ?x <#hasLatitude> ?y. ?x <#hasLongitude> ?z. } ; -- Data Set #2 SPARQL DEFINE get:soft "soft" DEFINE input:macro-lib SELECT ?y ?z FROM FROM FROM WHERE { ?x a sioc:Item . ?x <#hasLatitude> ?y . ?x <#hasLongitude> ?z . }