Changeset 420
- Timestamp:
- 04/06/11 15:14:34 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/src/unit_tests/sparql_test.lisp ¶
r419 r420 2230 2230 (concat "<" *tms-player* ">")) 2231 2231 (getf item :result) :test #'string=))) 2232 ((string= (getf item :variable) " obj1")2232 ((string= (getf item :variable) "subj1") 2233 2233 (is (= (length (getf item :result)) 4)) 2234 2234 (is-false … … 2259 2259 (is-false (getf item :result))) 2260 2260 ((or (string= (getf item :variable) "subj2") 2261 (string= (getf item :variable) " obj5"))2261 (string= (getf item :variable) "subj5")) 2262 2262 (is-false (getf item :result))) 2263 2263 ((or (string= (getf item :variable) "pred3") … … 2267 2267 (concat "<" *tms-topicProperty* ">")))) 2268 2268 ((or (string= (getf item :variable) "subj3") 2269 (string= (getf item :variable) " obj4"))2269 (string= (getf item :variable) "subj4")) 2270 2270 (is (= (length (getf item :result)) 1)) 2271 2271 (is (string= (first (getf item :result)) … … 2312 2312 "http://some.where/ii/role-reifier" 2313 2313 :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)))))) 2315 2318 r-1)))) 2316 2317 2319 2318 2320 … … 2354 2356 :revision 0))) 2355 2357 "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)))))) 2357 2362 r-1)))) 2358 2363 … … 2365 2370 "SELECT * WHERE { 2366 2371 <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 "}")) 2374 2378 (r-1 (tm-sparql:result (make-instance 'TM-SPARQL:SPARQL-Query :query q-1)))) 2375 2376 2379 (is-true (= (length r-1) 2)) 2377 2380 (map 'list #'(lambda(item) 2378 2381 (cond 2379 2382 ((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=))) 2381 2388 ((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 2385 2401 2386 2402
Note: See TracChangeset
for help on using the changeset viewer.