Lina
Lina

Reputation: 1

How to use RDF:label in protege

For the RDF labels I'm trying something really simple to show all the labels in my ontology , but even that its not working. Do you have any idea how I need to write any rdfs:label

SELECT ?subject ?label WHERE { ?subject rdfs:label ?label }

Upvotes: 0

Views: 685

Answers (1)

Richard Scholtens
Richard Scholtens

Reputation: 1023

Try this:

SELECT ?subject ?label WHERE { ?subject <http://www.w3.org/2000/01/rdf-schema#label> ?label }

You could also maybe use a prefix like so:

PREFIX rdfs:    <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?subject ?label WHERE { ?subject rdfs:label ?label }

You can try out the queries by using the DBPedia endpoint:

https://dbpedia.org/sparql

To use existing predicates from other graphs you first have to include the reference to the predicate. Otherwise the query cannot find the correct predicate.

Upvotes: 0

Related Questions