-1

How can I select the classes that share the same object property in protege (OWL )? And the only query that's work this one

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 food:<http://www.semanticweb.org/shatha2012/ontologies/2015/11/untitled-ontology-9>

SELECT ?subject ?object WHERE { ?subject rdfs:subClassOf ?object }

I don't have individuals in my project.

JAL
  • 41,701
  • 23
  • 172
  • 300
Shathaaah
  • 11
  • 4
  • What do you mean by "classes that share the same object property"? Classes don't have properties in OWL (and properties don't have classes). – Joshua Taylor Dec 03 '15 at 21:34
  • I just want to make property that has in its domain classes that already linked with it;s range which is class – Shathaaah Dec 03 '15 at 21:46

1 Answers1

0

From what I can understand of your question, you want to retrieve all the classes that can contain a certain object property.

I don't know where this object property comes from, so let's assume the namespace this property belongs to is food and that the property name is propertySought . I cannot give absolute warranty that this will work (I don't know how your ontology is fully designed for starters) but try this:

SELECT ?subject WHERE { ?subject food:propertySought ?z }

If there are cardinality restrictions involved the query might need some adjusstments.

Anyways, check the SPARQL query tutorial for further information on how to query an ontology ;)

Feillen
  • 109
  • 9