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

members property in hierarchy

From: iman <gharib83@gmail.com>
Date: Wed, 01 Oct 2014 12:30:03 +0200
Message-ID: <542BD7AB.2090904@gmail.com>
To: public-sparql-dev@w3.org
Dear all,
i am new in SPARQL and need serious help.
I have developed an ontology. In this ontology there is a class 
"Human_resource" with the following hierarchy:
*Human_resource -> Person -> Staff-> Non_clinicla_staff*

and there are 3 members for non clinical staff (*a,b,c*).
I have an object property*is_associated_with*. There is another class 
with the name *Project* which has one member *Proj1*.
each non clinical staff has *name* and *familyname*, but only two of 
them have the property *is_associated_with *the member class of Project 
I need to get the name of these two members.
my ontology name is SNIK.

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX snik: <http://imise/SNIK/#>

SELECT Distinct ?worker ?name
     ?z  rdfs:subClassOf <http://imise/SNIK/Human_ressource>.

     ?y rdfs:subClassOf <http://imise/SNIK/Staff>.

     ?worker a ?y.

This gives me only the 3 members as URI.
any help is appreciated

best regards
Received on Wednesday, 1 October 2014 15:33:33 UTC

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