[tracker] NMO: Change secondary index for nmo:communicationChannel



commit ec4949d4d1fe783e23a87dca1817630821c1e76e
Author: Jürg Billeter <j bitron ch>
Date:   Thu Feb 3 11:49:33 2011 +0100

    NMO: Change secondary index for nmo:communicationChannel
    
    nmo:receivedDate is the property relevant for sorting messages in a
    communication channel, not nmo:sentDate.

 data/ontologies/34-nmo.ontology                   |    2 +-
 data/ontologies/Indices.list                      |    7 +++++--
 tests/functional-tests/performance-tc-modified.py |   16 ++++++++--------
 tests/functional-tests/performance-tc.py          |   16 ++++++++--------
 4 files changed, 22 insertions(+), 19 deletions(-)
---
diff --git a/data/ontologies/34-nmo.ontology b/data/ontologies/34-nmo.ontology
index 3bde7ed..250b409 100644
--- a/data/ontologies/34-nmo.ontology
+++ b/data/ontologies/34-nmo.ontology
@@ -273,7 +273,7 @@ nmo:conversation a rdf:Property ;
 nmo:communicationChannel a rdf:Property ;
 	rdfs:comment "Connects this message to a communication channel. Every message must only be in a single channel." ;
 	tracker:indexed true ;
-	tracker:secondaryIndex nmo:sentDate ;
+	tracker:secondaryIndex nmo:receivedDate ;
 	nrl:maxCardinality 1 ;
 	rdfs:domain nmo:Message ;
 	rdfs:range nmo:CommunicationChannel .
diff --git a/data/ontologies/Indices.list b/data/ontologies/Indices.list
index 8e68557..cfcd7f4 100644
--- a/data/ontologies/Indices.list
+++ b/data/ontologies/Indices.list
@@ -50,16 +50,19 @@
 
 * nmo:sentDate:
   - Used for sorting messages when displaying all messages (or rather the last N).
-  - Secondary index for nmo:communicationChannel
   - Domain index for nmo:Call used for linear call history.
 
+* nmo:receivedDate:
+  - Secondary index for nmo:communicationChannel to display last N messages on
+  a specific channel.
+
 * nmo:conversation:
   - Used for retrieving all messages of a specific conversation.
 
 * nmo:communicationChannel:
   - Used for displaying all conversations on a specific channel (for example,
   all conversations with a specific contact).
-  - Secondary index on nmo:sentDate
+  - Secondary index on nmo:receivedDate
 
 * nmo:lastMessageDate:
   - Used for sorting the list of all channels by time of last message.
diff --git a/tests/functional-tests/performance-tc-modified.py b/tests/functional-tests/performance-tc-modified.py
index 9b90575..c776a5c 100644
--- a/tests/functional-tests/performance-tc-modified.py
+++ b/tests/functional-tests/performance-tc-modified.py
@@ -360,7 +360,7 @@ class rtcom(TestUpdate):
 		query = "SELECT ?msg ?date ?text ?contact \
 			WHERE { \
     			?msg nmo:communicationChannel <urn:channel:1> ; \
-        		nmo:sentDate ?date ; \
+        		nmo:receivedDate ?date ; \
         		nie:plainTextContent ?text . \
     			<urn:channel:1> nmo:hasParticipant ?contact . \
 			} ORDER BY DESC(?date) LIMIT 50"
@@ -368,7 +368,7 @@ class rtcom(TestUpdate):
 		#query = "SELECT ?msg ?date ?text ?contact \
 		#	WHERE { \
     		#	?msg nmo:communicationChannel <urn:uuid:7585395544138154780> ; \
-        	#	nmo:sentDate ?date ; \
+        	#	nmo:receivedDate ?date ; \
         	#	nie:plainTextContent ?text ; \
         	#	nmo:from [ nco:hasIMAddress ?fromAddress ] . \
     		#	<urn:uuid:7585395544138154780> nmo:hasParticipant ?contact . \
@@ -419,7 +419,7 @@ class rtcom(TestUpdate):
 			     nmo:isDeleted(?message) \
 			     nmo:messageId(?message) \
 			     nmo:phoneMessageId(?message) \
-			     nmo:sentDate(?message) \
+			     nmo:receivedDate(?message) \
 			     nmo:receivedDate(?message) \
 			     nie:contentLastModified(?message) \
 			     nmo:messageSubject(?message) \
@@ -463,7 +463,7 @@ class rtcom(TestUpdate):
 			    ?message a nmo:Message . \
 			    ?message nmo:isDraft false . \
 			    ?message nmo:isDeleted false . \
-			    ?message nmo:sentDate ?date . \
+			    ?message nmo:receivedDate ?date . \
 			    ?message nmo:from ?fromContact . \
 			    ?message nmo:to ?toContact . \
 			    ?fromContact nco:hasContactMedium ?from . \
@@ -590,7 +590,7 @@ class rtcom(TestUpdate):
     				(SELECT COUNT(?message) AS ?message_count  \
 					WHERE { ?message nmo:communicationChannel ?channel ; nmo:isRead true }) \
 			WHERE { SELECT ?channel ?participant ?last_date  \
-				(SELECT ?message WHERE { ?message nmo:communicationChannel ?channel ; nmo:sentDate ?date } ORDER BY DESC(?date) LIMIT 1) AS ?last_message \
+				(SELECT ?message WHERE { ?message nmo:communicationChannel ?channel ; nmo:receivedDate ?date } ORDER BY DESC(?date) LIMIT 1) AS ?last_message \
     				WHERE { \
         			?channel a nmo:CommunicationChannel ; \
             			nmo:lastMessageDate ?last_date ; \
@@ -627,7 +627,7 @@ class rtcom(TestUpdate):
 		query = "SELECT ?msg ?date ?text ?contact \
 			WHERE { \
 			?msg nmo:communicationChannel <urn:channel:1> ; \
-        		nmo:sentDate ?date ; \
+        		nmo:receivedDate ?date ; \
         		nie:plainTextContent ?text ; \
         		nmo:from [ nco:hasIMAddress ?fromAddress ] . \
     			<urn:channel:1> nmo:hasParticipant ?contact . \
@@ -637,7 +637,7 @@ class rtcom(TestUpdate):
 		#query = "SELECT ?msg ?date ?text ?contact \
 		#	WHERE { \
     		#	?msg nmo:communicationChannel <urn:uuid:7585395544138154780> ; \
-        	#	nmo:sentDate ?date ; \
+        	#	nmo:receivedDate ?date ; \
         	#	nie:plainTextContent ?text ; \
         	#	nmo:from [ nco:hasIMAddress ?fromAddress ] . \
     		#	<urn:uuid:7585395544138154780> nmo:hasParticipant ?contact . \
@@ -686,7 +686,7 @@ class rtcom(TestUpdate):
 			WHERE { \
 			  SELECT ?channel  ?subject  ?lastDate \
 				  \
-				 ( SELECT ?message WHERE {?message nmo:communicationChannel ?channel . ?message nmo:sentDate ?sentDate .} ORDER BY DESC(?sentDate) LIMIT 1) AS ?lastMessage \
+				 ( SELECT ?message WHERE {?message nmo:communicationChannel ?channel . ?message nmo:receivedDate ?receivedDate .} ORDER BY DESC(?receivedDate) LIMIT 1) AS ?lastMessage \
 			      (SELECT ?contact \
 			      WHERE { \
 				    { \
diff --git a/tests/functional-tests/performance-tc.py b/tests/functional-tests/performance-tc.py
index 85cfa5d..cedb21e 100644
--- a/tests/functional-tests/performance-tc.py
+++ b/tests/functional-tests/performance-tc.py
@@ -245,7 +245,7 @@ class rtcom(TestUpdate):
     				(SELECT COUNT(?message) AS ?message_count  \
 					WHERE { ?message nmo:communicationChannel ?channel ; nmo:isRead true }) \
 			WHERE { SELECT ?channel ?participant ?last_date  \
-				(SELECT ?message WHERE { ?message nmo:communicationChannel ?channel ; nmo:sentDate ?date } ORDER BY DESC(?date) LIMIT 1) AS ?last_message \
+				(SELECT ?message WHERE { ?message nmo:communicationChannel ?channel ; nmo:receivedDate ?date } ORDER BY DESC(?date) LIMIT 1) AS ?last_message \
     				WHERE { \
         			?channel a nmo:CommunicationChannel ; \
             			nmo:lastMessageDate ?last_date ; \
@@ -270,7 +270,7 @@ class rtcom(TestUpdate):
 		query = "SELECT ?msg ?date ?text ?contact \
 			WHERE { \
     			?msg nmo:communicationChannel <urn:channel:1> ; \
-        		nmo:sentDate ?date ; \
+        		nmo:receivedDate ?date ; \
         		nie:plainTextContent ?text . \
     			<urn:channel:1> nmo:hasParticipant ?contact . \
 			} ORDER BY DESC(?date) LIMIT 50"
@@ -278,7 +278,7 @@ class rtcom(TestUpdate):
 		#query = "SELECT ?msg ?date ?text ?contact \
 		#	WHERE { \
     		#	?msg nmo:communicationChannel <urn:uuid:7585395544138154780> ; \
-        	#	nmo:sentDate ?date ; \
+        	#	nmo:receivedDate ?date ; \
         	#	nie:plainTextContent ?text ; \
         	#	nmo:from [ nco:hasIMAddress ?fromAddress ] . \
     		#	<urn:uuid:7585395544138154780> nmo:hasParticipant ?contact . \
@@ -299,7 +299,7 @@ class rtcom(TestUpdate):
 		query = "SELECT ?msg ?date ?text ?contact \
 			WHERE { \
     			?msg nmo:communicationChannel <urn:channel:1> ; \
-        		nmo:sentDate ?date ; \
+        		nmo:receivedDate ?date ; \
         		nie:plainTextContent ?text ; \
         		nmo:from [ nco:hasIMAddress ?fromAddress ] . \
     			<urn:channel:1> nmo:hasParticipant ?contact . \
@@ -309,7 +309,7 @@ class rtcom(TestUpdate):
 		#query = "SELECT ?msg ?date ?text ?contact \
 		#	WHERE { \
     		#	?msg nmo:communicationChannel <urn:uuid:7585395544138154780> ; \
-        	#	nmo:sentDate ?date ; \
+        	#	nmo:receivedDate ?date ; \
         	#	nie:plainTextContent ?text ; \
         	#	nmo:from [ nco:hasIMAddress ?fromAddress ] . \
     		#	<urn:uuid:7585395544138154780> nmo:hasParticipant ?contact . \
@@ -346,7 +346,7 @@ SELECT ?message ?date ?from ?to \
      nmo:isDeleted(?message) \
      nmo:messageId(?message) \
      nmo:phoneMessageId(?message) \
-     nmo:sentDate(?message) \
+     nmo:receivedDate(?message) \
      nmo:receivedDate(?message) \
      nie:contentLastModified(?message) \
      nmo:messageSubject(?message) \
@@ -390,7 +390,7 @@ WHERE \
     ?message a nmo:Message . \
     ?message nmo:isDraft false . \
     ?message nmo:isDeleted false . \
-    ?message nmo:sentDate ?date . \
+    ?message nmo:receivedDate ?date . \
     ?message nmo:from ?fromContact . \
     ?message nmo:to ?toContact . \
     ?fromContact nco:hasContactMedium ?from . \
@@ -427,7 +427,7 @@ SELECT ?channel ?subject nie:generator(?channel) \
 WHERE { \
   SELECT ?channel  ?subject  ?lastDate \
           \
-         ( SELECT ?message WHERE {?message nmo:communicationChannel ?channel . ?message nmo:sentDate ?sentDate .} ORDER BY DESC(?sentDate) LIMIT 1) AS ?lastMessage \
+         ( SELECT ?message WHERE {?message nmo:communicationChannel ?channel . ?message nmo:receivedDate ?receivedDate .} ORDER BY DESC(?receivedDate) LIMIT 1) AS ?lastMessage \
       (SELECT ?contact \
       WHERE { \
             { \



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