Repository: LeMyst/WikibaseIntegrator

Issue:
Add missing WikibaseTimePrecision values
Currently the time precision values  `[1,2,5]` are missing in WikibaseTimePrecision leading to errors when editing pages that contain these precision values in one of their snaks. 

https://github.com/LeMyst/WikibaseIntegrator/blob/389a84d442c4f8e852ceb03e9192cbe97d08820e/wikibaseintegrator/wbi_enums.py#L61-L73

[Query to get a sample for each time precision](https://w.wiki/Bws$)

>Documentation on the missing precison values is hard to find but the Wikidata user interface provides their names in the precision dropdown selection.
>![Screenshot from 2024-11-07 00-21-21](https://github.com/user-attachments/assets/964ee1bc-2f67-4478-a01c-7689814f0343)

Discussion:
@LeMyst: Hello,
Thanks, I used https://www.wikidata.org/wiki/Help:Dates#Precision to create the list and 1, 2 and 5 are missing from here.
Gonna merge the PR and maybe update the list.

Solution patch:
diff --git a/wikibaseintegrator/wbi_enums.py b/wikibaseintegrator/wbi_enums.py
index b1ee1eec..b238da46 100644
--- a/wikibaseintegrator/wbi_enums.py
+++ b/wikibaseintegrator/wbi_enums.py
@@ -68,6 +68,9 @@ class WikibaseTimePrecision(Enum):
     DECADE = 8
     CENTURY = 7
     MILLENNIUM = 6
+    TEN_THOUSAND_YEARS = 5
     HUNDRED_THOUSAND_YEARS = 4
     MILLION_YEARS = 3
+    TEN_MILLION_YEARS = 2
+    HUNDRED_MILLION_YEARS = 1
     BILLION_YEARS = 0


Test patch:
diff --git a/test/test_wbi_core.py b/test/test_wbi_core.py
index afef470e..e9db809f 100644
--- a/test/test_wbi_core.py
+++ b/test/test_wbi_core.py
@@ -232,6 +232,9 @@ def test_new_item_creation(self):
             Time(time='+2021-01-00T00:00:00Z', before=1, after=2, precision=WikibaseTimePrecision.MONTH, timezone=4, prop_nr='P5'),
             Time(time='+2021-00-00T00:00:00Z', before=1, after=2, precision=WikibaseTimePrecision.YEAR, timezone=4, prop_nr='P5'),
             Time(time='+2021-00-00T00:00:00Z', before=1, after=2, precision=WikibaseTimePrecision.DECADE, timezone=4, prop_nr='P5'),
+            Time(time='-13700000000-00-00T00:00:00Z', before=0, after=0, precision=WikibaseTimePrecision.HUNDRED_MILLION_YEARS, timezone=0, prop_nr='P585'),
+            Time(time="-2450000000-00-00T00:00:00Z", before=0, after=0, precision=WikibaseTimePrecision.TEN_MILLION_YEARS, timezone=0, prop_nr='P585'),
+            Time(time="-40000-00-00T00:00:00Z", before=0, after=0, precision=WikibaseTimePrecision.TEN_THOUSAND_YEARS, timezone=0, prop_nr='P585'),
             URL(value="http://www.wikidata.org", prop_nr='P6'),
             URL(value="https://www.wikidata.org", prop_nr='P6'),
             URL(value="ftp://example.com", prop_nr='P6'),