Thanks a lot Rubin,
it did worked like you wrote below with *. the Name is a property which
i have defined in my SNIK ontology. each worker has a name, which i want
to get as well.
thanks again
On 10/01/2014 09:00 PM, Ruben Verborgh wrote:
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