[nautilus/sam/tracker-3: 24/24] tag-manager: Update ontology
- From: Sam Thursfield <sthursfield src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/sam/tracker-3: 24/24] tag-manager: Update ontology
- Date: Mon, 1 Jun 2020 18:52:13 +0000 (UTC)
commit afcf3259820f67cbae48035f1cd4b8a3a12602cd
Author: Sam Thursfield <sam afuera me uk>
Date: Mon Jun 1 20:50:39 2020 +0200
tag-manager: Update ontology
We now define a class, which should make the database schema clearer.
data/ontology/nautilus.ontology | 8 ++++++--
src/nautilus-tag-manager.c | 12 ++++++++----
2 files changed, 14 insertions(+), 6 deletions(-)
---
diff --git a/data/ontology/nautilus.ontology b/data/ontology/nautilus.ontology
index 2a677da13..ce9ad8d53 100644
--- a/data/ontology/nautilus.ontology
+++ b/data/ontology/nautilus.ontology
@@ -6,9 +6,13 @@
nautilus: a tracker:Namespace, tracker:Ontology ;
tracker:prefix "nautilus" ;
- tracker:lastModified "2020-05-03T10:00:00Z" .
+ tracker:lastModified "2020-05-01T10:00:00Z" .
+
+nautilus:FileReference a rdfs:Class ;
+ rdfs:comment "A unique ID for a file, corresponding with the nie:InformationElement created by
tracker-miner-fs. We use a unique ID rather than the file URL so the star will follow renames." ;
+ rdfs:subClassOf rdfs:Resource .
nautilus:starred a rdf:Property ;
rdfs:comment "Marks resources that are starred in Nautilus." ;
- rdfs:domain rdfs:Resource ;
+ rdfs:domain nautilus:FileReference ;
rdfs:range xsd:boolean .
diff --git a/src/nautilus-tag-manager.c b/src/nautilus-tag-manager.c
index 70cb37027..0db4a361b 100644
--- a/src/nautilus-tag-manager.c
+++ b/src/nautilus-tag-manager.c
@@ -86,7 +86,8 @@ enum
#define QUERY_STARRED_FILES \
"SELECT ?file_url ?content_id " \
"{ " \
- " ?content_urn nautilus:starred true . " \
+ " ?content_urn a nautilus:FileReference ; " \
+ " nautilus:starred true . " \
" SERVICE <dbus:" TRACKER_MINER_FS_BUSNAME "> { " \
" ?content_urn nie:isStoredAs ?file_url . " \
" BIND (tracker:id (?content_urn) AS ?content_id) " \
@@ -434,7 +435,10 @@ nautilus_tag_manager_delete_tag (NautilusTagManager *self,
GString *query)
{
g_string_append (query,
- "DELETE { ?content_urn nautilus:starred true } "
+ "DELETE { "
+ " ?content_urn a nautilus:FileReference ; "
+ " nautilus:starred true . "
+ "} "
"WHERE { "
" SERVICE <dbus:" TRACKER_MINER_FS_BUSNAME "> { "
" ?content_urn nie:isStoredAs ?file_url . ");
@@ -453,8 +457,8 @@ nautilus_tag_manager_insert_tag (NautilusTagManager *self,
{
g_string_append (query,
"INSERT { "
- " ?content_urn a rdfs:Resource . "
- " ?content_urn nautilus:starred true . "
+ " ?content_urn a nautilus:FileReference . "
+ " ?content_urn nautilus:starred true . "
"} WHERE { "
" SERVICE <dbus:" TRACKER_MINER_FS_BUSNAME "> { "
" ?content_urn nie:isStoredAs ?file_url . ");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]