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:

Correspondingly, the extension point Loader is specialized as follows:

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: SYSTEM, PROJECT, USER, PROJECT_USER

Graph Store HTTP Loader Configuration (it.uniroma2.art.semanticturkey.extension.impl.loader.sparql.GraphStoreHTTPLoaderConfiguration)
Either " graphStoreHTTPEndpoint" or "sourceGraph" shall be set.The credentials are stored without encryption on the server. Be aware that the system administration could be able to see them.
Graph Store HTTP endpoint (graphStoreHTTPEndpoint)
The address of the endpoint conforming to the HTTP Graph Store protocol. If not provided, it is assumed that the source graph is identified directly
URL
Optional
Source graph (sourceGraph)
The graph where data should be loaded from. If not provided, the default graph is used
IRI
Optional
Username (username)
Username
java.lang.String
Optional
Password (password)
Password
java.lang.String
Optional
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: SYSTEM, PROJECT, USER, PROJECT_USER

HTTP Loader Configuration (it.uniroma2.art.semanticturkey.extension.impl.loader.http.HTTPLoaderConfiguration)
The credentials are stored without encryption on the server. Be aware that the system administration could be able to see them.
Endpoint (endpoint)
The address of the endpoint where data will be loaded from
URL
Required
Query Parameters (queryParameters)
Additional query parameters
Map<java.lang.String, java.lang.String>
Optional
Request Headers (requestHeaders)
Additional request headers
Map<java.lang.String, java.lang.String>
Optional
Enable Content Negotiation (enableContentNegotiation)
Enables content negotiation based on the user-supplied data format
boolean (default: true)
Required
Report Content-Type (reportContentType)
Tells the loader to report the content-type received by the server
boolean (default: true)
Required
Username (username)
Username
java.lang.String
Optional
Password (password)
Password
java.lang.String
Optional
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: SYSTEM, PROJECT, USER, PROJECT_USER

SFTP Loader Configuration (it.uniroma2.art.semanticturkey.extension.impl.loader.sftp.SFTPLoderConfiguration)
The credentials are stored without encryption on the server. Be aware that the system administration could be able to see them.
Host (host)
The source host name/address
URL
Required
Port (port)
The target port
integer (default: 21)
Required
Server key fingerprint (serverKeyFingerprint)
The fingerprint of the target server. The allowed forms are (MD5:)?[\\dA-F][\\dA-F](:[\\dA-F][\\dA-F]){15} and SHA(1|224|256|384|512):[Base64 encoding without trailing =]
java.lang.String
Required
Username (username)
Username
java.lang.String
Required
Password (password)
Password
java.lang.String
Optional
Source name (sourcePath)
The path on the remote host where data will be loaded from
java.lang.String
Required
Timeout (ms) (timeout)
Timeout in milliseconds
long (default: 300000)
Required
Settings n/a