Possible to query revisions?

0 views
Skip to first unread message

Chris Dijkshoorn

unread,
Jan 7, 2016, 4:14:05 AM1/7/16
to Stardog

For a museum we are looking into setting up a triple store containing metadata of the collection and making this available to researchers using a SPARQL endpoint. Stardog looks promising, but we have a requirement about querying data revisions that I am not sure Stardog addresses.

When a researcher runs a query and obtains a result set, someone else who would like to reproduce these results at a later point in time might end up with a different result set, since the underlying dataset has been updated. I read the documentation about Versioning (http://docs.stardog.com/#_versioning) and to put it in that context, if you would query for foaf:Person at revision 5e8c, you will get 2 persons, while firing the same query at revision e5ef, will return 3 persons. I would like a researchers to be able to state they queried the database at revision 5e8c, making the 2 persons reproducible.

Is it possible to query different revisions of the data using Stardog?

Evren Sirin

unread,
Jan 7, 2016, 8:55:15 AM1/7/16
to Stardog
Right now Stardog does not allow querying the state of the database at
a specific version. It allows querying the differences between
versions. There are some detailed examples of that capability in [1]
(see the section [2]). In your use case, if the researchers specify
the version they used to generate the query results and those results
can't be reproduced anymore then you'd be able to query the history to
find what updates to the database changed the query results.

Best,
Evren

[1] https://github.com/Complexible/stardog-examples/tree/master/examples/cli/versioning
[2] https://github.com/Complexible/stardog-examples/tree/master/examples/cli/versioning#version-history
> --
> -- --
> You received this message because you are subscribed to the C&P "Stardog"
> group.
> To post to this group, send email to sta...@clarkparsia.com
> To unsubscribe from this group, send email to
> stardog+u...@clarkparsia.com
> For more options, visit this group at
> http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en

Rubén Navarro Piris

unread,
Feb 16, 2016, 6:13:47 AM2/16/16
to Stardog
Hi!

Is it possible to query (SPARQL query) the versioning history over the java api?
I tried obtaining a VersioningConnection view and then launching the query, but the retrieved data comes from the standard database (not the versioning database).

Here the code:

ConnectionConfiguration config = ConnectionConfiguration

   
.to("stardog")

   
.credentials("admin","admin")

   
.server("snarl://docker.local:5820");

// 'INSERT DATA {GRAPH <urn:g> {<urn:s> <urn:p> <urn:o>}}' executed, code omitted

try(VersioningConnection conn = config.connect().as(VersioningConnection.class)) {

 
TupleQueryResult result = conn.select("SELECT * {?s ?p ?o}").execute();

 
while(result.hasNext()){

   
System.out.println(result.next());

 
}
 
// '<urn:s> <urn:p> <urn:o>' returned, not the versioning data as wished

}

Rubén Navarro Piris

unread,
Feb 16, 2016, 10:07:35 AM2/16/16
to Stardog
Found it:

TupleQueryResult result = conn.getVersioningMetadata().select("SELECT * {?s ?p ?o}").execute();
Reply all
Reply to author
Forward
0 new messages