[Nepomuk] Status report of the Nepomk query parser

Ignacio Serantes kde at aynoa.net
Tue Jun 18 10:25:13 UTC 2013


Hi,

So, when you need to write complex queries not handled by natural language
rules what is the alternative?


On Tue, Jun 18, 2013 at 12:21 PM, Denis Steckelmacher
<steckdenis at yahoo.fr>wrote:

> On 06/18/2013 12:01 PM, Ignacio Serantes wrote:
> > Hi,
> >
> > I'm a little bit confused. I understood that there are three steps in
> > this process "natural query language"->"formal query language"->SPARQL
> > queries but there is no trace of the "formal query language" syntax.
> >
>
> You are right, there is no "formal query language" syntax. The parser
> works by incrementally translating natural language into
> Nepomuk2::Query::Term objects.
>
> 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.
>
> 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".
>
> 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
>
> resourceType=nmo:Email AND nmo:messageFrom=Michel AND
> nmo:messageTitle:Holidays
>
>
> ______________________________**_________________
> Nepomuk mailing list
> Nepomuk at kde.org
> https://mail.kde.org/mailman/**listinfo/nepomuk<https://mail.kde.org/mailman/listinfo/nepomuk>
>



-- 
Best wishes,
Ignacio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/nepomuk/attachments/20130618/9ef122e3/attachment-0001.html>


More information about the Nepomuk mailing list