Template:No statement

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

Usage

edit

Write sparql code to find items with no statement for some property

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
item1 item

name of the item variable (or item id)

Example
?item
Unknownrequired
property2

property id

Example
P31
Unknownrequired

Examples

edit
Raw example
{{No statement|?item|P31}}
gives
  OPTIONAL { ?item wdt:P31 ?item_P31 } FILTER(!bound(?item_P31)) .
Example in context, with a full query
{{sparql|query=
select ?item {
  ?item wdt:{{Pid|parent taxon}} ?parent # item with a parent taxon statement
  {{no statement|?item|P31}}             # and with no "instance of" statement 
} limit 10
}}
gives
select ?item {
  ?item wdt:P171 ?parent # item with a parent taxon statement
    OPTIONAL { ?item wdt:P31 ?item_P31 } FILTER(!bound(?item_P31)) .             # and with no "instance of" statement 
} limit 10
Try it!

See also

edit

OPTIONAL { ?{{{1}}} wdt: ?{{{1}}} } FILTER(!bound(?{{{1}}})) .