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: Thanks for your PR.
I wonder how I missed that yesterday when I renamed the class.
Gonna check this tomorrow, merge and probably release a new version if I have enough time.

Patch:
diff --git a/wikibaseintegrator/wbi_enums.py b/wikibaseintegrator/wbi_enums.py
index b1ee1ee..b238da4 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 afef470..e9db809 100644
--- a/test/test_wbi_core.py
+++ b/test/test_wbi_core.py
@@ -232,6 +232,9 @@ class TestWbiCore(unittest.TestCase):
             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'),