Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graph drafter/graph-modified-times is not modified whilst in draft #567

Open
scottlowe opened this issue Jan 28, 2022 · 0 comments
Open

Comments

@scottlowe
Copy link
Contributor

scottlowe commented Jan 28, 2022

When the contents of a draft dataset are updated, the public http://publishmydata.com/graphs/drafter/graph-modified-times graph is not modified whilst in the draft. In client applications, e.g. muttnik, one needs to check both live and in the draft graph for modified times e.g. http://publishmydata.com/graphs/drafter/draft/7407ab26-9d9f-411d-8fd0-a93e98e7ffd2.

This is because the entire modified graph doesn’t get cloned into the draftset, only the modified graphs. This behaviour is different to the usual Drafter workflow where Drafter transparently takes care of it, such that queries work the same whether inside a draft or not, when rewritten.

The upshot is that just querying the graph in the draft endpoint won't work.

For example, the following query for modified times on a Dataset does not work in muttnik when in draft:

PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX pmdcat: <http://publishmydata.com/pmdcat#>
PREFIX pmdui: <http://publishmydata.com/def/pmdui/>

CONSTRUCT {
    <http://muttnik.gov/data/crimes-ds> pmdui:drafter-modified-date ?modified .
}
WHERE {

    GRAPH <http://muttnik.gov/graph/metadata/crimes> {
        ?cat_entry pmdcat:graph ?cat_graph .
    }

    GRAPH <http://publishmydata.com/graphs/drafter/graph-modified-times> {
        ?cat_graph dcterms:modified ?modified .
    }
}

the above is rewritten to:

PREFIX  pmdcat: <http://publishmydata.com/pmdcat#>
PREFIX  rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX  pmdui: <http://publishmydata.com/def/pmdui/>

CONSTRUCT
  {
    <http://muttnik.gov/data/crimes-ds> pmdui:drafter-modified-date ?modified .
  }
WHERE
  { GRAPH <http://muttnik.gov/graph/metadata/crimes>
      { ?cat_entry  pmdcat:graph  ?cat_graph }
     
    GRAPH <http://publishmydata.com/graphs/drafter/draft/7407ab26-9d9f-411d-8fd0-a93e98e7ffd2>
      { ?cat_graph  dcterms:modified  ?modified }
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant