• Sam Thursfield's avatar
    Use TrackerResource instead of TrackerSparqlBuilder in all extractors · 8cc026da
    Sam Thursfield authored
    For a long time, all the Tracker extractors have manually constructed a
    SPARQL update command using TrackerSparqlBuilder to represent their
    output. This commit changes all of them to use the TrackerResource
    class instead, which makes the code a lot more concise and readable.
    This introduces some API breaks in the internal libtracker-extract
    library. This has been a private library since Tracker 0.16 or earlier,
    so it's fine.
    If the extractors only output SPARQL then they are only useful to
    people who are using a SPARQL store. Now we can output a serialization
    format like Turtle as well. This will hopefully make the extract modules
    useful outside of Tracker itself.
    I've tried to preserve the behaviour of the extractors as much as
    possible, but there are two things that are now handled differently:
      * nao:Tag resources are given a fixed URI based on the tag label, such
        as <urn:tag:My_Tag>. Previously they were inserted as blank nodes,
        so tracker-store would give them unique IDs like <urn:uuid:1234...>
      * All extractors created nco:Contact resources for content publishers,
        but previously some would assign fixed URIs based on the name
        <urn:contact:James%20Joyce>, while others would insert them as blank
        nodes so they would be assigned unique IDs like <urn:uuid:1234...>.
        Now, all extractors create nco:Contact resources with fixed URIs
        based on the content creator's name.
tracker-extract-playlist.c 5.02 KB