Loader
The Purpose
A Loader provides Semantic Turkey with the ability to ingest data from some source. Different implementations of this extension point allow to support different types of sources.
The Model
A Loader (it.uniroma2.art.semanticturkey.extension.extpts.loader.Target
) is provided with a
Target (it.uniroma2.art.semanticturkey.extension.extpts.loader.Target
) where the data should be loaded to and an optional accepted
DataFormat (it.uniroma2.art.semanticturkey.extension.extpts.loader.Target
).
Target is in fact an abstract class with concrete subclasses corresponding to different types of target:
-
RepositoryTarget (
it.uniroma2.art.semanticturkey.extension.extpts.loader.RepositoryTarget
): encapsulates an RDFHandler, which is used to write RDF data loaded from a triple-capable source -
FormattedResourceTarget (
it.uniroma2.art.semanticturkey.extension.extpts.loader.FormattedResourceTarget)
: encapsulates a ClosableFormattedResource, which is used to write content loaded from a byte-oriented source
Correspondingly, the extension point Loader is specialized as follows:
-
RepositoryTargetingLoader (
it.uniroma2.art.semanticturkey.extension.extpts.loader.RepositoryTargetingLoader
): a loader that writes the loaded content to a RepositoryTarget -
StreamTargetingLoader (
it.uniroma2.art.semanticturkey.extension.extpts.loader.StreamTargetingLoader
): a loader that writes the loaded content to a FormattedResourceTarget
Extension Point Details
The tables below summarizes the details of the Loader extension point.
Name | Loader |
Description | A Loader can ingest data from a source as an alternative to posting the data inside the user request. |
Identifier | it.uniroma2.art.semanticturkey.extension.extpts.loader.Loader |
Configuration | n/a |
Settings | n/a |
Refined by:
Name | Repository-targeting Loader |
Description | A Repository-targeting Loader loads data from a triple-oriented source (e.g. a triple store) into a Repository. An implementation of this extension point may support exporting loading data from a remote triple store using the SPARQL 1.1 Graph Store HTTP Protocol. |
Identifier | it.uniroma2.art.semanticturkey.extension.extpts.loader.RepositoryTargetingLoader |
Configuration | n/a |
Settings | n/a |
and
Name | Stream-targeting Loader |
Description | A Stream-targeting Loader loads data from a byte-oriented source into a file. An implementation of this extension point may support loading data from an SFTP server. |
Identifier | it.uniroma2.art.semanticturkey.extension.extpts.loader.StreamTargetingLoader |
Configuration | n/a |
Settings | n/a |
Interfaces
The following interface defines the contract for the Loader extension point.
/**
* Extension point for loaders. They are placed at the start of an import chain to fetch data from some
* external source.
*/
public interface Loader extends Extension {
/**
* Loads data into the provided target. The default implementation of this operation delegates the
* operation to concrete subclasses matching the given target.
*
* @param source
* @param acceptedFormat
* @throws IOException
*/
default void load(Target target, @Nullable DataFormat acceptedFormat) throws IOException {
// Default implementation omitted
}
}
The following interface defines the contract for the RepositoryTargetingLoader extension point.
/**
* A {@link Loader} which can load data into {@link RepositoryConnection}.
*/
public interface RepositoryTargetingLoader extends Loader {
void load(RepositoryTarget target, @Nullable DataFormat acceptedFormat) throws IOException;
}
The following interface defines the contract for the StreamTargetingLoader extension point.
/**
* A {@link Loader} which can load data into a {@link ClosableFormattedResource}.
*
*/
public interface StreamTargetingLoader extends Loader {
void load(FormattedResourceTarget target, @Nullable DataFormat acceptedFormat) throws IOException;
}
Choosing and Configuring a Loader
Loaders can be created on demand by the system as they are needed to load data from the source they support. Nonetheless, they are usually configurable components, the configurations of which can be stored according to the standard configuration/settings mechanism.
Loader Implementations
Graph Store HTTP Loader
Name | Graph Store HTTP Loader | ||||||||||||||||||||||||
Description | A RepositoryTargetingLoader that loads RDF data from a source complying with the SPARQL 1.1 Graph Store HTTP Protocol | ||||||||||||||||||||||||
Identifier | it.uniroma2.art.semanticturkey.extension.impl.loader.sparql.GraphStoreHTTPLoader | ||||||||||||||||||||||||
Configuration |
Scopes:
|
||||||||||||||||||||||||
Settings | n/a |
HTTP Loader
Name | HTTP Loader | |||||||||||||||||||||||||||||||||||||||
Description | A StreamTargetingLoader that uses the HTTP protocol | |||||||||||||||||||||||||||||||||||||||
Identifier | it.uniroma2.art.semanticturkey.extension.impl.loader.http.HTTPLoader | |||||||||||||||||||||||||||||||||||||||
Configuration |
Scopes:
|
|||||||||||||||||||||||||||||||||||||||
Settings | n/a |
SFTP Loader
Name | SFTP Loader | |||||||||||||||||||||||||||||||||||||||
Description | A StreamTargetingLoader that uses the SFTP protocol | |||||||||||||||||||||||||||||||||||||||
Identifier | it.uniroma2.art.semanticturkey.extension.impl.loader.sftp.SFTPLoader | |||||||||||||||||||||||||||||||||||||||
Configuration |
Scopes:
|
|||||||||||||||||||||||||||||||||||||||
Settings | n/a |