Next in thread → Next in month →

Re: [xdi] XDI Querier update

From
Giovanni Bartolomeo <>
Date
2008-04-21T15:35:45+00:00
ID
Thread
Re: [xdi] XDI Querier update
Ok, good Markus, thanks for this explanation! I agree with your approach
of having both the graph and the value maps as result.

Giovanni

At 16.55 21/04/2008, Markus Sabadello wrote:

Heya,

Yes I agree it makes sense to have "unbound" $$
variables.

However, in my current implementations they are not faster than
"bound" ones (maybe they could be - don't know). In fact,
before I even start executing the query, I replace them with
automatically generated, negative "bound" ones, i.e. $$-1,
$$-2, $$-3, etc. So when I execute the query, I don't have to treat them
differently.

By the way, I think queries always have two kinds of results:

1) One result graph, which contains all statements of the input graph
that somehow matched the query

2) Zero or more result variable value maps, which contain all
combinations of variable values that were used to apply the
query

For example, if you execute this query:

$$

    +age

        "30"

The the result graph is:

=aria.giovanni

    +age

        "30"

=marco

    +age

        "30"

And the result variable value maps are:

Variable value map 1: $$ -> =aria.giovanni

Variable value map 2: $$ -> =marco

This is useful if you are just interested in "who is 30 years
old", not in the whole result graph.

Because of these variable value maps I don't think $$ can be made faster
than $$1, $$2, $$3, etc., because the variable values have to be
"recorded" in both cases while executing the query, but I still
agree that $$ should exist simply because it makes it easier to write a
query :)

Markus

On Mon, Apr 21, 2008 at 3:50 PM, Giovanni Bartolomeo
<
> wrote:

Thanks Markus,

apart from the implementation, maybe in the specification we should
allow both forms. One question may arise about the usefulness of $$ if we
allow the first form; well the answer may be a thing like this:

$$

   +age 

        
"25"

of course we could anyway use $$1 instead of $$ here, but I would
prefer to have an explicit different form for the unbounded variable ($$)
than the one used for the bounding ones ($$1, $$2, etc.) - I think this
could be useful to optimize performances in implementations - what do you
think?

Giovanni

At 19.40 18/04/2008, Markus Sabadello wrote:

Hmm no, right now the query engine only selects input statements that
fully match a query statement. So if a query statement contains only a
subject and a predicate, then it will only select input statements with
only subject and predicate, not input statements with subject, predicate
and something else.

So even if you just want to know everything about =giovanni, you
would have to enter

=giovanni

    $$

        $$

instead of just

=giovanni

The latter will only work in my implementation of XDI messaging, but
not in the XDI query engine.

But maybe it should work that way too?

Markus

On Fri, Apr 18, 2008 at 6:20 PM, Giovanni Bartolomeo
<
> wrote:

Hello Markus,

thanks for this update. It has been great to see the querier at work
yesterday!
Simple question regarding this query:

At 00.43 18/04/2008, Markus Sabadello wrote:

=giovanni
   +friend
       $$1
($$1/+age)
   $equals$or$lesser
       "26"
$$1
   +sister
       $$2
$$2
   +nationality
       $$
($$2/+nationality)
   $equals
       "Italian"

is it the same to ask

$$2
  +nationality

instead of

$$2
  +nationality
       $$

?
Giovanni
Next in thread → Next in month →