Commit e6f99f4a authored by Sam Thursfield's avatar Sam Thursfield

tracker-extract-desktop: Change how desktop 'Link' files are stored

While this is an API break, the API was added recently and I suspect
it's not used yet.

The old representation was a problem because the isStoredAs attribute,
which we use to relate files with their contents, was being used to
relate the bookmark to the website.

Old output:

    INSERT DATA {
      <urn:link:https:%2F%2Fen.wikipedia.org%2Fwiki%2FTracker_(search_software)> a nie:DataObject , nfo:Website , nfo:FileDataObject ;
        nie:url "https://en.wikipedia.org/wiki/Tracker_(search_software)" .
      _:1 nie:title "Wikipedia Tracker" ;
        nie:isStoredAs <urn:link:https:%2F%2Fen.wikipedia.org%2Fwiki%2FTracker_(search_software)> .
    };

New output:

    INSERT DATA {
      <file:///home/sam/src/tracker-miners/tests/functional-tests/test-extraction-data/desktop/link-wikipedia-tracker.desktop> a nfo:FileDataObject .
      <https://en.wikipedia.org/wiki/Tracker_(search_software)> a nie:DataObject , nie:Website ;
        nie:url "https://en.wikipedia.org/wiki/Tracker_(search_software)" .
      _:1 a nfo:Bookmark ;
        nie:isStoredAs <file:///home/sam/src/tracker-miners/tests/functional-tests/test-extraction-data/desktop/link-wikipedia-tracker.desktop> ;
        nie:title "Wikipedia Tracker" ;
        nie:bookmarks <https://en.wikipedia.org/wiki/Tracker_(search_software)> .
    };

See !181
for original MR.
parent 1df80d64
......@@ -169,20 +169,16 @@ process_desktop_file (TrackerResource *resource,
if (link_url) {
TrackerResource *website_resource;
gchar *link_uri;
g_strstrip (link_url);
link_uri = tracker_sparql_escape_uri_printf (LINK_URN_PREFIX "%s", link_url);
website_resource = tracker_resource_new (link_uri);
website_resource = tracker_resource_new (link_url);
tracker_resource_add_uri (website_resource, "rdf:type", "nie:DataObject");
tracker_resource_add_uri (website_resource, "rdf:type", "nfo:Website");
tracker_resource_set_string (website_resource, "nie:url", link_url);
tracker_resource_set_take_relation (resource, "nie:isStoredAs", website_resource);
tracker_resource_add_uri (resource, "rdf:type", "nfo:Bookmark");
tracker_resource_set_take_relation (resource, "nfo:bookmarks", website_resource);
g_free (link_url);
g_free (link_uri);
} else {
/* a Link desktop entry must have an URL */
gchar *uri;
......
......@@ -4,8 +4,8 @@
},
"metadata": {
"nie:title" : "Wikipedia Tracker",
"nie:isStoredAs": {
"@id": "urn:link:https:%2F%2Fen.wikipedia.org%2Fwiki%2FTracker_(search_software)",
"nfo:bookmarks": {
"@id": "https://en.wikipedia.org/wiki/Tracker_(search_software)",
"@type": [
"nie:DataObject",
"nfo:Website"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment