LinkedDataSail is an implementation of the OpenRDF Sail API which provides a dynamic, uniform view of the Web of Data. Like the Semantic Web Client Library and Tabulator's AJAR library, LinkedDataSail gathers RDF data incrementally, dereferencing URIs in response to queries.
To use LinkedDataSail in your Java application, you can use the standalone Ripple JAR (which includes LinkedDataSail) or build Ripple from source (see Running Ripple) and grab the LinkedDataSail JAR, or you can import LinkedDataSail using Maven:
<dependencies> ... <dependency> <groupId>net.fortytwo</groupId> <artifactId>linked-data-sail</artifactId> <version>1.0</version> </dependency> ... </dependencies>
LinkedDataSail is always stacked on top of another, "base" Sail, which provides the storage layer for the aggregated RDF data. The base Sail can be any Sail implementation, such as MemoryStore or NativeStore. The simplest way to instantiate LinkedDataSail is to pass the base Sail to its constructor:
LinkedDataSail sail = new LinkedDataSail(baseSail); sail.initialize();
You can also customize the Sail with specialized URI mappings, URI dereferencers, or RDFizers. For example:
// Map the URI space of an ontology to a local resource URIMap map = new UriMap(); map.put("http://www.holygoat.co.uk/owl/redwood/0.1/tags/Tagging", MyClass.class.getResource("tags.owl").toString()); // Add a custom URI dereferencer and RDFizer LinkedDataCache cache = LinkedDataCache.createDefault(baseSail, map); cache.addDereferencer("jar", new JarURIDereferencer()); cache.addRdfizer(MediaType.IMAGE_JPEG, new ImageRdfizer(), 0.4); // Instantiate and initialize the Sail LinkedDataSail sail = new LinkedDataSail(baseSail, cache); sail.initialize();
LinkedDataSail is the Linked Data client of the Ripple scripting language, enabling "one liner" path-based queries over Linked Data which are, themselves, linkable RDF data. LinkedDataSail has been generalized to support other crawlers and query services, as well, such as SPARQL endpoints and Sesame-based tools of all kinds. Gremlin is a related graph programming language which has been adapted to use LinkedDataSail.
Last edited by Joshua Shinavier,