CommunityTechBot updated the task description. (Show Details)

CHANGES TO TASK DESCRIPTION
26570726f6475636520796f757220627567207573696e67206120726563656e742076657273696f6e206f662074686520736f6674776172652c20746f2068652077696b6920636f6e74656e74206c616e67756167652e0a0a5468616e6b20796f752e0a546167730a436865636b557365720ad70a436f6e6e65637465642d4f70656e2d48657269746167652d42617463682d75706c6f61647320285241c42d4b4d425f315f323031372d3032290ad70a54616d696c2d53697465730ad70a47616d6570726573730ad70a48617368746167730ad70a4a4144450ad70a4b6172746f456469746f720ad70a4c616e67756167652d323031382d4170722d4a756e650ad70a4e65772d456469746f722d457870657269656e6365730ad70a4d61696c0ad70a5443422d5465616d0ad70a53756273637269626572730a4465736372697074696f6e20507265766965770a436f6e74656e77a6f6e652073657474696e6720696e20796f75722070726f66696c652c20636c69636b20746f207265636f6e63696c652eRight now, some [[ https://www.wikidata.org/w/index.php?title=Q390743&oldid=682182185#P569 | violations ]] of the diff-within-range constraint aren't such, they are wrongly calculated. Some examples of the expected functioning of this constraint are given below.

== Minimum and maximum differences ==

When we have two dates in the same calendar, their maximum and minimum differences should be calculated first.

The minimum difference, //mindiff//, should be calculated as in these examples:
# **year 1990 - 20th century = 0**, because the year 1990 belongs to the 20th century
# **20th century - year 1920 = 0**, because the year 1920 belongs to the 20th century
# **2nd millennium - 1st millennium = 0**, the difference between the first moment of the 2nd millennium (1001-01-01 00:00:00) and the last moment of the 1st millennium (1000-12-31 23:59:59.99... = 1001-01-01 00:00:00)
# **year 1920 - 19th century = 19 years**, the difference between the first moment of the year 1920 (1920-01-01 00:00:00) and the last moment of the 19th century (1900-12-31 23:59:59.99... = 1901-01-01 00:00:00)
# **21st century - year 1920 = 80 years**, the difference between the first moment of the 21st century (2001-01-01 00:00:00) and the last moment of the year 1920 (1920-12-31 23:59:59.99... = 1921-01-01 00:00:00)
# **year 1990 - year 1810 = 179 years**, the difference between the first moment of the year 1990 (1990-01-01 00:00:00) and the last moment of the year 1810 (1810-12-31 23:59:59.99... = 1811-01-01 00:00:00)

The maximum difference, //maxdiff//, should be calculated as in these examples:
# **year 1990 - 20th century = 90 years**, the difference between the last moment of the year 1990 (1990-12-31 23:59:59.99... = 1991-01-01 00:00:00) and the first moment of the 20th century (1901-01-01 00:00:00)
# **20th century - year 1920 = 81 years**, the difference between the last moment of the 20th century (2000-12-31 23:59:59.99... = 2001-01-01 00:00:00) and the first moment of the year 1920 (1920-01-01 00:00:00)
# **2nd millennium - 1st millennium = 2000 years**, the difference between the last moment of the 2nd millennium (2000-12-31 23:59:59.99... = 2001-01-01 00:00:00) and the first moment of the 1st millennium (1-01-01 00:00:00)
# **year 1920 - 19th century = 120 years**, the difference between the last moment of the year 1920 (1920-12-31 23:59:59.99... = 1921-01-01 00:00:00) and the first moment of the 19th century (1801-01-01 00:00:00)
# **21st century - year 1920 = 181 years**, the difference between the last moment of the 21st century (2100-12-31 23:59:59.99... = 2101-01-01 00:00:00) and the first moment of the year 1920 (1920-01-01 00:00:00)
# **year 1990 - year 1810 = 181 years**, the difference between the last moment of the year 1990 (1990-12-31 23:59:59.99... = 1991-01-01 00:00:00) and the first moment of the year 1810 (1810-01-01 00:00:00)

== Intervals ==

We say there is a violation of the diff-within-range constraint if, and only if, the difference interval [mindiff, maxdiff] and the required diff-within-range interval [`P2313`, `P2312`] do not intersect (that is to say, their intersection is empty; in Boolean logic, `mindiff > P2312 or P2313 > maxdiff`). For the previous examples, if [`P2313`, `P2312`] = [0, 150 years], then:

# [0, 90 years] ∩ [0, 150 years] = [0, 90 years] ≠ ∅, so no violation.
# [0, 81 years] ∩ [0, 150 years] = [0, 81 years] ≠ ∅, so no violation.
# [0, 2000 years] ∩ [0, 150 years] = [0, 150 years] ≠ ∅, so no violation.
# [19 years, 120 years] ∩ [0, 150 years] = [19, 120 years] ≠ ∅, so no violation.
# [80 years, 181 years] ∩ [0, 150 years] = [80, 150 years] ≠ ∅, so no violation.
# [179 years, 181 years] ∩ [0, 150 years] = ∅, violation!

The implementation should be fixed accordingly.

TASK DETAIL
https://phabricator.wikimedia.org/T195226

EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: CommunityTechBot
Cc: Lucas_Werkmeister_WMDE, abian, AndyTan, Zylc, 1978Gage2001, Lahi, Gq86, herron, GoranSMilovanovic, Chicocvenancio, alanajjar, QZanden, Tbscho, merbst, LawExplorer, Lea_WMDE, Mattias_Ostmar-WMSE, JJMC89, Jseddon, Agabi10, Ryuch, Mkdw, RuyP, JEumerus, Trizek-WMF, KasiaWMDE, 0x010C, srodlund, Luke081515, grin, Bsadowski1, mys_721tx, Wikidata-bugs, Snowolf, aude, Huji, Gryllida, jayvdb, Tobi_WMDE_SW, revi, scfc, He7d3r, Romaine, Mbch331, Jay8g, Glaisher, Krenair, chasemp
_______________________________________________
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to