- From: Ruben Verborgh <ruben.verborgh@ugent.be>
 - Date: Wed, 1 Oct 2014 21:00:52 +0200
 - To: iman <gharib83@gmail.com>
 - Cc: public-sparql-dev@w3.org
 
Hi Iman,
One first thing to note about this query:
> SELECT Distinct ?worker ?name
>     WHERE    
> {
>     ?z  rdfs:subClassOf  <http://imise/SNIK/Human_ressource>.
> 
>     ?y rdfs:subClassOf <http://imise/SNIK/Staff>.
> 
>     ?worker a ?y.
> 
> }
Not that ?z has no relation with ?worker or ?y at all.
This is probably not what you meant.
Also, the query seems incomplete; the above won't execute.
Where does ?name come from?
I think you mean something along the lines of:
SELECT DISTINCT ?worker
{
    ?y rdfs:subClassOf* <http://imise/SNIK/Staff>.
    ?worker a ?y.
}
Note the asterisk * after rdfs:subClassOf (this is a SPARQL 1.1 feature)
so that the class itself and deeper subclasses are also matched.
Best,
Ruben
Received on Wednesday, 1 October 2014 19:01:23 UTC