[tracker] Don't use isStoredAs in performance test scripts.



commit 08912a379c2d8ca108440dd8b55e75e18b70dbec
Author: Mikael Ottela <mikael ottela ixonos com>
Date:   Thu Apr 29 10:40:20 2010 +0300

    Don't use isStoredAs in performance test scripts.

 tests/functional-tests/performance-tc.py |   17 ++++++-----------
 utils/data-generators/cc/nmm.py          |    6 ++++--
 2 files changed, 10 insertions(+), 13 deletions(-)
---
diff --git a/tests/functional-tests/performance-tc.py b/tests/functional-tests/performance-tc.py
index 6b8c9e0..dc01aca 100644
--- a/tests/functional-tests/performance-tc.py
+++ b/tests/functional-tests/performance-tc.py
@@ -715,10 +715,9 @@ class gallery(TestUpdate):
 
 		""" Querying for all Images and Videos """
 
-		query = "SELECT ?url ?filename ?modified ?_width ?_height ?is \
+		query = "SELECT ?url ?filename ?modified ?_width ?_height \
                     WHERE { \
                      ?media a nfo:Visual; \
-                     nie:isStoredAs  ?is ;\
                      nie:url ?url;\
                      nfo:fileName ?filename ;\
                      nfo:fileLastModified ?modified .\
@@ -738,10 +737,9 @@ class gallery(TestUpdate):
 
 		""" Querying for all Images and Videos without OPTIONALS"""
 
-		query = "SELECT ?url ?filename ?modified ?is \
+		query = "SELECT ?url ?filename ?modified \
                     WHERE { \
                      ?media a nfo:Visual; \
-                     nie:isStoredAs  ?is ;\
                      nie:url ?url;\
                      nfo:fileName ?filename ;\
                      nfo:fileLastModified ?modified .}\
@@ -759,10 +757,9 @@ class gallery(TestUpdate):
 
 		""" Querying for 500 Images and Videos """
 
-		query = "SELECT ?url ?filename ?modified ?_width ?_height ?is \
+		query = "SELECT ?url ?filename ?modified ?_width ?_height \
                     WHERE { \
                      ?media a nfo:Visual; \
-                     nie:isStoredAs  ?is ;\
                      nie:url ?url;\
                      nfo:fileName ?filename ;\
                      nfo:fileLastModified ?modified .\
@@ -782,10 +779,9 @@ class gallery(TestUpdate):
 
 		""" Querying for 500 Images and Videos without OPTIONALS"""
 
-		query = "SELECT ?url ?filename ?modified ?is \
+		query = "SELECT ?url ?filename ?modified \
                     WHERE { \
                      ?media a nfo:Visual; \
-                     nie:isStoredAs  ?is ;\
                      nie:url ?url;\
                      nfo:fileName ?filename ;\
                      nfo:fileLastModified ?modified .} \
@@ -927,10 +923,9 @@ class gallery(TestUpdate):
 
 		""" Querying for 500 Images and Videos with UNION for them """
 
-		query = "SELECT ?url ?filename ?modified ?_width ?_height ?is \
+		query = "SELECT ?url ?filename ?modified ?_width ?_height \
                     WHERE { \
                      {?media a nmm:Photo.} UNION {?media a nmm:Video.} \
-                     ?media nie:isStoredAs  ?is .\
                      ?media nie:url ?url.\
                      ?media nfo:fileName ?filename .\
                      ?media nfo:fileLastModified ?modified .\
@@ -939,7 +934,7 @@ class gallery(TestUpdate):
                      ORDER BY ?modified LIMIT 500"
 		start=time.time()
 
-            	result=self.resources.SparqlQuery(query, timeout=25)
+            	result=self.resources.SparqlQuery(query,timeout=1000)
 
         	elapse =time.time()-start
         	print "Time taken for querying 500 images and videos  = %s " %elapse
diff --git a/utils/data-generators/cc/nmm.py b/utils/data-generators/cc/nmm.py
index 31202be..cf2baf1 100644
--- a/utils/data-generators/cc/nmm.py
+++ b/utils/data-generators/cc/nmm.py
@@ -20,7 +20,8 @@ nmm_Photo = '''
     nmm:focalLength      "%(photo_focal_length)s";
     nmm:flash            <http://www.tracker-project.org/temp/nmm#flash-off> ;
     nmm:meteringMode     <http://www.tracker-project.org/temp/nmm#meteringMode-pattern> ;
-    nmm:whiteBalance     <http://www.tracker-project.org/temp/nmm#whiteBalance-auto> .
+    nmm:whiteBalance     <http://www.tracker-project.org/temp/nmm#whiteBalance-auto> ;
+    nao:hasTag           [a nao:Tag ; nao:prefLabel "%(photo_tag)s"] .
 '''
 def generatePhoto(index):
   me = 'nmm#Photo'
@@ -36,6 +37,7 @@ def generatePhoto(index):
   photo_fnumber      = '%d.0' % (1 + (index % 20))
   photo_focal_length = '%d.0' % (1 + (index % 500))
   photo_date         = '%d-%02d-%02dT01:01:01Z' % (2000 + (index % 10), (index % 12) + 1, (index % 25) + 1)
+  photo_tag          = ('TEST', 'nomatch') [index %2]
 
   tools.addItem( me, photo_uri, nmm_Photo % locals() )
 
@@ -65,7 +67,7 @@ def generateVideo(index):
   video_date         = '%d-%02d-%02dT01:01:01Z' % (2000 + (index % 10), (index % 12) + 1, (index % 25) + 1)
   video_samplerate   = str(index)
   video_duration     = str(index)
-  video_tag          = 'TEST%d' % index
+  video_tag          = ('TEST', 'nomatch') [index %2]
 
   tools.addItem( me, video_uri, nmm_Video % locals() )
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]