0

I have a class and i make it equivelent to this restriction

Rates and createdOn value "2016-01-01T09:00:00+00:00"^^dateTime

where Rates is a class and createdOn is a data type property has domain as a date time

what i did is not what i want to do because i want to say something like:

all the dates that are greater than 2016 january first

i though that could be done by two ways but i don't know if owl support any of them

first i thought :

Rates and createdOn value > "2016-01-01T09:00:00+00:00"^^dateTime

but protege told me that we can't put >

then i though that if there is a way to just check the year of the date, but also i don't know how to do that

could you help please ?

Ania David
  • 1,168
  • 1
  • 15
  • 36
  • You need to enter the range as xsd:dateTime[>= "2016-01-01T00:00:00"^^xsd:dateTime], see my edit on the answer – Ignazio Mar 09 '16 at 07:30
  • @Ignazio i think not sub class of but equivelent is the correct, what do u think? – Ania David Mar 09 '16 at 10:19
  • But your problem is the syntax of the data range restriction. Whether it should be subclass or equivalent class depends on your requirements. – Ignazio Mar 09 '16 at 11:43
  • @Ignazio where is the wrong syntax that I did please? I used your syntax fro the question, and sub class of didn't work, but equivelent did. I already told you why, and think please about it, if r1 is a Rating and its createOn is marck 2016, that doesn't mean it is from Rating2016 class, have you seen please my question yesterday ? https://stackoverflow.com/questions/35880781/why-inference-is-not-working-well – Ania David Mar 09 '16 at 12:06
  • "But protégé told me that we can't put >" I'm referring to this. You should replace 'value > .....' with xsd:dateTime[...] as I suggested – Ignazio Mar 09 '16 at 12:36
  • @Ignazio Yeah, I did that already, thank you – Ania David Mar 09 '16 at 12:44

1 Answers1

4

You need to use a DatatypeRestriction:

Declaration(Class(example:Rates))
Declaration(DataProperty(example:createdOn))
Declaration(Datatype(xsd:dateTime))
DataPropertyRange(example:createdOn DatatypeRestriction(xsd:dateTime xsd:minInclusive "2016-01-01T00:00:00"^^xsd:dateTime))
SubClassOf(DataSomeValuesFrom(example:createdOn rdfs:Literal) example:Rates)

Edit: In Manchester syntax, these facets are written like this:

Class: <http://example.org#Rates>

SubClassOf: 
    <http://example.org#createdOn> some xsd:dateTime[>= "2016-01-01T00:00:00"^^xsd:dateTime]
Ignazio
  • 10,504
  • 1
  • 14
  • 25
Daniele Pantaleone
  • 2,657
  • 22
  • 33
  • maybe equivlent class is the correct one not sub class of, right please ? – Ania David Mar 09 '16 at 10:19
  • It depends on what you are trying to express. You can check this thread for the differences among the two: http://stackoverflow.com/questions/4192435/owls-equivalentclass-vs-subclassof/4201833 – Daniele Pantaleone Mar 09 '16 at 10:39
  • in this senario, i believe the equivelent is the correct one, because in the case of sub class of, if i have an instance that is from type Ratings and its createOn is bigger than 2016, the reasoner will not infer that this instance is also from type Ratings2016, but if it was equivelent, the reasoner will understand that. – Ania David Mar 09 '16 at 10:43