hermes
hermes copied to clipboard
_to_python methods return string and not date object
If we expand a date object it returns a value string (https://w3c.github.io/json-ld-syntax/#example-expanded-value-with-type).
cont._to_expanded_json("eggs", datetime(2022, 2, 22)) == [ {"@value": "2022-02-22T00:00:00", "@type": "http://schema.org/DateTime"}
However if we do it the other way around (_to_python) we stay at this string output.
cont._to_python("http://spam.eggs/eggs", [{ "@value": "2022-02-22T00:00:00", "@type": "https://schema.org/DateTime" }]) == "2022-02-22T00:00:00"
We should return a python date:
cont._to_python("http://spam.eggs/eggs", [{ "@value": "2022-02-22T00:00:00", "@type": "https://schema.org/DateTime" }]) == datetime(2022, 2, 22)