Search code examples
sparqlprotegeprotege4

SPARQL in Protege 4.3


I need to return individuals for my query:

SELECT ?subject ?class
            WHERE { ?subject rdfs:subClassOf ?class. 
?class rdfs:comment "linear"@en}

But it works only with subclasses. Should I replace rdfs:subClassOf on different operator?


Solution

  • Your query specifically asks for ?subjects that are subclasses of ?class (where ?class has the rdfs:comment "linear"@en). To retrieve instances of type ?class, you'd use

    ?subject rdf:type ?class
    

    or, since SPARQL allows abbreviating rdf:type by a,

    ?subject a ?class