[polari/wip/carlosg/tracker: 1/16] data: Define cardinality in several ontology properties



commit a456afc399f0cd3be2bfd4fad8d408e28fee7d0d
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Feb 24 22:27:49 2019 +0100

    data: Define cardinality in several ontology properties
    
    Tracker by default allows unlimited cardinality on properties.
    This is not desirable for most of the defined properties, plus
    insertions and queries are usually faster when maxCardinality=1.

 data/resources/polari.ontology | 9 +++++++++
 1 file changed, 9 insertions(+)
---
diff --git a/data/resources/polari.ontology b/data/resources/polari.ontology
index e27e662..810cc51 100644
--- a/data/resources/polari.ontology
+++ b/data/resources/polari.ontology
@@ -3,6 +3,7 @@
 @prefix tracker: <http://www.tracker-project.org/ontologies/tracker#> .
 @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
 @prefix nao: <http://www.semanticdesktop.org/ontologies/2007/08/15/nao#> .
+@prefix nrl: <http://www.semanticdesktop.org/ontologies/2007/08/15/nrl#> .
 
 @prefix polari: <http://example.org/ns#> .
 
@@ -15,6 +16,7 @@ polari:Account a rdfs:Class ;
                rdfs:subClassOf rdfs:Resource .
 
 polari:id a rdf:Property ;
+          nrl:maxCardinality 1 ;
           rdfs:domain polari:Account ;
           rdfs:range xsd:string .
 
@@ -23,6 +25,7 @@ polari:Contact a rdfs:Class ;
                rdfs:subClassOf rdfs:Resource .
 
 polari:nick a rdf:Property ;
+            nrl:maxCardinality 1 ;
             rdfs:domain polari:Contact ;
             rdfs:range xsd:string .
 
@@ -35,6 +38,7 @@ polari:Channel a rdfs:Class ;
                rdfs:subClassOf rdfs:Resource .
 
 polari:name a rdf:Property ;
+            nrl:maxCardinality 1 ;
             rdfs:domain polari:Channel ;
             rdfs:range xsd:string .
 
@@ -51,6 +55,7 @@ polari:Conversation a rdfs:Class ;
                     rdfs:subClassOf polari:Channel .
 
 polari:target a rdf:Property ;
+            nrl:maxCardinality 1 ;
             rdfs:domain polari:Conversation ;
             rdfs:range polari:Contact .
 
@@ -59,18 +64,22 @@ polari:Message a rdfs:Class ;
                rdfs:subClassOf rdfs:Resource .
 
 polari:channel a rdf:Property ;
+               nrl:maxCardinality 1 ;
                rdfs:domain polari:Message ;
                rdfs:range polari:Channel .
 
 polari:sender a rdf:Property ;
+              nrl:maxCardinality 1 ;
               rdfs:domain polari:Message ;
               rdfs:range polari:Contact .
 
 polari:time a rdf:Property ;
+            nrl:maxCardinality 1 ;
             rdfs:domain polari:Message ;
             rdfs:range xsd:dateTime .
 
 polari:text a rdf:Property ;
+            nrl:maxCardinality 1 ;
             rdfs:domain polari:Message ;
             rdfs:range xsd:string ;
             tracker:fulltextIndexed true .


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