Re: Inferencing on graph patterns

Ivan Herman wrote:
> Dear Simon,
> 
> Thanks for your comments. And apologies for the somewhat late reply.
> 
> You wrote:
>  > In trying to understand SPARQL 1.1 Entailment Regimes [1] I was
>  > wondering if inferencing will ever take place on the RDF data in graph
>  > patterns themselves. Consider the following data in a store:
>  >
>  > (1) ex:C1 rdfs:subClassOf ex:C2 .
>  > (2) :myC1 a ex:C1 .
>  >
>  > Now when you do the following query at the endpoint for the store:
>  >
>  > SELECT ?type WHERE { ?x a ex:C1 , ?type }
>  >
>  > and it supports the RDFS entailment regime the result would be ex:C1 and
>  > ex:C2 because the store would infer :myC1 to be of type ex:C2, either
>  > when the data got added or on-the-fly.
>  >
>  > But what if the store didn't contain triple (2) and so no data about any
>  > instances of those two classes? Is there any way that it could make
>  > inferences about the data in the WHERE clause and therefore infer that
>  > ?x would be of type ex:C2 as well? I guess not since this is querying by
>  > matching patterns rather than "query by example". But I can see various
>  > uses for this. So if this is not how it's currently defined to work,
>  > have you considered this?
> 
> The inference regime is defined on possible solution. That indeed means
> that no inference is made on variables which means, as you say, that
> without  the triple (2) the required results will not be returned. And
> there is  no mechanism envisioned in SPARQL to achieve that.

Thanks for your reply, Ivan. Yes, that makes sense. And fair enough. :-)

> Note, however, that you may get what you want with a different query.
> For  example, in this case, the
> 
>  SELECT ?type WHERE { ex:C1 rdfs:subclass ?type. }
> 
> will return all possible types.

Ok. Querying for inferred types was just an example, the initial use case that brought me to this was actually a bit more complex (property restrictions). For this that kind of inferencing would have made the query a lot simpler. But it should still be possible to cover a lot of the inferencing "rules" with SPARQL, especially with property paths. Maybe it's worth investigating at some point how much of OWL 2 RL could be implemented with pure SPARQL - and what extensions would be needed to add the missing bits. But that's just something to keep in mind for the future. :-)

Regards,
  Simon

Received on Saturday, 14 November 2009 11:42:26 UTC