Seems to me you’re trying to manage two concepts you cannot record as one: “happened at time” and “time taken to occur”.
I’ve seen both xsd:duration and xsd:dateTime used in real, operational ontologies in customer projects. However, the main use I’ve seen for xsd:duration is properties about things that live for years like "equipment life”. For data about experiments or similar, I’ve seen xsd:dateTime used far more often. A few alternatives: 1 - Perhaps two dateTime properties of the action/activity are all you need: startedOrHappenedAt and endedAt. If endedAt is missing then you know it happened instantly, if not then duration = endedAt - startedOrHappenedAt. 2 - Alternatively, you could use startedAt and endedAt and set endedAt to have the same value as startedAt for the “instantly” case. 3 - Alternatively, choose the smallest value allowed for xsd:duration and use that to mean “instantly”. People sometimes choose a seldom-used value of a datatype and give it a specific meaning. The advantage of 2 is that you also record when something happened, not just how long it took to happen, and so you can order activities and also always calculate if activities overlapped in time. 1 is one less triple in the “instantly” case. 3 is perhaps best if you are only ever comparing how long things took, not when they happened. A fourth option you might consider is two subclasses of Activity: InstantaneousActivity and ContinuousActivity rather than trying to use a Boolean (which very often means a subclass is missing). Cheers, David > On 31 Jul 2019, at 10:12, Stefan Verweij <[email protected]> wrote: > > I have a new question regarding the class 'time' in this ontology. I found a > simpler datatype xsd:duration > <http://www.datypic.com/sc/xsd/t-xsd_duration.html> resulting in a single > attribute 'has duration' (sh:datatype xsd:duration ;) with the format > PnYnMnDTnHnMnS. > > In some cases there is no duration and things happen instantly at t=0 (e.g. > in the case of experiments). The datatype xsd:duration forbids t=0 however. > Now I can choose to make the attribute 'has duration' optional by only > setting a max count of 1. However, I would like time to be mandatory to avoid > any ambiguity between a thing, let's say an experiment happening at t=0 > (possible) or an experiment where the scientist simply forgot to mention its > duration (not possible!!!). Therefore I created a boolean attribute 'is > instant'. Now I would like to link this boolean attribute to my attribute > 'has duration' in a way that if 'is instant'=False it leads to the > co-existence of 'has duration', but if 'is instant=True there is no 'has > duration'. I thought of using 'co-existence with', but I can only link this > to a property and not to the value of that property. > > is instant=True --> nothing > is instant=False --> 'has duration'=P5Y > > Or if there is a better way of describing this relationship, please let me > know! > > Stefan > > > Op donderdag 25 juli 2019 15:10:54 UTC+2 schreef Irene Polikoff: > Have you tried adding sh:datatype XSD:integer constraint? Or do you want > values to be strings? > > -- > You received this message because you are subscribed to the Google Groups > "TopBraid Suite Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] > <mailto:[email protected]>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/topbraid-users/d8992643-d56c-4579-b1e3-ab406af547be%40googlegroups.com > > <https://groups.google.com/d/msgid/topbraid-users/d8992643-d56c-4579-b1e3-ab406af547be%40googlegroups.com?utm_medium=email&utm_source=footer>. UK +44 (0) 7788 561308 US +1 (336) 283-0808 -- You received this message because you are subscribed to the Google Groups "TopBraid Suite Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/F2F869C0-1538-4D61-B232-B2118F6E1C0F%40topquadrant.com.
