W3C home > Mailing lists > Public > public-sparql-dev@w3.org > October to December 2014

Re: members property in hierarchy

From: Ruben Verborgh <ruben.verborgh@ugent.be>
Date: Wed, 1 Oct 2014 21:00:52 +0200
Cc: public-sparql-dev@w3.org
Message-Id: <7BFC46D8-A66D-47D8-8DF8-5ADFEFE129A8@ugent.be>
To: iman <gharib83@gmail.com>
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:

    ?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.


Received on Wednesday, 1 October 2014 19:01:23 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:15:52 UTC