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

Diff query #55

Open
markusgraube opened this issue Jul 13, 2017 · 3 comments
Open

Diff query #55

markusgraube opened this issue Jul 13, 2017 · 3 comments
Assignees

Comments

@markusgraube
Copy link
Member

markusgraube commented Jul 13, 2017

Provide template for diff queries between two revisions with

  • added triples
  • deleted triples
  • same triples

Should be possible with

CONSTRUCT {
  GRAPH <added> { ?s_a ?p_a ?o_a}
  GRAPH <deleted> { ?s_d ?p_d ?o_d}
  GRAPH <same> { ?s_s ?p_s ?o_s}
}
WHERE {
  GRAPH <dataset> REVISION "2" {
   ?s_d ?p_d ?o_d.
   ?s_s ?p_s ?o_s.
  }
  GRAPH <dataset> REVISION "5" {
   ?s_a ?p_a ?o_a. 
   ?s_s ?p_s ?o_s.
  }
 MINUS {
    GRAPH <dataset> REVISION "5" {
      ?s_d ?p_d ?o_d.
    }
  }
MINUS {
    GRAPH <dataset> REVISION "2" {
      ?s_a ?p_a ?o_a.
    }
  }
}

Create a API for this query dependant on graph, from and to:

http://localhost:9998/r43ples/diff?graph=<dataset>&from=<revision1>&to=<revision2>

Optionally the request can be specified to a specific resource with the additional query fragment resource:

http://localhost:9998/r43ples/diff?graph=<dataset>&from=<revision1>&to=<revision2>&resource=<resource>

The result should provide a TRIG serialisation of the changes:

<added> {
  // added triples
}
<deleted> {
  //deleted triples
}
<same> {
  //same triples
}
@markusgraube markusgraube self-assigned this Jul 13, 2017
@markusgraube
Copy link
Member Author

Okay, CREATE doesn't support Named Graphs.

Furthermore, the temp graph is overwritten by the same graph with another revision number. I have to fix this first

@markusgraube
Copy link
Member Author

Same Triples:

CONSTRUCT {?s ?p ?o.}
WHERE {
  GRAPH <http://test.com/r43ples-dataset-1> REVISION "2" {
   ?s ?p ?o.
  }
  GRAPH <http://test.com/r43ples-dataset-1> REVISION "5" {
   ?s ?p ?o.
  }
}

@markusgraube
Copy link
Member Author

added triples

CONSTRUCT {?s ?p ?o.}
WHERE {
GRAPH <http://test.com/r43ples-dataset-1> REVISION "5" {
   ?s ?p ?o.
  }
  MINUS {GRAPH <http://test.com/r43ples-dataset-1> REVISION "2" {
   ?s ?p ?o.
  }
}
}

deleted triples

CONSTRUCT {?s ?p ?o.}
WHERE {
  GRAPH <http://test.com/r43ples-dataset-1> REVISION "2" {
   ?s ?p ?o.
  }
MINUS {
GRAPH <http://test.com/r43ples-dataset-1> REVISION "5" {
   ?s ?p ?o.
  }
}
}

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

2 participants