Example with pragma input:inference

The following example demonstrates usage of the input:inference pragma:


## Create an Inference Rule skos-trans

PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

INSERT INTO GRAPH <urn:rules.skos>
  {
    skos:broader rdfs:subPropertyOf skos:broaderTransitive .
    skos:narrower rdfs:subPropertyOf skos:narrowerTransitive
  };

rdfs_rule_set ('skos-trans', 'urn:rules.skos');


DEFINE input:inference "skos-trans"
PREFIX p: <http://dbpedia.org/property/>
PREFIX dbpedia: <http://dbpedia.org/resource/>
PREFIX category: <http://dbpedia.org/resource/Category:>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX geo: <http://www.georss.org/georss/>

SELECT DISTINCT ?m ?n ?p ?d
WHERE
   {
     ?m rdfs:label ?n.
     ?m skos:subject ?c.
     ?c skos:broaderTransitive category:Churches_in_Paris OPTION (TRANSITIVE) .
     ?m geo:point ?p
     FILTER ( lang(?n) = "fr" )
     FILTER ( lang(?d) = "fr" )
   }

Sponger Usage Examples

Related