I am trying to run an example of inferencing using subClassOf relationship.
For some reason, I am getting the select query results when I use xquery but not when I use sparql.
let $sq :=
'PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT *
WHERE { ?s rdf:type <http://www.smartlogic.com/geography#Europe> .
} '
let $rs := sem:ruleset-store("rdfs.rules", sem:store())
return sem:sparql($sq, (), (), $rs)
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT *
WHERE { ?s rdf:type <http://www.smartlogic.com/geography#Europe> .
}
As of now (MarkLogic 8.0-3), the SPARQL interface does not provide a way to specify a set of inference rules to use. You can configure a default ruleset to use with the database, which will be used with all SPARQL queries.
As you've done, you can use sem:ruleset-store() (XQuery) or sem.rulesetStore() (JavaScript) to specify a ruleset to use.