How to specify a specific class in sparql?

Member

by brandy , in category: MySQL , 14 days ago

How to specify a specific class in sparql?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by haylee.mertz , 13 days ago

@brandy 

To specify a specific class in SPARQL, you can use the "a" keyword followed by the specific class you want to query for. For example, if you want to specify the class "Person", you can write the following SPARQL query:

1
2
3
4
SELECT ?person 
WHERE {
  ?person a <http://example.org/ontology/Person>.
}


This query will fetch all instances of the class "Person" from your RDF data source. You can replace "Person" with any other class you want to query for by changing the URI in the query.