summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Drung <bdrung@debian.org>2012-01-12 22:28:57 +0100
committerBenjamin Drung <bdrung@debian.org>2012-01-12 22:28:57 +0100
commitd654778675b0d90abf4e41342eaf4ef17c31562d (patch)
tree859438b69bb5a351192b715e0edaef16433b4cad
parentbf2ddc50fde362ee726e62a10f718ba9346490cc (diff)
Use unnamed variables in SPARQL queries if they are unused.
-rwxr-xr-xdh_xul-ext8
-rwxr-xr-xinstall-xpi4
2 files changed, 6 insertions, 6 deletions
diff --git a/dh_xul-ext b/dh_xul-ext
index cea6e94..e003173 100755
--- a/dh_xul-ext
+++ b/dh_xul-ext
@@ -152,11 +152,11 @@ def _get_id_max_min_triple(install_rdf):
PREFIX em: <http://www.mozilla.org/2004/em-rdf#>
SELECT ?id ?max ?min
WHERE {
- ?x1 em:targetApplication ?x2 .
- ?x2 em:id ?id .
+ [] em:targetApplication ?x .
+ ?x em:id ?id .
OPTIONAL {
- ?x2 em:maxVersion ?max .
- ?x2 em:minVersion ?min .
+ ?x em:maxVersion ?max .
+ ?x em:minVersion ?min .
} .
}
""", query_language="sparql")
diff --git a/install-xpi b/install-xpi
index ddd7b1a..f73b1bf 100755
--- a/install-xpi
+++ b/install-xpi
@@ -51,12 +51,12 @@ def get_query_field_id_as_list(rdf_path, query_string):
def get_target_applications(install_rdf):
target_applications = get_query_field_id_as_list(install_rdf,
- "SELECT ?id WHERE { ?x1 em:targetApplication ?x2 . ?x2 em:id ?id }")
+ "SELECT ?id WHERE { [] em:targetApplication ?x . ?x em:id ?id }")
return target_applications
def get_extension_id(install_rdf):
extension_ids = set(get_query_field_id_as_list(install_rdf,
- "SELECT ?id WHERE {?x1 em:targetApplication ?x2 . ?x1 em:id ?id }"))
+ "SELECT ?id WHERE {?x em:targetApplication [] . ?x em:id ?id }"))
return extension_ids.pop()
def get_arch(package):