[gnome-documents] query: fix author information in the single query



commit 20dcf0ece7ee1d122c6e156e6055b1584af1a82e
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Fri Aug 26 14:27:51 2011 -0400

    query: fix author information in the single query

 src/query.js |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/query.js b/src/query.js
index c780687..d25f9e3 100644
--- a/src/query.js
+++ b/src/query.js
@@ -72,7 +72,11 @@ QueryBuilder.prototype = {
     },
 
     _buildQueryInternal: function(global) {
-        let globalSparql = '{}';
+        let globalSparql =
+            'WHERE { ' +
+            'OPTIONAL { ?urn nco:creator ?creator . } ' +
+            'OPTIONAL { ?urn nco:publisher ?publisher . } ' +
+            '}';
 
         if (global) {
             globalSparql =
@@ -98,7 +102,7 @@ QueryBuilder.prototype = {
              'nao:identifier(?urn) ' + // identifier
              'rdf:type(?urn) ' + // type
              'nie:dataSource(?urn) ' + // resource URN
-             '( EXISTS { ?urn nao:hasTag nao:predefined-tag-favorite } )' + // favorite
+             '( EXISTS { ?urn nao:hasTag nao:predefined-tag-favorite } ) ' + // favorite
              globalSparql;
 
         return sparql;



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