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

Default model for goo classes #21

Closed palexander closed 11 years ago

palexander commented 11 years ago

Looks like the model could be defined by default by using self.class.name.to_underscore.to_sym

Note that to_underscore doesn't exist, but there are several implementations we could use offered here: http://stackoverflow.com/questions/1509915/converting-camel-case-to-underscore-case-in-ruby

palexander commented 11 years ago

I would also allow this to be overridden if it would make sense to do so? Can't think of a use case for that right now, though.

msalvadores commented 11 years ago

Yup. That is how I am implementing it in the new configuration. Working on it today.

Though I do not know if we want it to be underscored. In RDF classes are normally named in the same way as in code.

 class ContactInfo
 end

Would become http://default.namespace.org/ContactInfo and not http://default.namespace.org/contact_info. The latter looks ugly in RDF the former is the standard.

msalvadores commented 11 years ago

With the new configuration the default behavior is that in something like ...

class ContactInfo model :contact_info end

We would always record in the triple store <a> rdf:type <httpp://xxx.yy/ContactInfo>.

Closing it ... @palexander pls reopen if you want some other behavior.