- From: <jos.deroo@agfa.com>
- Date: Tue, 6 Sep 2005 20:43:38 +0200
- To: franconi@inf.unibz.it
- Cc: andy.seaborne@hp.com, RDF Data Access Working Group <public-rdf-dawg@w3.org>, public-rdf-dawg-request@w3.org
[...]
> Let me re-consider the example I gave in <<http://lists.w3.org/
> Archives/Public/public-rdf-dawg/2004JulSep/0069>.
> Allow me to be sloppy in the syntax.
>
> OWL-Lite ontology, expressed in some RDF-based formalism:
> the class WORKER is declared equivalent to the union of the classes
> EMPLOYEE and MANAGER:
> WORKER = EMPLOYEE \or MANAGER
>
> RDF data:
> Paul rdf:type WORKER
> Andrea rdf:type WORKER
> Simon rdf:type EMPLOYEE
> Caroline rdf:type MANAGER
> Paul ns:has-friend Andrea
> Paul ns:has-friend Simon
> Simon ns:has-friend Andrea
> Andrea ns:has-friend Caroline
>
> The query:
> Tell me the workers having a friend which is an employee, which in
> turn should have a friend which is a manager.
> q(X) :- worker(X), has-friend(X,Y), employee(Y), has-friend(Y,Z),
> manager(Z).
I am trying to understand the issue..
starting from your given data
##############################################
@prefix owl: <http://www.w3.org/2002/07/owl#>.
@prefix : <enricoP#>.
:Paul a :WORKER.
:Andrea a :WORKER.
:Simon a :EMPLOYEE.
:Caroline a :MANAGER.
:Paul :has-friend :Andrea.
:Paul :has-friend :Simon.
:Simon :has-friend :Andrea.
:Andrea :has-friend :Caroline.
:WORKER owl:unionOf (:EMPLOYEE :MANAGER).
##############################################
I really can't see how query (*)
##############################################
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX : <enricoP#>
SELECT ?X
WHERE {
?X a :WORKER;
:has-friend ?Y.
?Y a :EMPLOYEE;
:has-friend ?Z.
?Z a :MANAGER.
}
##############################################
can give an answer..
what I can see and get is an answer to the query
##############################################
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX : <enricoP#>
SELECT ?X
WHERE {
?X a :WORKER;
:has-friend ?Y.
?Y a :EMPLOYEE;
:has-friend ?Z.
?Z :mightBe :MANAGER.
}
##############################################
when I add to the data some inference rules like
##############################################
{?C owl:unionOf ?L. ?L :item ?A. ?X a ?C} => {?X :mightBe ?A}.
{?L rdf:first ?I} => {?L :item ?I}.
{?L rdf:rest ?R. ?R :item ?I} => {?L :item ?I}.
##############################################
The answer is then indeed
(:Paul) .
and the query is getting a rdf subgraph from a background graph
that contains inferred :mightBe triples
Did you really intend query (*) ??
--
Jos De Roo, AGFA http://www.agfa.com/w3c/jdroo/
Received on Tuesday, 6 September 2005 18:43:55 UTC