[rygel] tracker: RDF op based on SearchExpression op
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [rygel] tracker: RDF op based on SearchExpression op
- Date: Mon, 16 Nov 2009 23:19:05 +0000 (UTC)
commit c6ecfc39c59d25bda9a599bd4c62430d66fa8f23
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Thu Nov 12 17:43:30 2009 +0200
tracker: RDF op based on SearchExpression op
Create RDF query operator from SearchExpression operator.
.../tracker/rygel-tracker-search-container.vala | 23 +++++++++++++++----
1 files changed, 18 insertions(+), 5 deletions(-)
---
diff --git a/src/plugins/tracker/rygel-tracker-search-container.vala b/src/plugins/tracker/rygel-tracker-search-container.vala
index 91eafc4..1b057b2 100644
--- a/src/plugins/tracker/rygel-tracker-search-container.vala
+++ b/src/plugins/tracker/rygel-tracker-search-container.vala
@@ -209,7 +209,9 @@ public class Rygel.TrackerSearchContainer : Rygel.MediaContainer {
}
var rel_expression = expression as RelationalExpression;
- if (rel_expression.operand1 == "@id") {
+ var query_op = this.get_op_for_expression (rel_expression);
+
+ if (rel_expression.operand1 == "@id" && query_op != null) {
string parent_id;
string service;
@@ -222,20 +224,20 @@ public class Rygel.TrackerSearchContainer : Rygel.MediaContainer {
var search_condition =
"<rdfq:and>\n" +
- "<rdfq:equals>\n" +
+ "<" + query_op + ">\n" +
"<rdfq:Property " +
"name=\"File:Path\" />\n" +
"<rdf:String>" +
dir +
"</rdf:String>\n" +
- "</rdfq:equals>\n" +
- "<rdfq:equals>\n" +
+ "</" + query_op + ">\n" +
+ "<" + query_op + ">\n" +
"<rdfq:Property " +
"name=\"File:Name\" />\n" +
"<rdf:String>" +
basename +
"</rdf:String>\n" +
- "</rdfq:equals>\n" +
+ "</" + query_op + ">\n" +
"</rdfq:and>\n";
if (this.query_condition != "") {
@@ -265,6 +267,17 @@ public class Rygel.TrackerSearchContainer : Rygel.MediaContainer {
return query;
}
+ private string? get_op_for_expression (RelationalExpression expression) {
+ switch (expression.op) {
+ case SearchCriteriaOp.EQ:
+ return "rdfq:equals";
+ case SearchCriteriaOp.CONTAINS:
+ return "rdfq:contains";
+ default:
+ return null;
+ }
+ }
+
public MediaItem? create_item (string service,
string path,
string[] metadata)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]