owlcs / owlapi

OWL API main repository
822 stars 315 forks source link

DateTime(Stamp) + OWLLiteral #1021

Open SimonBin opened 2 years ago

SimonBin commented 2 years ago

Hi,

Is there any guidance which data types get methods like getOWLLiteral(double/string/...) and parse{Double,Integer,...}? Should there be such methods to deal with xsd:DateTime(Stamp)s or is there a conscious decision to not support them in a convenient api?

I know you can do

df.getOWLLiteral("2009-01-01T00:00:00+00:00", df.getOWLDatatype(XSDVocabulary.DATE_TIME_STAMP))

and parse it manually somehow.

Thanks,

ignazio1977 commented 2 years ago

I'm not aware of a decision to exclude dates and timestamps from the convenience methods on OWLLiteral - although such a choice would have predated my involvement with the API, so I can't be sure.

My guess is that the need has not arisen for the developers and there's been no request from users, so it just hasn't happened.

Mudit19258 commented 2 years ago

@ignazio1977 I would like to work on this enhancement. Using the java.time package, I could add java.time.LocalDate and java.time.LocalTime datatypes support on OWLLiteral.