mediawikisemantic-mediawikigenealogy

Relative dates in Semantic Mediawiki?


Is there a way in Semantic Mediawiki to store and use relative dates?

I would like to store genealogical data in Semantic Mediawiki and there is sometimes information like: »On January 10th 2021 John, son of the deceased Jack, married Mary.« Now I know that Jack died BEFORE 2021-01-10. Is there any way to store (and query) such information -- BEFORE 2021-01-10 -- in a date property, just like in GEDCOM format?


Solution

  • To store such data, you can define Record datatype:

    Property:Relative date of birth:

    [[Has type::Record]]
    [[Has fields::Sign;Date value]]
    

    Property:Date value:

    [[Has type::Date]]
    

    Property:Sign:

    [[Has type::Text]]
    [[Allows value::Before]]
    [[Allows value::Exactly]]
    [[Allows value::After]]
    

    To store data, use [[Relative date of birth::Before;January 9th, 1976]].

    Querying such data is not an easy task. For an exact day, use {{#ask:[[Relative sate of birth::Exactly;January 9th,1976]]}}. To query for people born before the 9th of January 1976, you need a more complicated query, or a union of queries: {{#ask:[[Relative sate of birth::Exactly||Before;<January 9th,1976]]|?Relative date of birth.Date value=date}}.