Author: whit
Date: 2007-07-31 10:48:35 -0400 (Tue, 31 Jul 2007)
New Revision: 7872

Modified:
   TaggerStore/trunk/taggerstore/rdf.py
Log:

* make graph conditional as an argument for `entryid_list_query`

* quote literal text terms



Modified: TaggerStore/trunk/taggerstore/rdf.py
===================================================================
--- TaggerStore/trunk/taggerstore/rdf.py        2007-07-31 14:47:14 UTC (rev 
7871)
+++ TaggerStore/trunk/taggerstore/rdf.py        2007-07-31 14:48:35 UTC (rev 
7872)
@@ -241,7 +241,7 @@
 }
 """.strip()
 
-def entryid_for_link(graph, uri):
+def entryid_for_link(uri, graph=None):
     query = """
     PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
     PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
@@ -255,7 +255,9 @@
          ?entry_uri rdf:type atom:entry .
          ?entry_uri rdf:ID ?entry_id .
     }""" %uri
-    return graph.query(query).serialize(format='entryid_list')
+    if graph:
+        return graph.query(query).serialize(format='entryid_list')
+    return query
 
 def make_q(patterns, template=template_query):
     """
@@ -284,7 +286,7 @@
                          'regex(?title, "%s")'),
     HAS_SCHEME:("?term_uri tagger:hasScheme <%s> .",
                 "?scheme = <%s>"), 
-    LABEL:("?term_uri rdfs:label %s .", # the *tag* its textual self
+    LABEL:('?term_uri rdfs:label "%s" .', # the *tag* its textual self
            'regex(?term, "%s")'), 
     }
 



--
Archive: 
http://www.openplans.org/projects/opencore/lists/openplans-svn/archive/2007/07/1185893316136
To unsubscribe send an email with subject unsubscribe to [EMAIL PROTECTED]  
Please contact [EMAIL PROTECTED] for questions.

Reply via email to