Template:Query instances
This template creates a fragment of SPARQL that can be used within a query.
Usage edit
Plain usage (producing a portion of a SPARQL query):
- code:
{{Query instances|?item|Q5}}
- result: ?item wdt:P279*/wdt:P31 wd:Q5
Usage within a full query link:
- code:
{{Wdquery|
{{Query includes}}
SELECT ?item WHERE {{{Query instances|?item|Q5}}
} LIMIT 10|instances of{{Q|5}}
}} - result: instances of human (Q5)
See also edit
Query fragment to find all instances of some class, either as with an explicit "instance of" statement to the class or with a statement to a subclass of the class.
Parameter | Description | Type | Status | |
---|---|---|---|---|
item | 1 | item variable name or item id
| Unknown | required |
class | 2 | a class item variable or a class item id
| Unknown | required |
propns | propns | no description | Unknown | optional |
The above documentation is transcluded from Template:Query instances/doc (edit | history). Editors can experiment in this template's sandbox (create | mirror) and testcases (create) page. Please add categories to the /doc subpage. Subpages of this template. |
?item wdt:P279*/wdt:P31 ?{{{2}}}