2

I have an ontology, where Person is a class and hasDeathYear is a data property. I have to express the title in a DL query.

I can ask this:

Person and hasDeathYear value 2016

but I cannot ask something like this:

Person and hasDeathYear min 2016

where in place of min I would actually like to express "less than".

How to do it? Is it possible? A negative answer would also suffice for me.

gsamaras
  • 71,951
  • 46
  • 188
  • 305

1 Answers1

3

If the year is stored as value on which datatype facets are supported, you can do this with a DL query like:

        Person and (hasDeathYear some xsd:int [<= 2016])

Some of these questions and answers have more examples:

Community
  • 1
  • 1
Joshua Taylor
  • 84,998
  • 9
  • 154
  • 353
  • No the `year` is not stored. Can you expand on this, *please*? By giving the query as you suggested, I am getting a syntax error and it expects a `Datatype name`, `not` or `{` in place of `<`. – gsamaras Mar 03 '16 at 21:50
  • @gsamaras Sorry, it should be xsd:int [<= 2016]. Ithink since of the linked questions probably showed that. I'm not sure what you mean by "the year is not stored". What's your data actually look like? – Joshua Taylor Mar 03 '16 at 22:00
  • If you were a pomekon, you would be Alakazam, thanks! I meant that I hadn't store somewhere the year 2016, thanks JT! – gsamaras Mar 03 '16 at 22:04
  • @gsamaras if you don't have the year values stored as numbers somewhere, then this approach won't work. You accepted it though, so I assume it worked for you, so I guess you do have years stored as numbers? – Joshua Taylor Mar 03 '16 at 23:40
  • Oh sorry, yes of course. Sorry for the late response, but I am battling with my last query: http://stackoverflow.com/questions/35785868/find-people-that-have-children-that-have-an-age-difference-of-at-least-10-years – gsamaras Mar 04 '16 at 00:37