Template:Unique values/doc

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
Try it!

See also

edit


Partial query that filters items that have a unique value for a property

Template parameters

ParameterDescriptionTypeStatus
property1 property

property for which we search unique values

Example
P31
Unknownoptional
item2

item variable or item id

Example
?item
Unknownoptional