Datatype other than default, text and URI?

Sorry if the question is trivial, but it it possible to restrain the value of some fields to some datatypes? I did not find a way to do it in the sandbox…

For example, in the sandbox demo1, there is a ressource with “1749-04-09” value in “Date” field. But “1749-04-09” is merely a string, not a DateTime value, as you can see by using the API (“Date”,"@value":“1749-04-09”)
So, is it possible to force “Date” field to contain XML dateTime or ISO 8601 ?

And I could ask the same question for other XML types, like “decimal”

Also, is it possible to enter a date with a user friendly datepicker ?

In database, they will always be stored as strings.

But you can add validation and filtering constraints in web interfaces using a module. It will create a new data type extending Text, URI or Resource data type. Look at the IdRef module to see an example.

I think a module is able to add a date picker to a custom data type.

Note this has been discussed.

1 Like

Thanks
I’m not a developper but I like the solution proposed by @Daniel_KM in this github issue…

I added the default rdf datatypes: html, xml, boolean, integer, decimal and date / time (see https://github.com/Daniel-KM/Omeka-S-module-RdfDatatype).