Talk:Q52712340

From Wikidata
Jump to navigation Jump to search
description: constraint that specifies which values can be used for a given qualifier when used on a specific property of an Item Declaration
Useful links:
For help about classification, see Wikidata:Classification.
Parent classes (classes of items which contain this one item)
Subclasses (classes which contain special kinds of items of this class)
one-of qualifier value property constraint⟩ on wikidata tree visualisation (external tool)(depth=1)
Generic queries for classes
See also


See also

[edit]

Queries

[edit]

Query for properties that could use this

[edit]
SELECT ?property ?propertyLabel ?qualifier ?qualifierLabel 
{
   VALUES ?qualifier { wd:P459 wd:P1013 }
   ?property p:P2302 [ ps:P2302 wd:Q21510851 ; pq:P2306 ?qualifier ]
   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }               
}

Try it!

Sample values being used by one property

[edit]
#Which qualifier values uses qualifier P459 when being used on property P36?
SELECT ?qualifiervalue ?qualifiervalueLabel (COUNT(?item) as ?ct) 
{
   ?item p:P36 [ pq:P459 ?qualifiervalue ]
   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }               
}
GROUP BY ?qualifiervalue ?qualifiervalueLabel 
ORDER BY DESC(?ct)

Try it!

Sample query checking for violations

[edit]
#Sample: property P3022 when using qualifier "of" should have qualifier values wd:Q3010369 or wd:Q13454063
SELECT ?item ?itemLabel ?value ?valueLabel 
{
  ?item wdt:P3022 []; p:P3022 [ pq:P642 ?value ]
  FILTER ( ?value not in ( wd:Q3010369 , wd:Q13454063 ) ) 
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }        
}

Try it!

Discussion

[edit]