[gnome-news] tracker: Update queries to sparql1.1 correct syntax
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-news] tracker: Update queries to sparql1.1 correct syntax
- Date: Mon, 7 Aug 2017 16:03:15 +0000 (UTC)
commit 69efde800aa422c8fcfb1ac0bbbc3ef1c00b894b
Author: Carlos Garnacho <carlosg gnome org>
Date: Sun Aug 6 12:58:12 2017 +0200
tracker: Update queries to sparql1.1 correct syntax
Tracker has allowed "foo AS bar" syntax for a long time, but
this is nonstandard syntax as sparql1.1 settled on "foo AS ?bar".
Tracker 1.x ended up accepting both for a long time, but Tracker
2.x is finally dropping this nonstandard syntax.
Sticking to "AS ?foo" will be correct for both versions.
https://bugzilla.gnome.org/show_bug.cgi?id=785877
gnomenews/tracker.py | 50 +++++++++++++++++++++++++-------------------------
1 files changed, 25 insertions(+), 25 deletions(-)
---
diff --git a/gnomenews/tracker.py b/gnomenews/tracker.py
index c6feeb3..b5e8298 100644
--- a/gnomenews/tracker.py
+++ b/gnomenews/tracker.py
@@ -47,15 +47,15 @@ class Tracker(GObject.GObject):
def get_post_sorted_by_date(self, unread=False, starred=False):
query = """
SELECT
- nie:url(?msg) AS url
- nie:title(?msg) AS title
- nco:fullname(?creator) AS fullname
- nie:url(?website) AS author_homepage
- nco:emailAddress(?email) AS author_email
- nie:contentCreated(?msg) AS date
- nmo:htmlMessageContent(?msg) AS content
- nmo:isRead(?msg) AS is_read
- ?msg BOUND(?tag) as is_starred
+ nie:url(?msg) AS ?url
+ nie:title(?msg) AS ?title
+ nco:fullname(?creator) AS ?fullname
+ nie:url(?website) AS ?author_homepage
+ nco:emailAddress(?email) AS ?author_email
+ nie:contentCreated(?msg) AS ?date
+ nmo:htmlMessageContent(?msg) AS ?content
+ nmo:isRead(?msg) AS ?is_read
+ ?msg BOUND(?tag) AS ?is_starred
WHERE
{ ?msg a mfo:FeedMessage """
@@ -86,10 +86,10 @@ class Tracker(GObject.GObject):
def get_info_for_entry(self, url):
query = """
SELECT
- nie:title(?msg) AS title
- nco:fullname(?creator) AS fullname
- nie:url(?website) AS author_homepage
- nco:emailAddress(?email) AS author_email
+ nie:title(?msg) AS ?title
+ nco:fullname(?creator) AS ?fullname
+ nie:url(?website) AS ?author_homepage
+ nco:emailAddress(?email) AS ?author_email
WHERE
{ ?msg a mfo:FeedMessage ;
nie:url <%s> .
@@ -222,15 +222,15 @@ class Tracker(GObject.GObject):
"""
query = """
SELECT
- nie:url(?msg) AS url
- nie:title(?msg) AS title
- nco:fullname(?creator) AS fullname
- nie:url(?website) AS author_homepage
- nco:emailAddress(?email) AS author_email
- nie:contentCreated(?msg) AS date
- nmo:htmlMessageContent(?msg) AS content
- nmo:isRead(?msg) AS is_read
- ?msg BOUND(?tag) as is_starred
+ nie:url(?msg) AS ?url
+ nie:title(?msg) AS ?title
+ nco:fullname(?creator) AS ?fullname
+ nie:url(?website) AS ?author_homepage
+ nco:emailAddress(?email) AS ?author_email
+ nie:contentCreated(?msg) AS ?date
+ nmo:htmlMessageContent(?msg) AS ?content
+ nmo:isRead(?msg) AS ?is_read
+ ?msg BOUND(?tag) AS ?is_starred
{ ?msg a mfo:FeedMessage;
nmo:communicationChannel ?chan .
?chan nie:url "%s" .
@@ -262,8 +262,8 @@ class Tracker(GObject.GObject):
"""
query = """
SELECT
- nie:url(?chan) AS url
- nie:title(?chan) AS title
+ nie:url(?chan) AS ?url
+ nie:title(?chan) AS ?title
{ ?chan a mfo:FeedChannel"""
if url is not None:
@@ -297,7 +297,7 @@ class Tracker(GObject.GObject):
nie:contentCreated(?msg) AS ?date_created
nmo:htmlMessageContent(?msg) AS ?content
nmo:isRead(?msg) AS ?is_read
- ?msg BOUND(?tag) as ?is_starred
+ ?msg BOUND(?tag) AS ?is_starred
{ ?msg a mfo:FeedMessage; """
if channel:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]