[Developers] Query for Can't query for values of /type/text ina write, only those of /type/id
Kurt Bollacker
kurt at metaweb.com
Mon Dec 24 03:38:08 UTC 2007
On Sun, Dec 23, 2007 at 06:35:24PM -0800, Arthur van Hoff wrote:
> Hmm. I don't understand why I can't query for an object's name (or any
> other field for that matter) when I update an object.
There are some cases where simple reads in a write would not cause
problems, and there are some complex cases where it would. Describing
the line between these two cases would make the rules for creating MQL
write queries much more complex. We have strived to make MQL easy to
understand as well as keeping its behavior deterministic and
predictable. Mixing arbitrary reads and writes would make a complete
description of MQL behavior much longer and harder to understand.
> Why are ids and guids special?
When creating topics (or any other node) the querier needs to know the
id/guid of the node created in order to make reference to it later.
> As a result I have to write two queries, one to do the write, followed
> by one to query various properties of the objects I have just written.
> Why?
By dividing MQL usage into separate write and read steps, the
semantics of each query stay simpler and easier to understand. If
there is some missing expressiveness that prevents you from doing what
you need to, then let us know so we can prioritize upcoming MQL
features.
For comparison, how would you combine these steps in some other
database system (e.g. SQL, BDB, ZODB)?
> -----Original Message-----
> From: developers-bounces at freebase.com
> [mailto:developers-bounces at freebase.com] On Behalf Of Kurt Bollacker
> Sent: Sunday, December 23, 2007 6:22 PM
> To: For discussions about MQL,Freebase API and apps built on Freebase
> Subject: Re: [Developers] Query for Can't query for values of /type/text
> ina write, only those of /type/id
>
>
> On Sun, Dec 23, 2007 at 05:53:12PM -0800, Arthur van Hoff wrote:
> > Hi,
> >
> >
> > Why can't I query for names in a write? Why isn't a write query
> > semantically the same as a read query, only with side effects?
>
> Reads and writes in MQL very very different beasts. While it would be
> logically possible to include arbitrary read clauses in a MQL write,
> the syntax rules for writes would become far more complex than they
> are now. (e.g. Consider even the problem of ordering read and write
> subclauses when the writes would affect what is being read.) In
> general, the only explicit read clause you can make in a write is for
> "id" and "guid".
>
> If there is something you cannot do or do easily because of this,
> please speak up!
>
> Kurt :-)
>
>
> >
> >
> > Have fun,
> >
> >
> >
> > Arthur van Hoff
> >
> >
> >
> > ___________________________________________
> >
> > Arthur van Hoff, Dell-ZING, CTO Software and Services.
> >
> > W: 650-267-2413, F: 650-267-2498, M: 650-283-0842
> >
> >
> >
>
> > _______________________________________________
> > Developers mailing list
> > Developers at freebase.com
> > http://lists.freebase.com/mailman/listinfo/developers
>
> _______________________________________________
> Developers mailing list
> Developers at freebase.com
> http://lists.freebase.com/mailman/listinfo/developers
> _______________________________________________
> Developers mailing list
> Developers at freebase.com
> http://lists.freebase.com/mailman/listinfo/developers
More information about the Developers
mailing list