问题
When using an endpoint that is hosted in Virtuoso, (like DBpedia endpoint), there are a predefined set of rules that can be used (accessible through the Inference rules link on the top right).
If I need to use one of these rules I can include as the following within the query space at the endpoint:
define input:inference 'ldp'
However, when I try to include an external inference rules set, which is not predefined at the previous list, it triggers an error, as the following:
define input:inference <http://purl.org/goodrelations/v1>
Virtuoso 37000 Error SP031: SPARQL compiler: 'define input:inference refers to undefined inference rule set "http://purl.org/goodrelations/v1"
QUESTION:
Is it possible to include external rules from other vocabularies? and if yes, how?
回答1:
The DBpedia instance (and any other Virtuoso instance, for that matter) includes a list of preloaded inference rules. Naturally, for a variety of reasons (security, fair use, etc.), we don't allow ad-hoc inclusion of inference rules from external sources.
Note: An inference rule in Virtuoso is a mapping between a Rule and an Ontology (see Using British Royal Family Data Snippets — to demonstrate SPARQL Query Language-based Reasoning & Inference). It's the Rule Name that's used in the Inference Rule pragma of the query, which then indicates the following to the SPARQL processor:
- Need to invoke inference context
- Specific Rules (again, mappings to an Ontology where relation semantics are defined) to be invoked.
来源:https://stackoverflow.com/questions/36430656/virtuoso-sparql-endpoints-inference-rules