ncbo / goo

Graph Oriented Objects (GOO) for Ruby. A RDF/SPARQL based ORM.
http://ncbo.github.io/goo/
Other
15 stars 6 forks source link

Feature: add property datatype dsl #137

Closed syphax-bouazzouni closed 2 months ago

syphax-bouazzouni commented 1 year ago

Requirement

Currently, to define a property type we use the enforce statement, like so

 attribute :uri, enforce:  [:URI, :existence, :unique]

The problem is that the validators (existence and uniqueness) are mixed with the property range (URI)

The proposition would be to add the 'type' argument and transform it like the following

 attribute :URI, type: :URI , enforce:  [:existence, :unique]

It will still be backward compatible because we it's only a redirection, i.e type: :uri will be added to the enforce clause in the back

Related https://github.com/ontoportal-lirmm/goo/issues/22

syphax-bouazzouni commented 2 months ago

Replaced by https://github.com/ncbo/goo/pull/151