Memento


On this page

    Using the Memento protocol, it is possible to perform time-based content negotiation over HTTP. This allows servers to expose different temporal versions of resources next to each other, and clients to retrieve these versions at different times.

    Comunica has built-in support for the Memento protocol (actor-http-memento). To enable Memento, one simply passes a date to the query engine via the context, and Comunica will perform time-based negotiation for that date.

    For example, the DBpedia TPF interface supports the Memento protocol. In order to query over it at version 2010 from the command line, a custom date can be passed with -d:

    $ comunica-sparql https://fragments.dbpedia.org/2016-04/en \
        -d 'June 1, 2010' \
        'SELECT ?name ?deathDate WHERE {
           ?person a dbpedia-owl:Artist;
                   rdfs:label ?name;
                   dbpedia-owl:birthPlace [ rdfs:label "York"@en ].
           FILTER LANGMATCHES(LANG(?name),  "EN")
           OPTIONAL { ?person dbpprop:dateOfDeath ?deathDate. }
         }'
    

    Dates can also be passed via the JavaScript API, via the query engine context.