Welcome to Piqi discussion group!

37 views
Skip to first unread message

ala...@piqi.org

unread,
Jul 10, 2010, 7:04:07 PM7/10/10
to piqi
Welcome to Piqi discussion group!

Steffi

unread,
Sep 6, 2010, 4:06:07 AM9/6/10
to piqi
Hi,

I came across the Piqi project when surfing the web - where can I find
out more about Protoquery?

Best,
Steffi

ala...@piqi.org

unread,
Sep 6, 2010, 4:59:05 AM9/6/10
to piqi
Hi Steffi,

There's not much information available about Protoquery other than the
Piqi project was born while I was working on it. Protoquery itself
hasn't been finished as the project's direction had changed.

I'm planning on restarting Protoquery as a part of the Piqi project,
but most likely it won't happen in the next 3-6 months. I mentioned
about that on the project's roadmap page: http://piqi.org/roadmap

By the way, you guys at Google have (at least) two query languages
working on top of Protocol Buffers data model: Sawzal and Dremel (aka
BigQuery). Protoquery will take a completely different approach in
terms of syntax -- it will be based on path expressions and pattern
matching. As for semantics, it will be somewhat a mix of these too,
and I don't have any particular ideas beyond implementing selection
and projection -type of operations.

Anton

Stefanie Scherzinger

unread,
Sep 6, 2010, 5:02:34 AM9/6/10
to pi...@googlegroups.com
Hi Anton,

I am not working on Proto-related projects myself,
but I stumbled over your website since I was thinking along the lines
of XQuery for Protobuffers (just for fun) -
also since I had worked on XQuery before.

Since you are mentioning path expressions, wouldn't that be a match?

Best,
Steffi

Anton Lavrik

unread,
Sep 6, 2010, 3:28:46 PM9/6/10
to piqi
Hi Steffi,

XQuery is much more powerful than I was thinking about. My initial
vision is closer to XPath with some differences, such as pattern
matching in addition to path expressions and support for quantified
boolean expressions for dealing with repeated/optional fields. Also,
it should be based on Piq data model and syntax.

I'll give some simple examples:

1. Simple path expressions

foo.bar.baz % path composed of record labels

:mod/t.bar.baz % path starting with a type "mod/t" and continuing
with correspondent record labels

foo.bar:int % path ending with a leaf "int" type

2. Pattern matching

foo [ .bar [ .baz ]] % general form of ".foo.bar.baz" matching
expression

foo.bar [ .baz 10 ] % there is some baz field which equals 10 (in
general -- matches with 10).

Equivalent expressions: .foo.bar [ (some baz = 10)] and .foo.bar
[ (baz = 10) ]

foo.bar [ .baz 10 .some-inner-structure [ .some-field true ] ] %
pattern matching with inner patterns

foo [ (bar > 10 && fum = bar) ] % more complicated expression w/o
pattern matching


All the above examples are for matching (i.e. selection op). A lot of
features such as "return" (i.e. projection op) or boolean quantifiers
haven't been really designed yet. I didn't have enough time to think
about advanced features, but my approach would be to start
experimenting with selection based on path expressions and pattern
matching and add more complicated functionality later.

Piqi is written in OCaml which is probably the best tool for
implementing languages. Working with Piq types and intermediate data
representation using Piqi library is pretty straightforward and all
low-level lexers and parsers are already there.

Also, I know that Lucent has open-source XQuery implementation written
in OCaml called Galax. I haven't looked at it in depth, but if you're
interested specifically in XQuery, maybe it is possible to retarget
their XQuery engine to work on top of Piq/Protocol Buffers data.

Anton
Reply all
Reply to author
Forward
0 new messages