Property talk:P8701

From Wikidata
Jump to navigation Jump to search

Documentation

has census
general population census of the country or region
Representscensus (Q39825)
Data typeItem
Domain
According to this template: "demographics of" items
According to statements in the property:
demographics of country or region (Q23983664)
When possible, data should only be stored as statements
Allowed valuesitems about population census. Value would generally be unique (e.g. add Japan 2010 Census (Q15727301) to demographics of Japan (Q1124220), not to "demographics of Tokyo") (note: this should be moved to the property statements)
Exampledemographics of Japan (Q1124220)Japan 2010 Census (Q15727301)
demographics of the Philippines (Q2361183)2015 Census of the Philippines (Q24170418)
2010 Census of the Philippines (Q15727292)
2007 Census of the Philippines (Q15729072)
demographics of the United States (Q1965974)2010 United States Census (Q523716)
demographics of Monaco (Q2345347)2016 Monaco census (Q99470335)
2008 Monaco census (Q99472380)
demographics of Canada (Q2492796)Canada 2011 Census (Q5029304)
Canada 2016 Census (Q16955163)
See alsopopulation (P1082)
Lists
Proposal discussionProposal discussion
Current uses
Total612
Main statement59697.4% of uses
Qualifier122% of uses
Reference40.7% of uses
Search for values
[create Create a translatable help page (preferably in English) for this property to be included here]
Type “demographics of country or region (Q23983664): item must contain property “instance of (P31)” with classes “demographics of country or region (Q23983664)” or their subclasses (defined using subclass of (P279)). (Help)
Exceptions are possible as rare values may exist. Exceptions can be specified using exception to constraint (P2303).
List of violations of this constraint: Database reports/Constraint violations/P8701#Type Q23983664, SPARQL
Value type “census (Q39825): This property should use items as value that contain property “instance of (P31)”. On these, the value for instance of (P31) should be an item that uses subclass of (P279) with value census (Q39825) (or a subclass thereof). (Help)
Exceptions are possible as rare values may exist. Exceptions can be specified using exception to constraint (P2303).
List of violations of this constraint: Database reports/Constraint violations/P8701#Value type Q39825, SPARQL
Conflicts with “class (P2308): census (Q39825): this property must not be used with the listed properties and values. (Help)
Exceptions are possible as rare values may exist. Exceptions can be specified using exception to constraint (P2303).
List of violations of this constraint: Database reports/Constraint violations/P8701#Conflicts with P2308, search, SPARQL
Allowed entity types are Wikibase item (Q29934200): the property may only be used on a certain entity type (Help)
Exceptions are possible as rare values may exist. Exceptions can be specified using exception to constraint (P2303).
List of violations of this constraint: Database reports/Constraint violations/P8701#Entity types
Scope is as main value (Q54828448): the property must be used by specified way only (Help)
Exceptions are possible as rare values may exist. Exceptions can be specified using exception to constraint (P2303).
List of violations of this constraint: Database reports/Constraint violations/P8701#Scope, SPARQL
Qualifiers “reason for deprecated rank (P2241): this property should be used only with the listed qualifiers. (Help)
Exceptions are possible as rare values may exist. Exceptions can be specified using exception to constraint (P2303).
List of violations of this constraint: Database reports/Constraint violations/P8701#allowed qualifiers, SPARQL
Multi value: this property generally contains two or more values. (Help)
Exceptions are possible as rare values may exist. Exceptions can be specified using exception to constraint (P2303).
List of violations of this constraint: Database reports/Constraint violations/P8701#Multi value, SPARQL
Item “country (P17): Items with this property should also have “country (P17)”. (Help)
Exceptions are possible as rare values may exist. Exceptions can be specified using exception to constraint (P2303).
List of violations of this constraint: Database reports/Constraint violations/P8701#Item P17, search, SPARQL
Item “location (P276): Items with this property should also have “location (P276)”. (Help)
Exceptions are possible as rare values may exist. Exceptions can be specified using exception to constraint (P2303).
List of violations of this constraint: Database reports/Constraint violations/P8701#Item P276, search, SPARQL
Property “point in time (P585)” declared by target items of “has census (P8701): If [item A] has this property with value [item B], [item B] is required to have property “point in time (P585)”. (Help)
Exceptions are possible as rare values may exist. Exceptions can be specified using exception to constraint (P2303).
List of violations of this constraint: Database reports/Constraint violations/P8701#Target required claim P585, SPARQL, SPARQL (by value)
Distinct values: this property likely contains a value that is different from all other items. (Help)
Exceptions are possible as rare values may exist. Exceptions can be specified using exception to constraint (P2303).
List of violations of this constraint: Database reports/Constraint violations/P8701#Unique value, SPARQL (every item), SPARQL (by value)
value should have a label in English
TODO add an English label (Help)
Violations query: SELECT DISTINCT ?item ?year ?location ?country { hint:Query hint:optimizer "None". ?item ^ wdt:P8701 [] . OPTIONAL { ?item rdfs:label ?l . FILTER( lang(?l)= "en" ) } FILTER ( !BOUND(?l) ) OPTIONAL { ?item wdt:P276 ?location } OPTIONAL { ?item wdt:P17 ?country } OPTIONAL { ?item wdt:P585 ?d . BIND(YEAR(?d) as ?year) } } LIMIT 1000
List of this constraint violations: Database reports/Complex constraint violations/P8701#value should have a label in English
English label would generally include the year of the census
TODO edit label (Help)
Violations query: SELECT DISTINCT ?item ?year ?l WHERE { hint:Query hint:optimizer "None". ?item ^wdt:P8701 _:b28; wdt:P585 ?d. BIND(YEAR(?d) AS ?year) ?item rdfs:label ?l. FILTER( LANG(?l) = "en" && !CONTAINS(?l, STR(?year))) FILTER( ?item != wd:Q106106013 ) }
List of this constraint violations: Database reports/Complex constraint violations/P8701#English label would generally include the year of the census
English label, description, or alias should include place name (country or region)
TODO: generally add an alias in the form "<year> census of <place>" (Help)
Violations query: SELECT DISTINCT ?item ?loc ?year WHERE { hint:Query hint:optimizer "None". ?item ^wdt:P8701 _:b28; wdt:P276 / rdfs:label ?loc . FILTER( lang(?loc) = "en") FILTER NOT EXISTS { ?item rdfs:label ?l. FILTER( LANG(?l) = "en" && CONTAINS(?l, ?loc)) } FILTER NOT EXISTS { ?item skos:altLabel ?l2. FILTER( LANG(?l2) = "en" && CONTAINS(?l2, ?loc)) } FILTER NOT EXISTS { ?item schema:description ?l3. FILTER( LANG(?l3) = "en" && CONTAINS(?l3, ?loc)) } OPTIONAL { ?item wdt:P585 ?d . BIND(YEAR(?d) as ?year) } } ORDER BY ?loc
List of this constraint violations: Database reports/Complex constraint violations/P8701#English label, description, or alias should include place name (country or region)
values to add (from enwiki)
TODO add values (Help)
Violations query: SELECT ?item ?article ?yearcategory WHERE { hint:Query hint:optimizer "None". VALUES ?offset { 2 1 0 -1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 } BIND(CONCAT("Category:",str(YEAR(now())+?offset )," censuses") as ?yearcategory) SERVICE wikibase:mwapi { bd:serviceParam wikibase:endpoint "en.wikipedia.org"; wikibase:api "Generator"; mwapi:generator "categorymembers"; mwapi:gcmtitle ?yearcategory ; mwapi:gcmprop "title"; mwapi:gcmlimit "max". ?article wikibase:apiOutput mwapi:title. ?item wikibase:apiOutputItem mwapi:item. } FILTER(bound(?item)) FILTER NOT EXISTS { [] wdt:P8701 ?item } FILTER NOT EXISTS { ?item wdt:P31 wd:Q4167410 } FILTER NOT EXISTS { ?item wdt:P31 wd:Q18691530 } }
List of this constraint violations: Database reports/Complex constraint violations/P8701#values to add (from enwiki)
values to add (from eswiki)
TODO add values (Help)
Violations query: SELECT ?item ?article ?yearcategory WHERE { hint:Query hint:optimizer "None". VALUES ?offset { 2 1 0 -1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 } BIND(CONCAT("Categoría:Censos en ",str(YEAR(now())+?offset ),"") as ?yearcategory) SERVICE wikibase:mwapi { bd:serviceParam wikibase:endpoint "es.wikipedia.org"; wikibase:api "Generator"; mwapi:generator "categorymembers"; mwapi:gcmtitle ?yearcategory ; mwapi:gcmprop "title"; mwapi:gcmlimit "max". ?article wikibase:apiOutput mwapi:title. ?item wikibase:apiOutputItem mwapi:item. } FILTER(bound(?item)) FILTER NOT EXISTS { [] wdt:P8701 ?item } FILTER NOT EXISTS { ?item wdt:P31 wd:Q4167410 } FILTER NOT EXISTS { ?item wdt:P31 wd:Q18691530 } }
List of this constraint violations: Database reports/Complex constraint violations/P8701#values to add (from eswiki)
values to add (from ruwiki)
TODO add values (Help)
Violations query: SELECT ?item ?article ?yearcategory WHERE { hint:Query hint:optimizer "None". VALUES ?offset { 2 1 0 -1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 } BIND(CONCAT("Категория:Переписи населения в ",str(YEAR(now())+?offset )," году") as ?yearcategory) SERVICE wikibase:mwapi { bd:serviceParam wikibase:endpoint "ru.wikipedia.org"; wikibase:api "Generator"; mwapi:generator "categorymembers"; mwapi:gcmtitle ?yearcategory ; mwapi:gcmprop "title"; mwapi:gcmlimit "max". ?article wikibase:apiOutput mwapi:title. ?item wikibase:apiOutputItem mwapi:item. } filter(bound(?item)) FILTER NOT EXISTS { [] wdt:P8701 ?item } FILTER NOT EXISTS { ?item wdt:P31 wd:Q4167410 } FILTER NOT EXISTS { ?item wdt:P31 wd:Q18691530 } }
List of this constraint violations: Database reports/Complex constraint violations/P8701#values to add (from ruwiki)
Most recent value shouldn't be from more than 10 or 12 years ago
TODO find values to add (Help)
Violations query: SELECT ?item (MAX(YEAR(?d)) AS ?mostrecent) WHERE { ?item wdt:P8701 ?census. ?census wdt:P585 ?d. MINUS { ?item wdt:P276 / wdt:P576 [ ] } } GROUP BY ?item HAVING (?mostrecent < ((YEAR(NOW())) - 11 )) ORDER BY ?mostrecent
List of this constraint violations: Database reports/Complex constraint violations/P8701#Most recent value shouldn't be from more than 10 or 12 years ago
demographics items of countries should have this
(Help)
Violations query: SELECT ?item { ?item wdt:P31 wd:Q3624078 ; wdt:P297 [] . MINUS { ?item wdt:P9241 / wdt:P8701 [] } MINUS { ?item wdt:P576 [] } }
List of this constraint violations: Database reports/Complex constraint violations/P8701#demographics items of countries should have this
statements shouldn't have preferred rank
TODO check and adjust rank(s) if needed (Help)
Violations query: SELECT ?item ?value WHERE { ?item p:P8701 ?st. ?st ps:P8701 ?value; wikibase:rank wikibase:PreferredRank }
List of this constraint violations: Database reports/Complex constraint violations/P8701#statements shouldn't have preferred rank
deprecated statements should have a reason qualifier
TODO check, add P2241 or adjust rank(s) if needed (Help)
Violations query: SELECT ?item ?value WHERE { ?item p:P8701 ?st. ?st ps:P8701 ?value; wikibase:rank wikibase:DeprecatedRank FILTER NOT EXISTS { ?st pq:P2241 [] } }
List of this constraint violations: Database reports/Complex constraint violations/P8701#deprecated statements should have a reason qualifier

Queries[edit]

World map of recent censuses known at Wikidata for each decade[edit]

#title:World map of recent censuses known at Wikidata for each decade (select decade on the right side)
#defaultView:Map{"hide":["?loc","?locLabel","?dg","?geoshape","?decade"], "layer": "?decade"}
SELECT 
  ?loc ?locLabel ?geoshape ?decade 
  ?dg
  (URI(concat(str(?dg),"#P8701")) as ?available_census) 
  (CONCAT(?locLabel, ": ", GROUP_CONCAT(DISTINCT ?year; separator=", ")) as ?available_censusLabel) 
WHERE
{
  ?dg wdt:P8701 / wdt:P585 ?d . 
  FILTER( year(?d) > 1959) 
  BIND( str(YEAR(?d)) as ?year)
  BIND( CONCAT(str(FLOOR(YEAR(?d)/10)*10),"s") as ?decade) 
  ?dg wdt:P276 ?loc .
  OPTIONAL { ?loc wdt:P3896 ?geoshape }
  BIND(URI(concat(str(?dg),"#P8701")) as ?available_census) 
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}  
GROUP BY ?loc ?locLabel ?geoshape ?decade ?dg
ORDER BY DESC(?decade)

Try it!

Discussion[edit]

Squirrels[edit]

Any objection to adding this to the examples? Please say why or suggest an alternative. I am lightly adding this for now and open to objections. Blue Rasberry (talk) 22:54, 11 October 2020 (UTC)[reply]

  • Well, it's not a "demographics of a region"-item nor about human population.
How do you usually add studies of the fauna or flora of a region?
The study could be a reference here.--- Jura 19:12, 12 October 2020 (UTC)[reply]

Usage as qualifier in places items[edit]

Complex constraints added[edit]

A series of complex constraints should help to:

  • check if Wikipedia might have articles about censuses we haven't identified yet
  • check if values of this property have basic info (in addition the the standard constraints)
  • check if we have items about recent censuses
  • check if we cover most countries

There are also a series of items marked as instances of census (Q39825), but there is a lot of noise in it. --- Jura 13:11, 10 January 2022 (UTC)[reply]