tags:

views:

53

answers:

1

hi, I have simple ontology called "campus.owl".There is a class called"Lecturer" and which has two sub classes ,RegularLecturer and VisitingLecturer.There is a another class called "Student" which is a sibling class of Lecturer class. I have created individuals for all the classes.

Student class is joind with Lecture class with "has" object property.

problem

I want to get some Lecturer/VisitingLecturer individuals for given student individual. Could you please help me to get this result! Thanks in advance!

PREFIX rdfs: http://www.w3.org/2000/01/rdf-schema#
PREFIX rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# 
PREFIX my: http://www.semanticweb.org/ontologies/2010/5/Ontology1275975684120.owl#

SELECT ?lec WHERE { ?lec..........??? }

any idea..??

Thank in advance!

+2  A: 

Something like:

SELECT ?lec WHERE { ?lec a ?lectype. 
                    ?lectype <http://www.w3.org/2000/01/rdf-schema#subClassOf&gt; <Lecturer>.
                    <student> <has> ?lec.}

Should do it.

Jeremy French
This query does not give the result. consider there are some Lecturer individuals(john,paul) as well as Student individuals(marry,lisa,steven). john and paul is assigned to marry. Actually I want something like this.. "who are the lecturers assigned to marry" Thats only bro..Thank you very much for your reply!
udayalkonline
replace <student> above with the URI for mary and you should see something like you want.
Jeremy French
::Thnk you bro..got the result based on your answer!Have a nice day!:) :)
udayalkonline