Help:Property constraints portal/Recency
This is the documentation page for a particular constraint type. See Help:Property constraints portal for a general overview of property constraints. |
complex constraint recency (Q102173107) specifies that the most recent value of a property on an item shouldn't be older than a given period of time. This is determined by the point in time (P585)-qualifier and the current date.
For example, the values for employees (P1128) are generally published once a year. Accordingly, one could define that the time period between today and the date used with P1128 shouldn't exceed 2 years.
It can be suitable for properties with quantity-datatype that have a required qualifier constraint for point in time (P585) and regularly get new values (e.g. once a year).
It is different from constraints for time-datatype properties: contemporary constraint, range constraint and the difference within range constraint.
Units for duration can be days, weeks, months, years. Calculation is done in days.
Given the infrastructure of Wikidata, it may not be desirable to store values more frequently than once a year. Accordingly, the time period would generally be minimum a year.
Contrary to standard property constraints, this constraint is added with has characteristic (P1552) on properties. As a complex constraint, it also requires the addition of {{Complex constraint}}
to the property talk page.
The output is available only as a periodically updated report at Wikidata:Database reports/Complex constraint violations. It is limited to a specified number (generally 500 items). Consequently, it may not be suitable for population (P1082).
Note that the constraint wont check items that have some end date:
Possible actions
editThe report with the constraint violations allows to do a top-down analysis. It shows the gap between available data and an ideal situation.
- When querying and using data, one should bear in mind that gap.
- If suitable data is available, one could add recent values.
- If an item lacks an applicable end date, one could add that.
Also:
- It’s possible that the time period needs to be adjusted.
Parameters
editThis constraint has one mandatory and one optional parameter:
- duration (P2047)
- Contains maximum recency of data. It should have just one value. Units can be days, weeks, months, years. no value Help or unknown value Help are not permitted.
- syntax clarification (P2916)
- Contains a human-readable description. Can be specified several times in different languages.
Examples
editExample 1
editValues for employees (P1128) should be updated once per year, so the most recent values for shouldn't be older than 2 years.
employees |
| ||||||||||||
add value |
Example 2
editValues for count of students (P2196) should be updated at least once per decade, so the values should generally not be older than 12 years.
count of students |
| ||||||||||||
add value |
Template
editTo define the constraint, {{Complex constraint}}
with a sparql query needs to be added to the property's talk page.
This can be done by adding:{{subst:Define recency constraint}}
Lists
editStatistics
editBy property
editWikidata:WikiProject property constraints/reports/recency