How to get data type property values using SPARQL

Posted by udayalkonline on Stack Overflow See other posts from Stack Overflow or by udayalkonline
Published on 2010-06-08T07:08:42Z Indexed on 2010/06/08 7:12 UTC
Read the original article Hit count: 284

Filed under:

hey,

I have created some sample ontology in protege.According to my ontology there is a class called person and which has sub class called Student.There are some student individuals(john,paul,marry,...). I have diffiend some data property called "email" and assigned their email addresses.

Following query which is resulting all the individuals in ontology.But I want to get each individual and their email address.

String queryStr = "PREFIX rdfs: http://www.w3.org/2000/01/rdf-schema# "+ "PREFIX rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# "+ "select ?ind "+ "where { "+ "?ind rdf:type http://www.semanticweb.org/ontologies/2010/5/Ontology1275975684120.owl#Student ;"+

"}\n ";

Above query was tested on jena in eclipse IDE.

any idea..?

Thank in advance!

© Stack Overflow or respective owner

Related posts about sparql