Version 1 by Vladimir Alexiev
on Mar 15, 2012 16:22.

compared with
Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (1)

View Page History
- He continues work as a postdoc funded by MOLTO, see [Molto publications|http://www.molto-project.eu/user/13/biblio]
- He is [one of 3 current developers and maintainers|http://www.grammaticalframework.org/doc/gf-people.html] of the Grammatical Framework:

h2. Walkthrough
Let's try one of the GF examples. TODO: add a walkthrough here.
This will showcase grammatical structures
http://grammaticalframework.org:41296/minibar/minibar.html
- play with a couple of the grammars
- notice how it lets you type, yet autocompletes words: very nice
In RS when it gets to a terminal spot, it will start thesaurus auto-complete.
- select same or different language and observe the translation (esp on "MiniGrammar.pgf")
- click on the tree icons to see the syntax trees

h2. Discussion
We MUST define the query syntax grammar before we dive into details.
- there are tons of parser generators available, ANTLR seems to be most popular in the java world
-- we also want assisted grammar-controlled editing like the above example
- GF introduces a complication: it targets multi-lingual translation, so
there's an Abstract grammar that's mapped to various NL grammars (EN, FR, ...)
-- controlled entry in any source NL is mapped to Abstract, then to any target NL
- for RS Search we also need 2 languages: EN and SPARQL
-- so it may be appropriate to use GF
-- another option (by Milen Chechev) is
EN grammar -> FSA to control autocompletion;
EN parse tree -> SPARQL generation (like in a compiler)
- the interesting twist is that our grammar is driven in part by FRs:
for each FR we know its domain, range, name; and that should generate part of the grammar

h2. Which comes first, term or relation
bq. when you type, the terms can come from any thesaurus. Once it is selected the source is then known

That's what we discussed yesterday, but how does it mesh with
the left-to-right ordering of a sentence, and the fact that we have definitions of "thing to *" but not "* to thing".
I.e. FRs define "thing fromPerson <Rembrandt>" but not "<Rembrandt> isPersonOf thing"

h2. Edit/Backspace
How does the user edit the search?
In the above demo you have a <x\] button meaning "backspace", so to change something, you have to delete everything to the right of it.
That is in the nature of grammars: they parse left-to-right (possibly with limited lookahead).

- “Cotton” (material) OR “Silk” (material) and you changed “Cotton” (material) to “Paris” (location) then the interface would then look like this:
- “Paris” OR _______ (Blank). The other term should be removed.
-- If a new location was not put in the blank space then “Paris” would just become another AND.

I can't imagine how we can implement this with formal grammars.
Much simpler is to ask the user to backspace all the way (same as in the demo!) and put "Paris": the result is the same