1

I have a prolog implementation which allows me to compare time points in events using a prolog-based representation of the 13 Allen's relationships. Each event has a start point (YYYY-MM-DD) and an end point (YYYY-MM-DD) and I can check whether two events happened at the same time or one is before another, etc up to the day granularity (e.g. 1555-12-03 is before 1555-12-04). It does work ok with so called AC dates (Anno Domini), but now I have a good number of events which happened BC (before Christ). What is a best way to handle those BC events and be able to say, for instance, that the foundation of Athens (BC 1556) is before the birth of Colombus (1451).....Any idea is more than welcome.

Thanks,

I.

panza
  • 1,341
  • 7
  • 38
  • 68

2 Answers2

1

I believe he's asking whether your dates are stored in various predicates or if they're only specified in a single date predicate, e.g., a_date(12345, "12-24-2011") where the first field is an ID field. That is, do you store dates as something like

a_date(event_id,date_value)

where date_value's format is YYYY-MM-DD?

One solution: require "AD" or "BC" in the date string, with the default being "BC", and treating the absence of either as being "AD".

Another solution: Create a new date predicate, call it

a_date(even_id, date_value,flag)

where flag is either bc or ad. If flag is ad, math goes on as usual. If flag is bc, branch to new code that does the appropriate math. Existing date predicates of the form a_date(event_id, date_value) would be interpreted as a_date(event_id, date_value, "AD")

That is, in code

a_date(event_id, date_value) := a_date(event_id, date_value, "AD")

tndal
  • 11
  • 1
0

How are you storing your date? If it's in your own struct then include the AD or BC, and use this as a kind of negative flag, BC treating years as negative, AD treating years as positive.

John Warlow
  • 2,922
  • 1
  • 34
  • 49
  • My dates are represented as YYYY-MM-DD and they are attached to the event via and unique ID. Not always I am able to attach MM-DD so in case they are missing, they are simply replaced using 00-00 which stand as unknown. Then I have rules where arithmentical operators check whether Y1 – panza Nov 25 '10 at 17:21
  • Sorry, my message got cut off, will BC and AD as label affect the comparison mechanism via time points? Thanks for your very quick reply. I. – panza Nov 25 '10 at 17:22
  • I'm thinking you'll need AD or BC, otherwise how do you know if the year 250 is BC or AD?. For e.g. two dates 2000-10-01 and 2000-12-01, you'd assume 2000-12-01 was after 2000-10-01, but if 2000-10-01 was an AD date and 2000-12-01 was a BC date, the comparison was wrong. – John Warlow Nov 26 '10 at 09:29