This module provides an adapter service that allows to use active Enhancement Chains and Enhancement Engines as Fusepool Transformers.
The root path of the Transformers component is /transformers relative to the Apache Stanbol root. It provides Fusepool Transformer endpoints
- for active engines under
/transformers/engine/{engine-name} - for active chains under
/transformers/chain/{chain-name}
This module uses Apache Maven as build system. You can build it by calling
mvn install
By doing so you will find the JAR file of this module in the target folder. This JAR is an OSGI bundle that can be installed to any Stanbol Environment (e.g. by using the Felix Webconsole or copying the bundle to the Stanbol fileinstall folder.
By using the Maven Sling Plugin the module can be directly installed to a running Stanbol instance by calling
mvn -o clean install -P installBundle \
-Dsling.url=http://localhost:8080/system/console
After installing the module the Stanbol UI will show an additional component called /transformers that provides a simple UI for testing its functionality.
As the Stanbol Transformer implements the Fusepool Transfomer API communication is expected as specified by the Fusepool.
The capabilities of a transformer can be requested by a simple GET request at the base URI. The following listing shows the response for the enhancement chain with the name 'default':
curl http://localhost:8089/transformers/chain/default
<http://localhost:8089/transformers/chain/default>
a <http://vocab.fusepool.info/transformer#Transformer> ;
<http://vocab.fusepool.info/transformer#supportedInputFormat>
"*/*" ;
<http://vocab.fusepool.info/transformer#supportedOutputFormat>
"application/rdf+json" , "application/ld+json" , "text/turtle" ,
"text/rdf+n3" , "application/rdf+xml" , "application/x-turtle" ,
"text/rdf+nt" , "application/json" .
The above RDF specifies that the Transformer accepts any kind of content and will return the enhancements results as RDF.
The kind of RDF returned depends on the Stanbol component called by the request. In the case of Fusepool a typical Enhancement Chain will use the FISE to FAM converter engine to ensure that results will use the Fusepool Annotation Model.
To execute a Stanbol component using the Transformer service one needs to send a POST request with the content to process as payload.
curl -v -X "POST" -H "Content-Type: plain/text;charset=UTF-8" \
-H "Content-Location: http://www.example.org/fusepool/example.txt"
-T "test/resources/example.txt" \
http://localhost:8089/transformers/chain/default
The Stanbol Transformer does support the use of the Content-Location header to specify the URI of the parsed content starting with STANBOL-1404 (revision: 1638109). In case an earlier version is used the URI can be parsed by using the uri query parameter. The Content-Type header is expected to be defined and set to the media type of the parsed content. Some Engines (e.g. the Tika Engine are capable of detecting the content type. In this case application/octet-stream can be set to indicate that the content type of the parsed media is not known.
Apache Stanbol Enhancer Transformer Service does support the registration of Fusepool Transformers for currently active Enhancement Engines and Chains.
For enabling this features the Transformer Service needs to be configured with the #
- Transformer Registry URI (transformer.registry): The URI of the LDP Basic container used by the Fusepool Transformer Registry.
- Stanbol Base URI (stanbol.base.uri): The base URI of the Stanbol instance (e.g.
http://{host}:{port}/stanbol). This URI is required for registering Transformers with the Transformer Factory.
The following figure shows the configuration dialog.
NOTE: configuring a localhost URI as stanbol.base.uri does not make sense for real world use cases. A public accessible URI is needed for accessing Transformers registered with a Transformer Registry. Otherwise Components looking up transformers via the registry will not be able to access it.
