[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs/nepomuk/test
From:       Sebastian Trueg <sebastian () trueg ! de>
Date:       2010-07-06 17:20:33
Message-ID: 20100706172033.BAFE0AC8EC () svn ! kde ! org
[Download RAW message or body]

SVN commit 1146801 by trueg:

Reflect usage of the max function for scoring in the test

 M  +6 -6      querytest.cpp  


--- trunk/KDE/kdelibs/nepomuk/test/querytest.cpp #1146800:1146801
@@ -75,12 +75,12 @@
 
     QTest::newRow( "simple literal query" )
         << Query( LiteralTerm( "Hello" ) )
-        << QString::fromLatin1( "select distinct ?r (?v5) as ?_n_f_t_m_s_ where { { \
?r ?v1 ?v2 . ?v2 bif:contains \"'Hello'\" OPTION (score ?v5) . } " +        << \
QString::fromLatin1( "select distinct ?r max(?v5) as ?_n_f_t_m_s_ where { { ?r ?v1 \
                ?v2 . ?v2 bif:contains \"'Hello'\" OPTION (score ?v5) . } "
                                 "UNION { ?r ?v1 ?v3 . ?v3 ?v4 ?v2 . ?v4 %1 %2 . ?v2 \
                bif:contains \"'Hello'\" OPTION (score ?v5) . } . }" )
         .arg( Soprano::Node::resourceToN3(Soprano::Vocabulary::RDFS::subPropertyOf()),
                
               Soprano::Node::resourceToN3(Soprano::Vocabulary::RDFS::label()) );
 
-    QString helloWorldQuery = QString::fromLatin1( "select distinct ?r (?v5) as \
?_n_f_t_m_s_ where { { ?r ?v1 ?v2 . ?v2 bif:contains \"'Hello World'\" OPTION (score \
?v5) . } " +    QString helloWorldQuery = QString::fromLatin1( "select distinct ?r \
max(?v5) as ?_n_f_t_m_s_ where { { ?r ?v1 ?v2 . ?v2 bif:contains \"'Hello World'\" \
OPTION (score ?v5) . } "  "UNION "
                                                    "{ ?r ?v1 ?v3 . ?v3 ?v4 ?v2 . ?v4 \
                %1 %2 . ?v2 bif:contains \"'Hello World'\" OPTION (score ?v5) . } . \
                }" )
                               .arg( \
Soprano::Node::resourceToN3(Soprano::Vocabulary::RDFS::subPropertyOf()), @@ -97,7 \
+97,7 @@  
     QTest::newRow( "literal query with depth 2" )
         << Query( AndTerm( LiteralTerm("foo"), ComparisonTerm( \
Soprano::Vocabulary::NAO::hasTag(), ComparisonTerm( \
                Soprano::Vocabulary::NAO::prefLabel(), LiteralTerm("bar") ) ) ) )
-        << QString::fromLatin1("select distinct ?r ((?v8/2)+?v5) as ?_n_f_t_m_s_ \
where { " +        << QString::fromLatin1("select distinct ?r max((?v8/2)+?v5) as \
                ?_n_f_t_m_s_ where { "
                                "{ { ?r ?v1 ?v2 . ?v2 bif:contains \"'foo'\" OPTION \
(score ?v5) . } "  "UNION "
                                "{ ?r ?v1 ?v3 . ?v3 ?v4 ?v2 . "
@@ -128,7 +128,7 @@
 
     QTest::newRow( "hastag with literal term" )
         << Query( ComparisonTerm( Soprano::Vocabulary::NAO::hasTag(), LiteralTerm( \
                QLatin1String("nepomuk")) ) )
-        << QString::fromLatin1("select distinct ?r (?v4) as ?_n_f_t_m_s_ where { ?r \
%1 ?v1 . ?v1 ?v2 ?v3 . ?v2 %2 %3 . ?v3 bif:contains \"'nepomuk'\" OPTION (score ?v4) \
. }") +        << QString::fromLatin1("select distinct ?r max(?v4) as ?_n_f_t_m_s_ \
where { ?r %1 ?v1 . ?v1 ?v2 ?v3 . ?v2 %2 %3 . ?v3 bif:contains \"'nepomuk'\" OPTION \
                (score ?v4) . }")
         .arg(Soprano::Node::resourceToN3(Soprano::Vocabulary::NAO::hasTag()))
         .arg(Soprano::Node::resourceToN3(Soprano::Vocabulary::RDFS::subPropertyOf()))
                
         .arg(Soprano::Node::resourceToN3(Soprano::Vocabulary::RDFS::label()));
@@ -200,7 +200,7 @@
     setVarNameTerm2.setVariableName( "myvar" );
     QTest::newRow( "set variable name 2" )
         << Query( setVarNameTerm2 )
-        << QString::fromLatin1("select distinct ?r ?myvar (?v3) as ?_n_f_t_m_s_ \
where { ?r %1 ?myvar . ?myvar ?v1 ?v2 . ?v1 %2 %3 . ?v2 bif:contains \"'nepomuk'\" \
OPTION (score ?v3) . }") +        << QString::fromLatin1("select distinct ?r ?myvar \
max(?v3) as ?_n_f_t_m_s_ where { ?r %1 ?myvar . ?myvar ?v1 ?v2 . ?v1 %2 %3 . ?v2 \
                bif:contains \"'nepomuk'\" OPTION (score ?v3) . }")
         .arg(Soprano::Node::resourceToN3(Soprano::Vocabulary::NAO::hasTag()),
              Soprano::Node::resourceToN3(Soprano::Vocabulary::RDFS::subPropertyOf()),
                
              Soprano::Node::resourceToN3(Soprano::Vocabulary::RDFS::label()));
@@ -242,7 +242,7 @@
 
     QTest::newRow( "order by 3" )
         << Query( AndTerm( orderByTerm1, orderByTerm2 ) )
-        << QString::fromLatin1("select distinct ?r (?v3) as ?_n_f_t_m_s_ where { { \
?r %1 ?v1 . FILTER(?v1<\"4\"^^%2) . ?r %3 ?v2 . ?v2 bif:contains \"'hello'\" OPTION \
(score ?v3) . } . } ORDER BY ASC ( ?v2 ) DESC ( ?v1 )") +        << \
QString::fromLatin1("select distinct ?r max(?v3) as ?_n_f_t_m_s_ where { { ?r %1 ?v1 \
. FILTER(?v1<\"4\"^^%2) . ?r %3 ?v2 . ?v2 bif:contains \"'hello'\" OPTION (score ?v3) \
                . } . } ORDER BY ASC ( ?v2 ) DESC ( ?v1 )")
         .arg(Soprano::Node::resourceToN3(Soprano::Vocabulary::NAO::numericRating()),
              Soprano::Node::resourceToN3(Soprano::Vocabulary::XMLSchema::xsdInt()),
              Soprano::Node::resourceToN3(Soprano::Vocabulary::NAO::prefLabel()) );


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic