[tmql-wg] Combining Tolog and path expressions

Dmitry dmitryv@cogeco.ca
Wed, 3 Mar 2004 21:47:42 -0500


I was recently discussing (as a puzzle) with Lars Marius possibility of integrating simple path expressions into tolog.

I think that tolog is very good for querying associations. But I found that AsTMa, Toma and TMPath approaches are more attractive
when it comes to querying  topic properties.

I think that it is possible to introduce simple path expressions into tolog without changing tolog semantics. It will help to create
more compact queries.

One of the discussed syntaxes:

<topic variable>[<type expression>;<conditions with simple paths>]

Example:

$X[person; age<30,webpage like "..." | webpage like "... "], born-in($X:who,$Y:where), $Y[city]

"age", "webpage" are simple paths related to topic $X, "person" is a type

also constructs such as $X.age $X.webpage are allowed.

Extended expressions can be re-written in regular tolog.  "Existential"  semantics of path expressions matches well tolog
existential semantics.

For example:

$X[person; age <30] ->
instanceOf($X,person),age($X,$V00001),$V00001<30

$X[person], $Y[person; age>$X.age] ->
instanceOf($X,person),instanceOf($Y,person),age($Y,$V00003),age($X,$V00002),$V00003>$V00002

$X[perlHacker | pythonHacker] ->
(instanceOf($X,perlHacker); instanceOf($X,pythonlHacker))

$X[whitePapper; webpage=$WP, $WP like "...."]->
instanceOf($X,whitePapper),webpage($X,$WP),like($WP,"....")


Any thoughts?

Thank you,

Dmitry