ADR 40: Date Property Types
Date: 2026-11-23
Status: Accepted
Context
Many wikis record some dates as only a year or a month: the year a company was founded, the month a project started. Heritage wikis also record dates the way their sources give them: "c. 1850", "1620s", "between 1980 and 1985". A Property Definition of type Date accepts only a full day.
Each Statement records the Property Type its property had when the value was written (ADR 11), not the property's Constraints. API clients, Lua modules, exports and other wikis read a value by that type.
Decision
NeoWiki has three date Property Types:
| Property Type | Holds | Examples |
|---|---|---|
Date (date) | a day, a month or a year | 1984-06-15, 1984-06, 1984 |
Date & Time (dateTime) | a date with a time of day | 1984-06-15T14:30:00+02:00 |
EDTF date (edtf) | any value in the Extended Date/Time Format | 1850~, 1640/1650, 162X |
A wiki has EDTF date only when an administrator enables it.
Date takes the three forms XML Schema has datatypes for: xsd:date, xsd:gYearMonth and xsd:gYear.
A Property Definition of type Date asks for a full date unless its minPrecision Constraint allows a month or a year. A less precise value gets a Violation, a warning by default.
EDTF date takes every value the EDTF library parses.
Values of all three date Property Types are in the proleptic Gregorian calendar.
Consequences
- Someone entering a Date value sees no EDTF syntax and no calendar choice.
- Programs that read Date values must now handle a year or a month, not only a day.
- On a wiki without EDTF date, its values, for example from an imported Schema, are kept unchanged but not validated, and they stay out of queries.
- On wikis that enforce validation, a year entered for an existing Property Definition of type Date now warns instead of blocking, unless the Schema sets its
minPrecisionto"day"with severityerror. - Changing a Property Definition between Date and EDTF date converts nothing: its existing values get
type-mismatch. - Julian dates need no decision now. Support for them can be added later on top of these types, and values stored until then stay valid as Gregorian dates.
- A Julian date entered as written is read as Gregorian. A day can be converted before entry; a year or a month only into an EDTF interval.
Implementation Thoughts
- Neo4j holds each Date value as its earliest and latest day. EDTF date values keep their text and get those days too where they have both.
- The first EDTF date input takes typed EDTF and shows the date in words, like in Wikibase EDTF.
Alternatives Considered
One date type for all of EDTF
Date accepts every EDTF value, and Constraints narrow each property to what it needs: full dates, years, or approximate dates.
Not chosen because a Date value's type would then no longer tell a program which forms the value can take; only the Constraints of its property would. So every program that reads Date values would need an EDTF parser.
Date for full days only
Date keeps taking only a full day, and years and months go to EDTF date.
Not chosen because years and months are the most common imprecise dates, and a wiki should not need EDTF to record them.
A timestamp with a precision
Each Date value stores a full timestamp plus a precision, as Wikibase does.
Not chosen because a year then carries month and day digits that every reader must know to ignore, and the timestamp and the precision can disagree.