[Nepomuk] nepomuksearch:/ question

Sebastian Trueg trueg at kde.org
Wed Nov 18 09:42:38 CET 2009


The reason is the complete change to Virtuoso and the new query API in
kdelibs. The latter did see a lot of changes since its KDE 4.3 days in
kdebase. And it is not 100 finished internally yet. The query parser
does not handle dates properly yet. Thus, queries like the one you show
below do not work yet but will soon.

As for SPARQL: sure, that is probably faster since no properties need to
be matched. ANd since you create the query using a GUI there is no
reason to use a query parser, is there?

You can simply parse the query in the search bar and then add terms to
it via the query api:

QString queryText = searchEdit->text();
Nepomuk::Query::Query query = Nepomuk::Query::QueryParser::parseQuery(text);

Nepomuk::Query::AndTerm and;
and.addSubTerm( query.term() );

// for example the modification date
Nepomuk::Query::ComparisonTerm mtime(
      Nepomuk::Vocabulary::NIE::lastModified(),
      Soprano::LiteralValue( QDateTime( .... ) ),
      Nepomuk::Query::ComparisonTerm::SmallerThan );
and.addSubTerm( mtime );

// add more terms...

query.setTerm( and );

KUrl searchUrl = query.toSearchUrl();

Way more readable and cleaner IMHO

Cheers,
Sebastian

Peter Penz wrote:
> Hi,
> 
> I recently integrated Adam Kidder's GSoC 2009 work into Dolphin [1]. It 
> generates Nepomuk search queries like:
> 
> nepomuksearch:/+lastModified<2009-11-17 +tag:Tree
> 
> Since a few days I did an upgrade from the sesame2 backend to virtuoso and now 
> I get no results anymore for my queries :-(
> 
> Might this be a local issue on my installation or should I generally prefer 
> sparql queries instead (e. g "nepomuksearch:/?sparql=select distinct ...")?
> 
> Thanks,
> Peter
> 
> 
> [1] http://ppenz.blogspot.com/2009/11/searching.html
> _______________________________________________
> Nepomuk mailing list
> Nepomuk at kde.org
> https://mail.kde.org/mailman/listinfo/nepomuk
> 


More information about the Nepomuk mailing list