Template:Query no qualifier
Jump to navigation
Jump to search
Partial query to get values of statements of some given property that has no qualifier at all, or to filter item if they have such a statement.
Variable naming[edit]
The statement is named by default by the pattern ?<item>_<property>_statement
and the value ?<item>_<property>_value
.
Usage[edit]
{{query no qualifier|item=?class|property=number|value=?number_of_instances}}
?class p:P1114 ?class_number_statement . ?class_number_statement ps:P1114 ?number_of_instances . FILTER NOT EXISTS { ?class_number_statement ?classnumberpq_pred [] . # a triple involving our statement ... [] wikibase:qualifier ?classnumberpq_pred . # ... with a predicate ?pq_pred that is a qualifier
}
In context:
select ?class ?number_of_instances {
# get all the classes with an unqualified "number" statement, the cardinality of the class
?class p:P1114 ?class_number_statement .
?class_number_statement ps:P1114 ?number_of_instances .
FILTER NOT EXISTS {
?class_number_statement ?classnumberpq_pred [] . # a triple involving our statement ...
[] wikibase:qualifier ?classnumberpq_pred . # ... with a predicate ?pq_pred that is a qualifier
}
}
selects in a sparql query only statements with no qualifier at all
Parameter | Description | Type | Status | |
---|---|---|---|---|
item | item subject | subject of the statement we want no qualifier into
| String | suggested |
value | value | values of statement with no qualifiers | String | optional |
property | property | property for the claim we are interested into
| String | required |
See also[edit]
The above documentation is transcluded from Template:Query no qualifier/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. |