[SPARQL] how to query when the entity code is known
Querying with Q-code known
How did I encounter this?
Since I decided to separate the query into pieces, the subsequent queries start by the retrieved entity codes. This is how to use the entity code.
Syntax
SELECT ?someData
WHERE {
wd:Q1234 wdt:P31 ?someData .
}
wd:Q1234is the entity Q-code (the item whose data you want).wdt:P31is the property (e.g., “instance of”) desired to be queried.?someDatais the variable capturing the result (e.g., the type ofwd:Q1234).
Comments
Post a Comment