Tuesday, October 7, 2014

Gruff v5.5 - Now Available

Build an Ad Hoc Federation from AllegroGraph and SPARQL Endpoints

Gruff allows you to build a temporary federation on the fly as you browse a series of AllegroGraph stores and/or SPARQL endpoints. At any time, the set of triples that you are currently browsing will consist of everything that's in the single AG store that you have open or the single endpoint to which you are connected, plus any triples that Gruff downloaded while you were browsing earlier stores and/or endpoints. You can continue to browse the triples that were downloaded earlier along with triples that you're fetching from the current store or endpoint.

You can set this up when using either File | Open Triple-Store or File | Connect to SPARQL Endpoint. To do so, check the check box that's labeled "Retain the triples that were downloaded from the previous store or endpoint".

The check box for retaining triples will initially be selected if you selected it when opening the previous store or connecting to the previous endpoint. This allows quickly reopening recent stores or endpoints to continue building an ad hoc federation, without reselecting the option every time. For example, you can reselect recently-used stores and endpoints from the File menu whenever you want to resume fetching triples from particular sources. That process is also faster when Global Options | Miscellaneous | Confirm Closing Stores is disabled, by avoiding the dialog that it shows.

When retaining triples, the information from the previous store or endpoint that's displayed in Gruff's various views is not cleared. In the table view, for example, you can then still use View | Go Back to review nodes from the previous store. In particular, in the graph view you can continue building a single visual graph from multiple sources, where a node that exists in two or more of those sources can display links to nodes from different sources.

Similar borrowing of triples from an endpoint can be done by using SERVICE clauses in SPARQL queries in the query view. Though SELECT queries do not return actual triples, Gruff will use the query results to deduce some triples that must exist at the SPARQL endpoints that were accessed, and include those in the ad hoc federation that it is browsing.
Usually Gruff will fetch triples only from the store or endpoint that you are currently browsing, and display only "leftover" triples from earlier sources. One exception to that is when using SERVICE clauses in SPARQL queries. The other exception is that if you click on an object in the righthand column in the table view to display that object's triples, and that table row's triple had been fetched from a SPARQL endpoint, and that endpoint is not the store or endpoint that you are currently browsing, then Gruff will fetch triples from BOTH that triple's endpoint AND from the store or endpoint that you're currently browsing (unless it has already fetched them from those sources, as usual). This is one way to continue browsing an earlier endpoint after switching to browsing another store or endpoint.

In the table view, any row that represents a triple that was fetched from a different store or endpoint than the one that you're currently browsing will show the name of that store or endpoint on the right. It will be shown in square brackets to differentiate it from the name of the triple's graph, which is shown in the same location whenever it's not the default graph.

If triples are fetched from multiple sources where the triples are in the default graphs of those sources and they have the same subject, predicate, and object, then by default Gruff will treat them as distinct triples. In the table view, for example, there will be a separate row for each one, with the source shown on the right except for the one that's from the current store or endpoint. This shows which sources contain each triple. Alternately, Gruff will merge these equivalent triples into a single one if you enable Global Options | Miscellaneous | Merge Retained Triples.

This procedure never creates triples in any stores. It only builds a temporary collection of triples in memory for browsing. If you would like to add triples to an AllegroGraph store from other stores and/or endpoints, a way to do that in Gruff would be to browse the source store or endpoint and use File | Export Displayed Data As | N-Triples or one of the other commands on that same child menu. Then open the destination store and use File | Load Triples | Load N-Triples (or one of its sibling commands) to load the file of saved triples into the AG store.

When browsing multiple AllegroGraph stores, an alternative is to use File | Federate Recent Stores, or to select multiple stores in the same catalog when using File | Open Triple-Store. That will federate ALL of the triples from the multiple stores together, and then you can browse all of them as a single AG store, including doing user queries over the whole federation.


No comments: