user1259487
user1259487

Reputation: 101

sparql query for rdf:id

I want to write a sparql query to get rdf data based on their id. I am trying with

SELECT ?ID ?NAME WHERE {?ID = "something" } 

but does not return the expecting results. Does anyone knows which is my mistake?

Upvotes: 3

Views: 1301

Answers (2)

castagna
castagna

Reputation: 1359

In order to have a precise answer you should share a small fragment of your RDF data (possibly in Turtle format, human friendly).

Upvotes: 2

boferri
boferri

Reputation: 696

Actually rdf:id is the resource URI itself. You can utilise a SPARQL FILTER clause for filtering your result, or you can directly insert the URI in the WHERE clause of your query, e.g.

<myURI> ex:name ?name .

Upvotes: 3

Related Questions