RDF Transformer
The Purpose
Semantic Turkey features sophisticated capabilities for loading and exporting data. RDFLifters and ReformatterExporters make Semantic Turkey compatible with diverse input/output formats. In some cases, however, RDF triples loaded from a source may not be included in the working graph as they are. Similarly, the content of the working graph does not meet all the desiderata for the export. The problem is no longer a syntactic mismatch between the RDF data model and another, foreign, data model. Actually, there is a need to manipulate RDF data, deleting triples or creating new ones, in order to meet certain modeling patterns or information needs. Semantic Turkey abstracts diverse transformations of RDF data with the extension point RDFTransformer.
The Model
An RDFTransformer (it.uniroma2.art.semanticturkey.extension.extpts.rdftransformer.RDFTransformer
) operates a (possibly destructive) transformation on a working copy of a source repository. Each transformer is provided with a list of named graphs to operate against. An empty list in this case means "no graph", while in RDF4J it usually means "every graph". Indeed, a transformer expects that the list of graphs has already been expanded by the caller (e.g. the service Export
).
Extension Point Details
The tables below summarizes the details of the Loader extension point.
Name |
RDF Transformer |
Description |
An RDFTransformer operates a (possibly destructive) on a working copy of a source repository . |
Identifier |
it.uniroma2.art.semanticturkey.extension.extpts.rdftransformer.RDFTransformer |
Configuration |
Scopes:
SYSTEM ,
PROJECT ,
USER ,
PROJECT_USER
RDF Transformer Chain (it.uniroma2.art.semanticturkey.extension.extpts.rdftransformer.RDFTransformerChainConfiguration )
|
Empty |
|
Settings |
n/a |
Interfaces
The following interface defines the contract for the RDFTransformer extension point.
/**
* Extension point for the export filters. Different export filters are subsequently invoked on a <i>working
* copy</i> (in memory, without inference) of the <i>repository to be exported</i>.
*/
public interface RDFTransformer extends Extension {
/**
* Apply a (possibly destructive) transformation on a <i>working copy</i> of the <i>source repository<i>.
*
* @param sourceRepositoryConnection
* a connection to the source (unmodified) repository
* @param workingRepositoryConnection
* a connection to the working of repository
* @param graphs
* graphs to filter. An empty array indicates that every graph (the name of which is an IRI) in
* the <code>workingRepository</code> is filtered
* @throws RDF4JException
*/
void transform(RepositoryConnection sourceRepositoryConnection,
RepositoryConnection workingRepositoryConnection, IRI[] graphs) throws RDF4JException;
}
Choosing and Configuring an RDFTransformer
RDFTransformers can be created on demand by the system as they are needed to apply the transformation they implement. Nonetheless, they are usually configurable components, the configurations of which can be stored according to the standard configuration/settings mechanism.
RDF Transformer Implementations
Delete Property Value RDF Transformer
Name |
Delete Property Value RDF Transformer |
Description |
An RDF transformer that can be configured to delete a property value |
Identifier |
it.uniroma2.art.semanticturkey.extension.impl.rdftransformer.deleteproperty.DeletePropertyValueRDFTransformer |
Configuration |
Scopes:
SYSTEM ,
PROJECT ,
USER ,
PROJECT_USER
Delete Property Value RDF Transformer (it.uniroma2.art.semanticturkey.extension.impl.rdftransformer.deleteproperty.DeletePropertyValueRDFTransformerConfiguration )
|
resource (resource ) |
The subject of the filtered out triple |
Resource
|
Required |
|
property (property ) |
The predicate of the filtered out triple |
IRI (with role: property )
|
Required |
|
value (value ) |
The value of the triple being filtered out. If not set, then all triples of the form <resource, predicate, *> are deleted |
RDFValue
|
Optional |
|
|
Settings |
n/a |
Property Normalizer Transformer
Name |
Property Normalizer Transformer |
Description |
An RDF transformer that normalizes a set of properties replacing their occurrences as predicate in triples with a provided property |
Identifier |
it.uniroma2.art.semanticturkey.extension.impl.rdftransformer.propertynormalizer.PropertyNormalizerTransformer |
Configuration |
Scopes:
SYSTEM ,
PROJECT ,
USER ,
PROJECT_USER
Property Normalizer Transformer (it.uniroma2.art.semanticturkey.extension.impl.rdftransformer.propertynormalizer.PropertyNormalizerTransformerConfiguration )
|
normalizingProperty (normalizingProperty ) |
Replacement property |
IRI (with role: property )
|
Required |
|
propertiesBeingNormalized (propertiesBeingNormalized ) |
Properties that are replaced in the output |
Set<@HasRole("property")IRI> (i.e. a set of properties)
|
Optional |
|
|
Settings |
n/a |
Scheme Exporter Transformer
Name |
Scheme Exporter Transformer |
Description |
An RDF transformer that can be configured to export a given scheme |
Identifier |
it.uniroma2.art.semanticturkey.extension.impl.rdftransformer.schemeexporter.SchemeExporterTransformer |
Configuration |
Scopes:
SYSTEM ,
PROJECT ,
USER ,
PROJECT_USER
Scheme Exporter Transformer (it.uniroma2.art.semanticturkey.extension.impl.rdftransformer.schemeexporter.SchemeExporterTransformerConfiguration )
|
scheme (scheme ) |
The scheme to export |
IRI (with role: conceptScheme )
|
Required |
|
|
Settings |
n/a |
SPARQL RDF Transformer
Name |
SPARQL RDF Transformer |
Description |
An RDF transformer that can be configured through a SPARQL Update |
Identifier |
it.uniroma2.art.semanticturkey.extension.impl.rdftransformer.sparql.SPARQLRDFTransformer |
Configuration |
Scopes:
SYSTEM ,
PROJECT ,
USER ,
PROJECT_USER
SPARQL Update RDF Transformer (it.uniroma2.art.semanticturkey.extension.impl.rdftransformer.sparql.SPARQLRDFTransformerConfiguration )
|
filter (filter ) |
SPARQL Update implementing the filter |
java.lang.String
|
Required |
|
sliced (sliced ) |
Executes the SPARQL query on each graph separately |
boolean (default: true ) |
Optional |
|
|
Settings |
n/a |
Update Property Value RDF Transformer
Name |
SPARQL RDF Transformer |
Description |
An RDF transformer that can be configured to update a property value |
Identifier |
it.uniroma2.art.semanticturkey.extension.impl.rdftransformer.updateproperty.UpdatePropertyValueRDFTransformer |
Configuration |
Scopes:
SYSTEM ,
PROJECT ,
USER ,
PROJECT_USER
Update Property Value RDF Transformer (it.uniroma2.art.semanticturkey.extension.impl.rdftransformer.updateproperty.UpdatePropertyValueRDFTransformerConfiguration )
|
resource (resource ) |
The subject of the filtered triple |
Resource
|
Required |
|
property (property ) |
The predicate of the filtered triple |
IRI (with role: property ) |
Required |
|
value (value ) |
The new value to be set |
RDFValue |
Required |
|
oldValue (oldValue ) |
if set, the triple <resource, property, oldValue> is replaced by <resource, property, value>. If not set, then all <resource, property, *> are deleted and <resource, property, value> is written |
RDFValue |
Optional |
|
|
Settings |
n/a |
XLabel Dereification RDF Transformer
Name |
XLabel Dereification RDF Transformer |
Description |
An RDF transformer that performs XLabel dereification |
Identifier |
it.uniroma2.art.semanticturkey.extension.impl.rdftransformer.xlabeldereification.XLabelDereificationRDFTransformer |
Configuration |
Scopes:
SYSTEM ,
PROJECT ,
USER ,
PROJECT_USER
XLabel Dereification RDF Transformer (it.uniroma2.art.semanticturkey.extension.impl.rdftransformer.xlabeldereification.XLabelDereificationRDFTransformerConfiguration )
|
preserveReifiedLabels (preserveReifiedLabels ) |
Preserves reified labels in the output |
boolean (with default: true )
|
Optional |
|
|
Settings |
n/a |
XNote Dereification RDF Transformer
Name |
XNote Dereification RDF Transformer |
Description |
An RDF transformer that performs XNote dereification |
Identifier |
it.uniroma2.art.semanticturkey.extension.impl.rdftransformer.xnotedereification.XNoteDereificationRDFTransformer |
Configuration |
Scopes:
SYSTEM ,
PROJECT ,
USER ,
PROJECT_USER
XNote Dereification RDF Transformer (it.uniroma2.art.semanticturkey.extension.impl.rdftransformer.xnotedereification.XNoteDereificationRDFTransformerConfiguration )
|
preserveReifiedNotes (preserveReifiedNotes ) |
Preserves reified notes in the output |
boolean (with default: true )
|
Optional |
|
|
Settings |
n/a |