1

I've a Data Property ShowTime with domain Show and range xsd:dateTime. I'd like to know if there is a way to assert that the dataTime range must be included in "2018-01-01TX:X:X", in order to have a fixed date and a variable hour on that date.

I've tried with Manchester Syntax:

xsd:dateTime[>="2018-01-01T00:00:00"^^xsd:dateTime, <"2018-01-01T00:00:00"^^xsd:dateTime]

But told me that the syntax is not correct.

P.S. I'm using HermiT.

Can someone help me? Thanks.

edited

Concrete example. Suppose we have a Show class, which represents the concept of a cinema show. Each show has date and a start time. So, we can trivially represent these informations through a data property showDateTime with domain Show and range xsd:dateTime (something like "2018-01-16T18:00:00").

The problem is that i need to categorize each show in a daily time slot (morning, afternoon, early evening, late night) according to the start time only. I tried with SWRL, property restriction... I haven't found a way to tell the reasoner not to consider the date, which obviously takes precedence over the time and messes me up.

So, i thought of dividing date and time into two separate properties (showDate and showTime), always of type xsd: dateTime, and placing a restriction on showTime binding it to have a fixed date (ex. 2018-01-01). In this way I could define the MorningShow class as follow:

 showTime some xsd:dateTime[>= "2018-01-01T07:00:00"^^xsd:dateTime ,
 <= "2018-01-01T13:00:00"^^xsd:dateTime]

This is the reason for my question.

Vladimir Salin
  • 2,951
  • 2
  • 36
  • 49
Cilla
  • 419
  • 5
  • 16

1 Answers1

2

Manchester syntax enables you to create OWL ontologies. However, the semantics of OWL does not allow for what you are trying to do.

EDIT for your updated question

Defining the MorningShow class as you described is not going to work because:

(1) There is no way to dynamically change the definition of the class as you described.

(2) More importantly, it goes against the notion of a class which gives a fixed description of a set to which individuals belong/don't belong. What you have in mind boils down to a different MorningShow class for every possible date.

I was thinking there may be a way in SWRL in Protege to apply some function that will extract only the time. However, this is not the case.

The only other options are:

(1) Consider using the Time Ontology in OWL, though it may be an overkill.

(2) Define your own DateTime class which is the domain for the following data properties:

i. date with range xsd:dateTime,

ii. hours with range xsd:byte,

iii. minutes with range xsd:byte

ObjectProperty: showTime
    Domain:Show
    Range: DateTime

DataProperty: date
    Domain: DateTime
    Range: xsd:dateTime

DataProperty: hours
    Domain: DateTime
    Range:  xsd:byte[>= "0"^^xsd:byte , < "24"^^xsd:byte]

DataProperty: minutes
    Domain: DateTime
    Range: xsd:byte[>= "0"^^xsd:byte , < "60"^^xsd:byte]

Class: Afternoon
    EquivalentTo: hours some xsd:byte[>= "12"^^xsd:byte , < "17"^^xsd:byte]
    SubClassOf: DateTime

Class: DateTime
Class: Morning
    EquivalentTo: hours some xsd:byte[< "12"^^xsd:byte]
    SubClassOf: DateTime

Class: Show
    SubClassOf: showTime some ShowTime

Class: ShowTime
    SubClassOf: showTime exactly 1 DateTime

Individual: dt
    Facts: hours  "8"^^xsd:byte 
Henriette Harmse
  • 4,167
  • 1
  • 13
  • 22
  • Thanks a lot for your answer. I apologize if I have not explained well. I modified the question by adding more information. If you can help me, you'd really help me. – Cilla Jan 16 '18 at 09:27
  • @Cilla Your edit does make your question much clearer. Thanks. I will re-visit and hopefully I will be able to post an update in the next 24 hours. – Henriette Harmse Jan 16 '18 at 15:46
  • Thank you so much again! – Cilla Jan 16 '18 at 17:56
  • can i do math with datetime in OWL ? – crapthings Jun 13 '18 at 08:46
  • @HenrietteHarmse `showTime` objectproperty domain is `show`, and `showTime` class is defined as `SubClassOf: showTime exactly 1 DateTime`. regarding to `show` domain , is that a correct definition ? – alex Jan 08 '20 at 15:23
  • 1
    @amin Yes. You can see more about this on my blog [here](https://henrietteharmse.com/2017/11/03/associations-between-classes/). – Henriette Harmse Jan 09 '20 at 15:09
  • @HenrietteHarmse thanks. I reviewed blog post, but i didn't get the answer. here we have a `showtime` objectProperty with domain `show` , that is assigned to a class (showTime class) that is NOT of `show` type.in fact it may infer that `show` and `showTime` are the same class – alex Jan 09 '20 at 16:08