query-5cb27a67b7a888466d7940dfbd2f71c7
. Let’s go with the second one for now. ?child must have the parent/father Bach; the third says that Bach must have the child ?childThe first two triples say that the . P:P22, and the property to designate an item’s father is Q1339 for the item and copy the Q-number of the result that sounds like it’s the item we’re looking for (based on the description, for example). To find the identifier for a property, we do the same, but search for “P:search term” instead of just “search term”, which limits the search to properties. This tells us that the famous composer Johann Sebastian Bach is search, etc.) Instead, Wikidata items and properties are assigned an identifier. To find the identifier for an item, we Mercury crater, the French commune, the surname, and “Bach” might also refer to the German painterSo what remains to be done in order to turn this into a proper WDQS query? On Wikidata, items and properties are not identified by human-readable names like “father” (property) or “Bach” (item). (For good reason: “Johann Sebastian Bach” is also the name of a . (But this only applies to fixed values – variables don’t get a prefix!) wdt:, and properties with wd:And last but not least, we need to include prefixes. For simple WDQS triples, items should be prefixed with Putting this together, we arrive at our first proper WDQS query:
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?dziecko
WHERE
{
# ?child father Bach
?dziecko wdt:P22 wd:Q1339.
}