Changeset 420


Ignore:
Timestamp:
04/06/11 15:14:34 (14 years ago)
Author:
lgiessmann
Message:

TM-SPARQL: fixed the unit-tests test-module-14, test-module-15, and test-module-16

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/src/unit_tests/sparql_test.lisp

    r419 r420  
    22302230                                    (concat "<" *tms-player* ">"))
    22312231                              (getf item :result) :test #'string=)))
    2232                            ((string= (getf item :variable) "obj1")
     2232                           ((string= (getf item :variable) "subj1")
    22332233                            (is (= (length (getf item :result)) 4))
    22342234                            (is-false
     
    22592259                             (is-false (getf item :result)))
    22602260                            ((or (string= (getf item :variable) "subj2")
    2261                                  (string= (getf item :variable) "obj5"))
     2261                                 (string= (getf item :variable) "subj5"))
    22622262                             (is-false (getf item :result)))
    22632263                            ((or (string= (getf item :variable) "pred3")
     
    22672267                                          (concat "<" *tms-topicProperty* ">"))))
    22682268                            ((or (string= (getf item :variable) "subj3")
    2269                                  (string= (getf item :variable) "obj4"))
     2269                                 (string= (getf item :variable) "subj4"))
    22702270                             (is (= (length (getf item :result)) 1))
    22712271                             (is (string= (first (getf item :result))
     
    23122312                                          "http://some.where/ii/role-reifier"
    23132313                                          :revision 0) :revision 0))))))
    2314                               (getf item :result) :test #'string=))))
     2314                              (getf item :result) :test #'string=))
     2315                            (t
     2316                             (is-true (format t "bad variable-name found ~a"
     2317                                              (getf item :variable))))))
    23152318           r-1))))
    2316 
    23172319
    23182320
     
    23542356                                                        :revision 0)))
    23552357                                      "http://some.where/tmsparql/author/goethe")
    2356                                 return role)))))))))
     2358                                return role)))))))
     2359                       (t
     2360                        (is-true (format t "bad variable-name found ~a"
     2361                                         (getf item :variable))))))
    23572362           r-1))))
    23582363
     
    23652370                 "SELECT * WHERE {
    23662371                   <http://some.where/tmsparql/author/goethe> ?pred1 ?obj1.
    2367                    #FILTER ?obj1 = 'von Goethe' || ?obj1 = 82
    2368                    FILTER ?obj1 = 'von Goethe'^^" *xml-string* " || ?obj1 = '82'^^" *xml-integer* "
    2369                    #FILTER (?obj1 = 'von Goethe' || 82 = ?obj1)
    2370                    #FILTER (?obj1 = 'von Goethe') || (82 = ?obj1)
    2371                    #FILTER ((?obj1 = 'von Goethe') || (82 = ?obj1))"
    2372                  "
    2373 }"))
     2372                   FILTER ?obj1 = 'von Goethe' || ?obj1 = 82
     2373                   FILTER ?obj1 = 'von Goethe' || ?obj1 = '82'^^" *xml-integer* "
     2374                   FILTER (?obj1 = 'von Goethe'^^" *xml-string* " || 82 = ?obj1)
     2375                   FILTER (?obj1 = 'von Goethe') || (82 = ?obj1)
     2376                   FILTER ((?obj1 = 'von Goethe') || (82 = ?obj1))"
     2377                 "}"))
    23742378           (r-1 (tm-sparql:result (make-instance 'TM-SPARQL:SPARQL-Query :query q-1))))
    2375 
    23762379      (is-true (= (length r-1) 2))
    23772380      (map 'list #'(lambda(item)
    23782381                     (cond
    23792382                       ((string= (getf item :variable) "pred1")
    2380                         nil)
     2383                        (is (= (length (getf item :result)) 2))
     2384                        (is (find "<http://some.where/tmsparql/last-name>"
     2385                                  (getf item :result) :test #'string=))
     2386                        (is (find "<http://some.where/tmsparql/years>"
     2387                                  (getf item :result) :test #'string=)))
    23812388                       ((string= (getf item :variable) "obj1")
    2382                         nil)))
    2383            r-1)
    2384       (format t "~a~%" r-1))))
     2389                        (is (= (length (getf item :result)) 2))
     2390                        (is (find 82 (getf item :result) :test #'tm-sparql::literal=))
     2391                        (is (find "von Goethe" (getf item :result)
     2392                                  :test #'tm-sparql::literal=)))
     2393                       (t
     2394                        (is-true (format t "bad variable-name found ~a"
     2395                                         (getf item :variable))))))
     2396                       
     2397           r-1))))
     2398
     2399
     2400
    23852401
    23862402
Note: See TracChangeset for help on using the changeset viewer.