Search Mailing List Archives

Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[protege-owl] retreiving Individuals using SPARQL

Pitonyak, Andrew D PitonyakA at BATTELLE.ORG
Tue Mar 24 08:13:17 PDT 2009

Not pretty, but, I do the following:

(1) use SPARQL to get ALL classes. 

WHERE { ?sub rdf:type owl:Class }

This provides all of the classes. If you desire to also obtain the hierarchy, then find and build it.

WHERE { ?sub rdfs:subClassOf ?obj }

Now, for each class, I perform a query:

WHERE { ?sub rdf:type <" + parent.getUri() + "> }

Not pretty, but it works. Also, since your Ontology is likely to contain more individuals than classes and properties, AND, because your types are likely to have their own namespace, you can probably use a filter in your query. I will not test this query, so figuring it out is your problem, but it is likely something like this:

WHERE { ?sub rdf:type ?obj FILTER ( regex(str(?obj), "your name space here" ) }

-----Original Message-----
From: protege-owl-bounces at [mailto:protege-owl-bounces at] On Behalf Of babar shahzad
Sent: Tuesday, March 24, 2009 10:36 AM
To: protege-owl at
Subject: [protege-owl] retreiving Individuals using SPARQL

Hi all,

Is it possible using SPARQL to query Individuals ???
If so, can someone kindly provide a simple example!

Suppose there is a concept 'Product' & it has some individuals as members.

Babar Shahzad Chaudary, 
Deptt of Information Processing
University of Oulu, Finland.

protege-owl mailing list
protege-owl at

Instructions for unsubscribing: 

More information about the protege-owl mailing list