ORM, RDF, and Jon Postel

Posted: July 6th, 2009 | Author: Ross | Filed under: Collaboration, Databases, Linked Data | Comments

Had a great conversation with @cks earlier about the dichotomy between ORM and RDF/OWL when modeling enterprise data. His position was that with a pure ORM model you are more likely to have consistent data throughout your applications because the rules & constraints have laid out before the user ever touches the keyboard. Where he felt RDF/OWL was at odds with the ORM model is that by giving people the ability to create relationships that trigger additional inferences you must trust them to understand the implications of their actions.

A simple example….

    :trees :madeOf :wood
    :trees :need :water

Now someone comes along and creates this:

    :table :madeOf :wood

At this point it’s incumbent upon all dependent applications to understand that “:table” does not in fact need water. Again, the key is that every application must be aware of and apply the same rules or data integrity suffers. It’s not that tradtional ORM and RDF/OWL can’t coexist, in some companies it may be an integrated process. Where @cks was concerned is that the inferences inherent to RDF/OWL introduces issues with consistency and integration because it’s so easy for new rules to simply pop up.

I agree with everything up to this point, but where I would argue we need to be headed with enterprise apps is a hybrid model that blends the consistency & predictability of ORM, with the freedom of RDF/OWL.

First let’s quickly take a moment to talk about freedom. When I hear a programmer use the phrase “never trust the user” I scratch my head. Sure you should sanitize application input for the sake of security but let’s be realistic about it, business users do not intentionally inject crap into the system. They use software to get things done. Humans will make mistakes, but so do the software applications that were written by… well, humans.

The user is the most important component of software development. If that sounds obvious, then why don’t we trust them more? My hope is that developers begin putting more trust in the user with a focus on creating software that learns from the users instead of limiting them.

So back to the hybrid model. I picture RDF/OWL as the essential meta layer above the ORM. By abstracting it with interfaces that are usable to non-techies it becomes an engine for collecting knowledge about the relationships and attributes of the business across all dimensions. We shouldn’t be concerned with modeling absolute and irrefutable truths, because tomorrow there will be an exception. That’s the problem with strict models in the enterprise, there will always be exceptions. Next, the ORM layer follows on as an application specific module where you can extract pieces of the meta layer to digest, analyze, and make use of the data at a domain level.

It’s about putting a higher priority on the collection of information than on enforcing rules on the information. The principle reminds me of the great quote from Jon Postel.

“be conservative in what you send, be liberal in what you receive”

Postel is of course referring to the Transmission Control Protocol, a language that computers use to speak to each other over the internet.  To me however  these words have a more universal meaning in the world of software development which I’d categorize like this:

  • Listen more
  • Talk less
  • Prepare for exceptions
  • Trust until you are given a reason not to

  • So, @cks here. What I meant was more along the lines of "it's just plain impolite to give somebody a full-sized flamethrower to light a candle"

    It's not that you don't trust them (maybe they're an expert with a flamethrower), but a situation where it's easier to do the wrong thing than the right thing is non-optimal.

    But at least with a flamethrower it's pretty obvious when you've messed up. A better parallel with RDFS/OWL might be ripping the labels off all your canned goods, then letting the cook know that there might be a container of (unlabeled) rat poison in there someplace, so "you just be careful, ok?"

    Current semantic web technology is good at handling "anyone can say anything about anything", but only at the expense of nearly complete credulity. We need better tools to help users fully understand the consequences of their actions (label the rat poison?) and handle the fallout (provide fire extinguishers along with the flame thrower?)
  • Chris - thanks for the follow up. The whole idea of putting more trust in people to “say anything about anything” has been on my mind for a while and our conversation spurred me into putting something down. Didn't intend to tag you as "don't trust users" guy, as you point out there's more to the story. You make some really good points about the flip side of giving users more power. Things like planning for recovery when people do make mistakes, designing interfaces that guide/suggest, and using education as a guiding principle behind the "say anything" philosophy of the semantic web. Good thoughts.
blog comments powered by Disqus