Template:Query instances

Documentation icon Template documentation[view · edit · history · purge ]

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.

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
item1

item variable name or item id

Example
?item
Unknownrequired
class2

a class item variable or a class item id

Example
?class or Q5
Unknownrequired
propnspropns

no description

Unknownoptional

?item wdt:P279*/wdt:P31 ?{{{2}}}