Survey in RDF...?

LTjake on 2003-04-02T13:32:44

I was tasked last week to whip up a multi-page web survey. I really didn't have much (or any) time to think about my approach, so I just created a simple "dispatch" script that gathers all of the answers from the previous page, and does survey logic (i.e. jump to section X if they answered Y to question Z, go to the next page, etc.) Each of the survey pages was pretty static in nature.

I decided to store the data in an RDF-like format. Subject, Predicate, and Object where the subject is the survey id, the predicate is the question (the input name="..." tag), and the object is a literal - the answer.

It really saved me from many a headache. If i were to do a DB design where all of the predicates (questions) where table columns, and then they decided to change a bunch of questions, I'd have to go back and fix up my table design. With the RDF storage, the question names are not pre-determined, so any changes to the survey are easily incorporated in to the stored data.

Anywho, this is really nothing new per se, but it was nice to see some benefits from using this method. Perhaps it could be extended to store the questions and survey logic in order to make it a more generic application...?


RDF?

darobin on 2003-04-02T13:45:58

Curious: was it actual RDF or something that exposed triples?

Re:RDF?

LTjake on 2003-04-02T14:00:10

When I think about it, it's really just triples.

But, is there any reason why it couldn't be molded into an RDF statement?

Re:RDF?

darobin on 2003-04-02T14:08:11

No, but the same triple can be expressed in multiple ways in RDF so processing becomes more complex (ie you need an RDF processor). Imho you did well to go with an ad hoc format.

If you do anything generic out of that, please post about it here, at least one person is interested ;)

Re:RDF?

tex on 2003-04-02T15:57:21

Me too, please!