Resolvers
Mulgara is capable of querying any type of data source by using Resolvers. Resolvers accept and process queries against data contained in a file, a database or some other data source. In most cases, the data being queried against is not in a meaningful format (that is, it is not RDF) so the resolver must convert the data first. Whether this is done by parsing the contents of a file, or converting rows of a database, it is left up to the inner workings of the resolver.
The resolver architecture is a query layer that sits between the Mulgara transport and storage layers. All resolvers are pluggable. That is, you can write new resolvers that cater for new protocols or file types, or provide a bridge to a particular store in the storage layer.
The resolver architecture consists of three layers, which are the:
- Resolver API
- Resolver SPI (service provider interface)
- Content SPI
The Resolver SPI and Content SPI are of interest to developers who want to incorporate new stores or file types into the query layer, or to modify existing ones. The Resolver API is of interest to developers who want to interface with the query layer.
Queries passed to a Resolver API contain:
- A list of variables to find
- The data store URI to query from
- A set of constraints to limit the number and content of triples returned
The Resolver API first checks if the data store is a Mulgara model. If it is, the query is resolved against the internal resolver set, otherwise it is resolved against the external resolver set, based on the data store's protocol (extracted from its URI). Once the constraints are resolved, they are collapsed until only the tuples containing the required variables remain. The results are passed back to the API to be passed across the transport layer.
Mulgara provides resolvers for querying different types of data stores, including:
- Local and remote TKS data stores
file:
andHTTP:
protocol files- JRDF files
- MP3 files
- RDF/XML files
- MBox files
See the MP3 Resolver Tutorial section for information on how to develop your own resolvers.