[tracker/wip/carlosg/domain-ontologies: 13/20] ontologies: Build dc/xsd/rdf/nrl/nao as GResource
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/wip/carlosg/domain-ontologies: 13/20] ontologies: Build dc/xsd/rdf/nrl/nao as GResource
- Date: Fri, 2 Jun 2017 22:42:18 +0000 (UTC)
commit 92b41e2f7f43577daca1239f699f5abd664c2eea
Author: Carlos Garnacho <carlosg gnome org>
Date: Mon May 29 22:51:25 2017 +0200
ontologies: Build dc/xsd/rdf/nrl/nao as GResource
Those ontology files are the tracker core, as the database files' structure
is modeled around those classes and properties. Include those as a GResource
so they're guaranteed to be there, all other ontology files are optional
and must be provided on TrackerDataManager initialization.
The NAO ontology has been split between the official bits (included in the
GResource) and the non-official bits (just used by the evolution miner, and
moved to 90-tracker)
configure.ac | 3 ++
src/libtracker-data/Makefile.am | 2 +
src/libtracker-data/tracker-data-manager.c | 7 +++++
src/ontologies/11-rdf.ontology | 15 +++++++++++
src/ontologies/31-nao-custom.ontology | 29 +++++++++++++++++++++
src/ontologies/31-nao.ontology | 24 -----------------
src/ontologies/90-tracker.ontology | 38 +++++++++++++++++-----------
src/ontologies/Makefile.am | 17 +++++++++++-
8 files changed, 94 insertions(+), 41 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index ffdd760..2cf2a56 100644
--- a/configure.ac
+++ b/configure.ac
@@ -898,6 +898,9 @@ AC_SUBST(GLIB_MKENUMS)
GDBUS_CODEGEN=`$PKG_CONFIG --variable=gdbus_codegen gio-2.0`
AC_SUBST(GDBUS_CODEGEN)
+GLIB_COMPILE_RESOURCES=`$PKG_CONFIG --variable glib_compile_resources gio-2.0`
+AC_SUBST(GLIB_COMPILE_RESOURCES)
+
####################################################################
# Should we build GLib based unit tests
####################################################################
diff --git a/src/libtracker-data/Makefile.am b/src/libtracker-data/Makefile.am
index f7c64be..a47fd84 100644
--- a/src/libtracker-data/Makefile.am
+++ b/src/libtracker-data/Makefile.am
@@ -20,6 +20,8 @@ libtracker_datadir = $(libdir)/tracker-$(TRACKER_API_VERSION)
libtracker_data_LTLIBRARIES = libtracker-data.la
libtracker_data_la_SOURCES = \
+ $(top_builddir)/src/ontologies/tracker-gresources.c \
+ $(top_builddir)/src/ontologies/tracker-gresources.h \
tracker-vala-namespace.vala \
tracker-sparql-expression.vala \
tracker-sparql-pattern.vala \
diff --git a/src/libtracker-data/tracker-data-manager.c b/src/libtracker-data/tracker-data-manager.c
index 51f4ced..1fca650 100644
--- a/src/libtracker-data/tracker-data-manager.c
+++ b/src/libtracker-data/tracker-data-manager.c
@@ -3455,6 +3455,13 @@ get_ontologies (const gchar *ontologies_dir,
sorted = g_list_sort (sorted, (GCompareFunc) compare_file_names);
+ /* Add our builtin ontologies so they are loaded first */
+ sorted = g_list_prepend (sorted, g_file_new_for_uri
("resource://org/freedesktop/tracker/ontology/31-nao.ontology"));
+ sorted = g_list_prepend (sorted, g_file_new_for_uri
("resource://org/freedesktop/tracker/ontology/20-dc.ontology"));
+ sorted = g_list_prepend (sorted, g_file_new_for_uri
("resource://org/freedesktop/tracker/ontology/12-nrl.ontology"));
+ sorted = g_list_prepend (sorted, g_file_new_for_uri
("resource://org/freedesktop/tracker/ontology/11-rdf.ontology"));
+ sorted = g_list_prepend (sorted, g_file_new_for_uri
("resource://org/freedesktop/tracker/ontology/10-xsd.ontology"));
+
g_object_unref (enumerator);
return sorted;
diff --git a/src/ontologies/11-rdf.ontology b/src/ontologies/11-rdf.ontology
index 869f73e..7f65325 100644
--- a/src/ontologies/11-rdf.ontology
+++ b/src/ontologies/11-rdf.ontology
@@ -133,3 +133,18 @@ tracker:damaged a rdf:Property ;
nrl:maxCardinality 1 ;
rdfs:domain rdfs:Resource ;
rdfs:range xsd:boolean .
+
+tracker:notify a rdf:Property ;
+ nrl:maxCardinality 1 ;
+ rdfs:domain rdfs:Class ;
+ rdfs:range xsd:boolean .
+
+tracker:writeback a rdf:Property ;
+ nrl:maxCardinality 1 ;
+ rdfs:domain rdf:Property ;
+ rdfs:range xsd:boolean .
+
+tracker:forceJournal a rdf:Property ;
+ nrl:maxCardinality 1 ;
+ rdfs:domain rdf:Property ;
+ rdfs:range xsd:boolean .
diff --git a/src/ontologies/31-nao-custom.ontology b/src/ontologies/31-nao-custom.ontology
new file mode 100644
index 0000000..03e9339
--- /dev/null
+++ b/src/ontologies/31-nao-custom.ontology
@@ -0,0 +1,29 @@
+@prefix nao: <http://www.semanticdesktop.org/ontologies/2007/08/15/nao#> .
+@prefix nie: <http://www.semanticdesktop.org/ontologies/2007/01/19/nie#> .
+@prefix nrl: <http://www.semanticdesktop.org/ontologies/2007/08/15/nrl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+# These are added and approval by Nepomuk-upstream should be gotten with an ouija board.
+
+nao:Property a rdfs:Class ;
+ rdfs:label "Custom property to extend a class dynamically" ;
+ rdfs:comment "Dont use this without asking first your ontology doctor" ;
+ rdfs:subClassOf rdfs:Resource .
+
+nao:propertyName a rdf:Property ;
+ nrl:maxCardinality 1 ;
+ rdfs:domain nao:Property ;
+ rdfs:range xsd:string .
+
+nao:propertyValue a rdf:Property ;
+ nrl:maxCardinality 1 ;
+ rdfs:domain nao:Property ;
+ rdfs:range xsd:string .
+
+nao:hasProperty a rdf:Property ;
+ rdfs:domain nie:InformationElement ;
+ rdfs:range nao:Property .
+
+nao:predefined-tag-favorite a nao:Tag .
diff --git a/src/ontologies/31-nao.ontology b/src/ontologies/31-nao.ontology
index 1b3a109..4581d6b 100644
--- a/src/ontologies/31-nao.ontology
+++ b/src/ontologies/31-nao.ontology
@@ -1,6 +1,5 @@
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix nao: <http://www.semanticdesktop.org/ontologies/2007/08/15/nao#> .
-@prefix nie: <http://www.semanticdesktop.org/ontologies/2007/01/19/nie#> .
@prefix nrl: <http://www.semanticdesktop.org/ontologies/2007/08/15/nrl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@@ -54,29 +53,6 @@ nao:deprecated a rdf:Property;
rdfs:label "deprecated";
rdfs:comment "If this property is assigned, the subject class, property, or resource, is deprecated
and should not be used in production systems any longer. It may be removed without further notice." .
-# These are added and approval by Nepomuk-upstream is pending
-
-nao:Property a rdfs:Class ;
- rdfs:label "Custom property to extend a class dynamically" ;
- rdfs:comment "Dont use this without asking first your ontology doctor" ;
- rdfs:subClassOf rdfs:Resource .
-
-nao:propertyName a rdf:Property ;
- nrl:maxCardinality 1 ;
- rdfs:domain nao:Property ;
- rdfs:range xsd:string .
-
-nao:propertyValue a rdf:Property ;
- nrl:maxCardinality 1 ;
- rdfs:domain nao:Property ;
- rdfs:range xsd:string .
-
-nao:hasProperty a rdf:Property ;
- rdfs:domain nie:InformationElement ;
- rdfs:range nao:Property .
-
-nao:predefined-tag-favorite a nao:Tag .
-
nao:lastModified a rdf:Property ;
rdfs:label "lastModified" ;
rdfs:comment "last modification date" ;
diff --git a/src/ontologies/90-tracker.ontology b/src/ontologies/90-tracker.ontology
index 565268c..6074426 100644
--- a/src/ontologies/90-tracker.ontology
+++ b/src/ontologies/90-tracker.ontology
@@ -18,11 +18,6 @@ tracker:tagRelatedTo a rdf:Property ;
rdfs:domain nao:Tag ;
rdfs:range rdfs:Class .
-tracker:notify a rdf:Property ;
- nrl:maxCardinality 1 ;
- rdfs:domain rdfs:Class ;
- rdfs:range xsd:boolean .
-
tracker:Volume a rdfs:Class ;
rdfs:label "Storage media" ;
rdfs:subClassOf nie:InformationElement ;
@@ -58,18 +53,31 @@ tracker:available a rdf:Property ;
rdfs:domain nie:DataObject ;
rdfs:range xsd:boolean .
-tracker:writeback a rdf:Property ;
- nrl:maxCardinality 1 ;
- rdfs:domain rdf:Property ;
- rdfs:range xsd:boolean .
-
-tracker:forceJournal a rdf:Property ;
- nrl:maxCardinality 1 ;
- rdfs:domain rdf:Property ;
- rdfs:range xsd:boolean .
-
fts: a tracker:Namespace ;
tracker:prefix "fts" .
tracker:extractor-data-source a nie:DataSource ;
rdfs:label "Tracker extractor data source" .
+
+# These are added and approval by Nepomuk-upstream should be gotten with an ouija board.
+
+nao:Property a rdfs:Class ;
+ rdfs:label "Custom property to extend a class dynamically" ;
+ rdfs:comment "Dont use this without asking first your ontology doctor" ;
+ rdfs:subClassOf rdfs:Resource .
+
+nao:propertyName a rdf:Property ;
+ nrl:maxCardinality 1 ;
+ rdfs:domain nao:Property ;
+ rdfs:range xsd:string .
+
+nao:propertyValue a rdf:Property ;
+ nrl:maxCardinality 1 ;
+ rdfs:domain nao:Property ;
+ rdfs:range xsd:string .
+
+nao:hasProperty a rdf:Property ;
+ rdfs:domain nie:InformationElement ;
+ rdfs:range nao:Property .
+
+nao:predefined-tag-favorite a nao:Tag .
diff --git a/src/ontologies/Makefile.am b/src/ontologies/Makefile.am
index 31ce129..b500fb4 100644
--- a/src/ontologies/Makefile.am
+++ b/src/ontologies/Makefile.am
@@ -3,13 +3,15 @@ maemo_ontology = \
configdir = $(datadir)/tracker/ontologies
-config_DATA = \
+internal_config = \
10-xsd.ontology 10-xsd.description \
11-rdf.ontology 11-rdf.description \
12-nrl.ontology 12-nrl.description \
20-dc.ontology 20-dc.description \
+ 31-nao.ontology 31-nao.description
+
+config_DATA = \
30-nie.ontology 30-nie.description \
- 31-nao.ontology 31-nao.description \
32-nco.ontology 32-nco.description \
33-nfo.ontology 33-nfo.description \
34-nmo.ontology 34-nmo.description \
@@ -29,6 +31,17 @@ if HAVE_MAEMO
config_DATA += $(maemo_ontology)
endif
+# GResource
+tracker_gresource_files = $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --generate-dependencies
$(srcdir)/builtin-ontology.gresource.xml)
+tracker-gresources.h: builtin-ontology.gresource.xml $(tracker_gresource_files) $(internal_config)
+ $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --sourcedir=$(builddir)
--generate --c-name tracker_gresources $<
+tracker-gresources.c: builtin-ontology.gresource.xml $(tracker_gresource_files) $(internal_config)
+ $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --sourcedir=$(builddir)
--generate --c-name tracker_gresources $<
+
+BUILT_SOURCES = tracker-gresources.c tracker-gresources.h
+
EXTRA_DIST = \
+ $(internal_config) \
+ builtin-ontology.gresource.xml \
$(maemo_ontology) \
$(config_DATA)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]