Template:Unique values
Jump to navigation
Jump to search
partial query to select all items with a unique value for a property.
Naming[edit]
Same convention of {{Multiple values}}
: ?<itemname>_<property>_val1
for the default value of the statement
Usage[edit]
Items with a unique instance of (P31) value
{{sparql|query=
select ?item {
{{unique values|instance of|?item}}
} limit 1000
}}
select ?item {
?item wdt:P31 ?item_instance_of_val1
filter not exists {
?item wdt:P31 ?item_instance_of_val2
filter (?item_instance_of_val1 != ?item_instance_of_val2) .
}
} limit 1000
See also[edit]
{{Multiple values}}
{{No value}}
Partial query that filters items that have a unique value for a property
Parameter | Description | Type | Status | |
---|---|---|---|---|
property | 1 property | property for which we search unique values
| Unknown | optional |
item | 2 | item variable or item id
| Unknown | optional |
The above documentation is transcluded from Template:Unique values/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: ?item_{{{1}}}_val1 filter not exists { ?item wdt: ?item_{{{1}}}_val2 filter (?item_{{{1}}}_val1 != ?item_{{{1}}}_val2) . }