<div dir="ltr">Hi,<div><br></div><div>So, when you need to write complex queries not handled by natural language rules what is the alternative?</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jun 18, 2013 at 12:21 PM, Denis Steckelmacher <span dir="ltr"><<a href="mailto:steckdenis@yahoo.fr" target="_blank">steckdenis@yahoo.fr</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On 06/18/2013 12:01 PM, Ignacio Serantes wrote:<br>
> Hi,<br>
><br>
> I'm a little bit confused. I understood that there are three steps in<br>
> this process "natural query language"->"formal query language"->SPARQL<br>
> queries but there is no trace of the "formal query language" syntax.<br>
><br>
<br></div>
You are right, there is no "formal query language" syntax. The parser works by incrementally translating natural language into Nepomuk2::Query::Term objects.<br>
<br>
The first parsing step is to split the query in terms (a term is a word separated by a space or a punctuation character, or words enclosed into quotes). Each term is a Nepomuk2::Query::Term having a string value.<br>
<br>
Then, rules are applied on these terms. They are locale-specific and parsed from strings that can be translated using i18nc() calls. For instance, the rule "sent by %1" transforms the three terms "sent by Michel" into the comparison term "nmo:messageFrom=Michel".<br>



<br>
When no more rule matches, the third step is to fuse them inside a big AND comparison. This big AND is the final query, that will be like<br>
<br>
resourceType=nmo:Email AND nmo:messageFrom=Michel AND nmo:messageTitle:Holidays<div><div><br>
<br>
______________________________<u></u>_________________<br>
Nepomuk mailing list<br>
<a href="mailto:Nepomuk@kde.org" target="_blank">Nepomuk@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/nepomuk" target="_blank">https://mail.kde.org/mailman/<u></u>listinfo/nepomuk</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Best wishes,<div>Ignacio</div><div><br></div>
</div></div>