[tracker/miner-web: 11/24] Facebook miner: Add nie:dataSource to created objects
- From: Adrien Bustany <abustany src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [tracker/miner-web: 11/24] Facebook miner: Add nie:dataSource to created objects
- Date: Tue, 10 Nov 2009 16:15:44 +0000 (UTC)
commit ac0e3d96c92dc40315a6ebb145c7273f6fa5b081
Author: Adrien Bustany <madcat mymadcat com>
Date: Thu Nov 5 15:42:21 2009 -0300
Facebook miner: Add nie:dataSource to created objects
The use of nie:dataSource will make identifying objects which come from this
miner possible
src/tracker-miner-facebook/facebook.vala | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/tracker-miner-facebook/facebook.vala b/src/tracker-miner-facebook/facebook.vala
index ea138fb..d4c0bc4 100644
--- a/src/tracker-miner-facebook/facebook.vala
+++ b/src/tracker-miner-facebook/facebook.vala
@@ -8,6 +8,7 @@ public class FacebookMiner : Tracker.Miner, Tracker.MinerWeb {
private const string SHARED_SECRET = "dd34c9d53460953bfd3b5aa87c09b538";
private const string FACEBOOK_REST = "https://api.facebook.com/restserver.php";
private const string REST_ERRORMSG = "Error during REST call : %s";
+ private const string MINER_DATASOURCE_URN = "urn:nepomuk:datasource:40d8b787-3de2-46d3-984c-1b021a996ef9";
private const uint update_interval = 600; // in seconds
@@ -623,10 +624,11 @@ public class FacebookMiner : Tracker.Miner, Tracker.MinerWeb {
switch (results.length) {
case 0:
string urn = "urn:uuid:%s".printf (uuid_generate_string ());
- tracker.SparqlUpdate ("insert {<%s> a nfo:RemoteDataObject . <%s> a %s ; nie:isStoredAs <%1$s>}"
+ tracker.SparqlUpdate ("insert {<%s> a nfo:RemoteDataObject . <%s> a %s ; nie:isStoredAs <%1$s> ; nie:dataSource <%s>}"
.printf (stored_as,
urn,
- klass));
+ klass,
+ MINER_DATASOURCE_URN));
return urn;
case 1:
return results[0][0];
@@ -652,7 +654,7 @@ public class FacebookMiner : Tracker.Miner, Tracker.MinerWeb {
switch (results.length) {
case 0:
string urn = "urn:uuid:%s".printf (uuid_generate_string ());
- tracker.SparqlUpdate ("insert {<%s> a nco:Contact ; nco:fullname \"%s\"}".printf (urn, escaped_fullname));
+ tracker.SparqlUpdate ("insert {<%s> a nco:Contact ; nco:fullname \"%s\" ; nie:dataSource <%s>}".printf (urn, escaped_fullname, MINER_DATASOURCE_URN));
return urn;
case 1:
return results[0][0];
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]