- From: Leonard Jacuzzo <jacuzzo@gmail.com>
- Date: Wed, 1 Oct 2014 21:35:44 -0400
- To: iman <gharib83@gmail.com>
- Cc: public-sparql-dev@w3.org
- Message-ID: <CAPxg9HjP2BdAoxvy7KraDxvpj9nnP-s5tPiO92rPsQRk=CeYPw@mail.gmail.com>
I think that the problem might be that your model doesn't have a link from the workers to their names...is there a 'has_name' property with a "name" class? Is it a datatype property? If not you probably need to add it to the model and then use it in the query...add a line to the where clause like ?worker has_name ?name LFJ On Wed, Oct 1, 2014 at 6:30 AM, iman <gharib83@gmail.com> wrote: > 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 *Proj1*. > > 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#> > <http://www.w3.org/1999/02/22-rdf-syntax-ns#> > PREFIX owl: <http://www.w3.org/2002/07/owl#> > <http://www.w3.org/2002/07/owl#> > PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> > <http://www.w3.org/2001/XMLSchema#> > PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> > <http://www.w3.org/2000/01/rdf-schema#> > PREFIX snik: <http://imise/SNIK/#> <http://imise/SNIK/#> > > SELECT Distinct ?worker ?name > WHERE > { > ?z rdfs:subClassOf <http://imise/SNIK/Human_ressource> > <http://imise/SNIK/Human_ressource>. > > ?y rdfs:subClassOf <http://imise/SNIK/Staff> <http://imise/SNIK/Staff> > . > > ?worker a ?y. > > } > This gives me only the 3 members as URI. > any help is appreciated > > best regards > Iman >
Received on Thursday, 2 October 2014 01:36:12 UTC