w3c / sdw

Repository for the Spatial Data on the Web Working Group
https://www.w3.org/2020/sdw/
150 stars 81 forks source link

RIF rules for OWL-Time #1236

Open dr-shorthair opened 3 years ago

dr-shorthair commented 3 years ago

Many (all?) of the relations in OWL-Time could be expressed as Rules.

For example interval after is defined "If a proper interval T1 is intervalAfter another proper interval T2, then the beginning of T1 is after the end of T2." and time disjoint as "If a temporal entity T1 is disjoint with another temporal entity T2, then the beginning of T1 is after the end of T2, or the end of T1 is before the beginning of T2, i.e. the two entities do not overlap or coincide in any way, but their ordering relationship is not known."

These look like a good candidate for formalization using RIF.

oldskeptic commented 3 years ago

Adding my +1 of support.

nicholascar commented 3 years ago

RIF is "nice" but I don't see it in use. All the docs are old and the W3C Community Group seems to be inactive. In ~10 years of Semantic Web work, I've not encountered RIF for real until just now in GeoSPARQL.

So should we be using RIF? Please, RIF champions, tell me we should! I'm reaching out to some via email.

chris-little commented 3 years ago

I am slightly nervous of this RIF work. I read that the 'built in' entities in both basic formats allow arithmetic (addition, subtraction, division and multiplication) on dateTime, date and time components. This is not watertight, Even if calendars are restricted to Gregorian, it is dubious whether leap-seconds, or even leap-days, have been correctly implemented.

nicholascar commented 3 years ago

Perhaps you editors of TIME could supply a test suite of functions and correct results for implementers of time functions to validate against? As GeoSPARQL has for its functions?

dr-shorthair commented 3 years ago

What does 'a test suite of functions and correct results' look like? Could you give a link to the GeoSPARQL case?

nicholascar commented 3 years ago

OK, probably a better example than GeoSPARQL are the W3C standards that provide Test Cases like OWL2 (https://www.w3.org/TR/2012/REC-owl2-conformance-20121211/#Test_Cases) and a test suite for implementation testing like SHACL (https://w3c.github.io/data-shapes/data-shapes-test-suite/).

You, editors, could provide a few test cases for time calculations and then call for implementations that claim conformance to it to be tested. In this way, we could test out RIF's calculators.

But: surely RIF's calculators are dependent on underlying system datetime implementations? If I produce a RIF interpreter that does a temporal calculation, I would need to use Java or Python etc. to do the work which is then reported in a RIF document?

So, what systems do you think are/could/should do the right thing regarding OWL TIME's leap second etc. handing, if you think OWL TIME has something to say here? Perhaps TIME just refers to other specs?

chris-little commented 3 years ago

@nicholascar There are some date/time edge cases that are useful for a temporal test suite. See Mark Hedley's work in OGC Topic 2: Referencing by Coordinates Abstract Specification and in particular the Examples in Annex D.

dr-shorthair commented 3 years ago

I am aware that there are many edge-cases, as illustrated in your and Mark's work and comments. However, we don't even have the main cases formally implemented, so that work should be done first.

My goal with the test suite (currently in the branch https://github.com/w3c/sdw/tree/time-test-suite/time/test-suite) is just to exercise the comparison logic for all the relations, using the simplest implementation of temporal position (i.e. the built-in xsd:dateTimeStamp). There are many more ways to specify a temporal position in OWL-Time, but I just wanted to test the temporal topology logic first. Then I suggest that we look at (a) verifying that different representations of the same time evaluate equale, (b) the edge-cases you referred to above, using a separate test suite aimed only at testing each of those.