Blog
Books
Talks
Follow
Me
Search

Larsblog

More on typed data in tolog

<< 2006-05-13 00:01 >>

After I posted my blog entry on typed data in tolog Geir Ove had an interesting idea: why couldn't the type conversion predicates be dynamic? Dynamic predicates are something that, as far as I know, is unique to tolog. They are not predefined, and they are not user-defined, but are instead dynamically created from the structure of the underlying topic map.

Geir Ove's idea was to do something similar based on the structure of the predicate names. This would require a special conversion module for these predicates, but that's no great loss, really. Thus, the following query:

import "http://something/or/other/conversion/" as conv
conv:string-bar("12", $B)?

would convert the string "12" into a value of type "bar", whatever that might be. This is like the second alternative in the previous posting, but the difference here is that the parses the predicate name to work out which type to convert to and from.

This gets rid of the explosion of predicates as the number of types grows, and gets it back on par with the first solution in terms of implementation complexity. (It's slightly more complex to implement, but in a fun way, so who cares. :)

In short, this leaves us pretty much back where we were. The two proposed solutions are more or less equal, except that one fits somewhat more nicely into the logical approach that tolog takes. The big question then becomes what users find more natural. Well, users?

Similar posts

Typed data in tolog

We've known for a long time that sooner or later we'd have to start supporting data types (numbers, dates, ...) in tolog, but so far we haven't done it

Read | 2006-05-10 23:17

tolog updates

The tolog query language has been around for a long time, but so far it only does querying, and not updates

Read | 2006-02-21 20:49

Implementing SPARQL with tolog

I realized quite a while ago (a year ago, maybe) that it's possible to implement SPARQL on top of tolog without too much effort

Read | 2005-12-15 23:03

Comments

No comments.

Add a comment

Name required
Email optional, not published
URL optional, published
Comment
Spam don't check this if you want to be posted
Not spam do check this if you want to be posted