[Nepomuk] Re: First problems with query API

Sebastian Trüg trueg at kde.org
Thu Mar 3 20:22:29 CET 2011


On 03/03/2011 08:04 PM, Ignacio Serantes wrote:
> 
> On Wed, Mar 2, 2011 at 12:28 PM, Sebastian Trüg <trueg at kde.org
> <mailto:trueg at kde.org>> wrote:
> 
>     > So you actually want this:
>     >
>     > select ?r where { { ?r ?p1 ?v1 . ?v1 bif:contains "A" . } UNION {
>     ?r ?p2
>     > ?v2 . ?v2 bif:contains "B" . } UNION { ?r ?p3 ?v3 . ?v3 ... } . }"
>     >
>     > ? Are you sure?
> 
>     Ignore that. You mean that what you want is this:
> 
>     select ?r where {
>      ?r ?p1 ?v1 . ?v1 bif:contains "A" .
>      ?r ?p2 ?v2 . ?v2 bif:contains "B" .
>      ?r ?p3 ?v3 . ?v3 ...
>     }
> 
> Yes and no :).
> Yes: this kind of functionality could be needed at search level and your
> API seems to support it using AddTerm().
> No: you can't transform this kind of search in this kind of query
> because is crazy :).
> 
> When you told me that I must use the API, I did a try and found this
> problem. You can't add a class with a constructor that supports 6 terms
> but if you use it you crash DBMS or, when you use more than 3 terms dbms
> freezes, at least with my data. I don't need to explain you the reasons
> why this kind of stuff must be controlled at API level ;).

There is not only LiteralTerm. You can combine all sorts of terms with
AndTerm. And only because it is possible to create a crazy query this
way does not mean it needs to be removed completely.

> By the way, as always I need to do more tests, understand how db is
> organised and where users need to do a search before I obtain
> conclusions that could be useful to you but, sadly, I'm very short in
> free time and Ksoprano is useful but annoying. I think I must write my
> own tool to work with sparql and be more productive.

Give Nepomukshell a try and please, before you write your own tool,
consider contributing to that or at least tell us what needs to be improved.

> I have other mail pending with a couple of suggestions about building
> queries and dbms, but I need some time to prepare it and verify that my
> optimizations are reliable with additional test. I will try to respond
> you this weekend.

Great, thanks.

Cheers,
Sebastian


More information about the Nepomuk mailing list