List of all basic services
This page lists all basic services that have been developed during the course of the FREME project.
- Proxy Filter
- Rate Limiter
- Pipelines
- Test Helper
- Package Maker
- CORS Filter
- Postprocessing Filter
- Internalization Filter
- Logging Filter
- Internationalization
- NIF Converter
- SPARQL Converters
- Users Controller
- XSLT Converter
- Tika Filter
Proxy filter
The proxy filter receives HTTP requests and proxies these requests to a remote location. It copies the request, including headers, query string parameters and request body. It performs marginal changes in the request, e.g. it exchanges the "HOST" header. It proxies GET, POST, PUT, DELETE and OPTIONS requests. Multiple proxies can be configured using this filter.
Quick overview
Maven artifact | eu.freme-project.bservices.filter.proxy-filter |
Spring configuration file | spring-configurations/proxy-filter.xml |
Source code location | proxy-filter source code |
Packages that contain this service | broker-dev, freme-full |
Configuration options
The proxy filter is configured using application properties, e.g. in the configuration file application.properties. The configuration has this form:
proxy.proxy-id.servlet_url: /e-entity/freme-ner/documents proxy.proxy-id.target_url: http://example.org/freme-ner
Each proxy configuration consists of two lines. The first line configures the API endpoint on the proxy server that the server listens on. The second line configures the destination URL to which requests are being proxied. Each configuration option consists of three segments: proxy, proxy-id and servlet_url / target_url. The first segment is always the same for the proxy configurations. The second segment denotes the ID of this proxy. When configuring multiple proxies then different proxies can be distinguished by their ID.
Example configuration
This example configuration configures FREME to proxy all requests to /e-entity/freme-ner/documents to a remote FREME NER location.
proxy.freme-ner-documents.servlet_url: /e-entity/freme-ner/documents proxy.freme-ner-documents.target_url: http://rv2622.1blu.de:7001/e-entity/freme-ner/documents
Rate-Limiting Filter
This Filter Limits the number and size of requests an API user can make.
Quick overview
Maven artifact | eu.freme-project.bservices.filter.ratelimiter |
Spring configuration file | spring-configurations/rate-limiter.xml |
Source code location | rate-limiter source code |
Packages that contain this service | broker-dev, freme-full |
Configuration options
The Rate Limiting Filter is configured using both application.properties
and a seperate ratelimiter.yaml
file
application.properties
ratelimiter.enabled=true ratelimiter.yaml=ratelimiter.yaml ratelimiter.clear.timer=3600000
ratelimiter.enabled
decides whether rate-limiting is enabled. ratelimiter.yaml
should contain path to the ratelimiter.yaml
in YAML Syntax which contains specific rate limits as shown in the example below.
Example configuration
ratelimiter.yaml
time-frame: 600 # time period in seconds
rate-limits:
ROLE_ANONYMOUS:
default:
- 50
- 10000 # anomyous user has 50 requests or 1000 kb in the time period
/e-entity/freme-ner/datasets:
- 10
- 1000000 # override for anonymous user to allow 50 requests or 1 000 000 characters in the time period
ROLE_USER:
default:
- 100
- 100000 # anomyous user has 50 requests or 1000 kb in the time period
/e-entity/freme-ner/datasets:
- 50
- 2000000 # override for authenticated users to allow 50 requests or 2 000 000 characters in the time period
ROLE_ADMIN:
default:
- 0
- 0 # admin user has no rate limits configured
henry:
/e-translation/tilde:
- 50
- 100000 # user henry has a special override on tilde
Every request will attempt to match one of these properties in the following order:
-
ratelimits.<username-or-ip>.<requested-endpoint>
-
ratelimits.<username-or-ip>.default
-
ratelimits.<role-of-caller>.<requested-endpoint>
-
ratelimits.<role-of-caller>.default
- Throw internal server error
"No identifier found for "+<username-or-ip>+" with role "+ <role-of-caller>+ " for resource " + <requested-endpoint>
To ensure safe behaviour, the usernames ROLE_ANONYMOUS
, ROLE_USER
, and ROLE_ADMIN
are not permitted anymore in the UserController.
This means that the user with the username henry
can make 50 requests or requests totalling less than 100 000 characters in 600 seconds to /e-translation/tilde
service. Since henry
is an authenticated user (and thus has the ROLE_USER
), he can also make 50 requests totalling less than 2 000 000 characters to /e-entity/freme-ner/datasets
.
An anonymous user (who will be mapped to his IP-Address) can only make 10 requests to /e-entity/freme-ner/datasets
totalling 1 000 000 characters in 600 seconds because he has the ROLE_ANONYMOUS
.
An admin user can make unlimited requests to any e-service, which can be seen that his number of requests and also his size are set to 0.
Pipelines
This service allows for chaining multiple endpoints together. In-depth information can be found in our API Documentation and an example tutorial can be found here.
Quick overview
Maven artifact | eu.freme-project.bservices.controllers.pipelines |
Spring configuration file | spring-configurations/pipelines.xml |
Source code location | pipelines source code |
Packages that contain this service | broker-dev, freme-full |
Internationalisation filter
This filter extends FREME services with additional data formats. An in-depth article on the conveniences of this service can be found here.
Quick overview
Maven artifact | eu.freme-project.bservices.filter.internationalization-filter |
Spring configuration file | spring-configurations/internationalization-filter.xml |
Source code location | internationalisation-filter source code |
Packages that contain this service | broker-dev, freme-full |
Logging-Filter
This filter is responsible for logging requests and responses internally.
Quick overview
Maven artifact | eu.freme-project.bservices.filter.logging |
Spring configuration file | spring-configurations/logging.xml |
Source code location | logging-filter source code |
Packages that contain this service | broker-dev, freme-full |
Configuration options
The logging-filter can be configured using the application.properties
file.
loggingfilter.maxsize
determines the maximum length of requests/responses to be logged. Any requests longer will be truncated.
loggingfilter.whitelist
should be an array of content-types/informats that should be logged. They are to be seperated by a comma. If this parameter is not provided it defaults to null, which in turn will get the list of allowed content-types and informats from the internal list of RDF Serialization Formats.
Example configuration
This example configuration truncates all requests and responses longer than 1800 character and logs only requests in the turtle format
loggingfilter.maxsize=1800 loggingfilter.whitelist=turtle,text/turtle,application/x-turtle
Test Helper
The Test Helper basic service assists user in setting up unit tests and integration tests. So it is usually not part of a FREME package but rather a dependency of basic services and e-Services. The articles Creating a basic service and How to write an e-Service provide examples on how to use the test-helper.
Quick overview
Maven artifact | eu.freme-project.bservices.test-helper |
Spring configuration file | spring-configurations/test-helper.xml |
Source code location | test-helper source code |
Packages that contain this service | Test Helper is not part of any package. |
Configuration options
The test helper does not use any configuration options.
Package Maker
The package-maker service provide some tools like server start and stop scripts for FREME. It should be part of any FREME package.
Quick overview
Maven artifact | eu.freme-project.bservices.package-maker |
Spring configuration file | The package-maker basic service does not contain a spring-configuration file. |
Source code location | package-maker source code |
Packages that contain this service | broker-dev, freme-full |
Configuration options
Package maker does not use any configuration options.
CORS Filter
The CORS filter adds the necessary headers for Cross Origin Resource Sharing to all responses of API requests. In the current implementation it sends these headers:
Access-Control-Allow-Origin: * Access-Control-Allow-Methods: POST, GET, OPTIONS, DELETE Access-Control-Max-Age: 3600 Access-Control-Allow-Headers: x-requested-with, content-type
In a future version we plan to allow configuration of these values so one can specify a list of hosts for the header Access-Control-Allow-Origin in the FREME configuration file.
Quick overview
Maven artifact | eu.freme-project.bservices.filters.cors-filter |
Spring configuration file | spring-configurations/cors-filter.xml |
Source code location | CORS filter source code |
Packages that contain this service | broker-dev, freme-full |
Configuration options
CORS filter does not use any configuration options.
Postprocessing Filter
Linked Data is often considered complicated. Application developers often have no experience with Linked Data formats. Further in some programming languages, e.g. Javascript which is important for websites, do not support Linked Data. For these use cases the postprocessing filters have been developed. This technology converts Linked Open Data to tabular formats like Comma Separated Values. An expert with knowledge about Linked Data technologies can create the filter and the application developer can use it. In this way it is possible to use the Linked Data based workflows of FREME without getting touch with Linked Data. See Simplify output of FREME using SPARQL filters for more information about this feature.
Quick overview
Maven artifact | eu.freme-project.bservices.filters.postprocessing |
Spring configuration file | spring-configurations/postprocessing.xml |
Source code location | Postprocessing filter source code |
Packages that contain this service | broker-dev, freme-full |
Configuration options
The Postprocessing Filter does not use any configuration options.
Internationalization Filter
The Internalisation Filter enables processing of different input formats like XML, HTML, XLIFF or ODT for several FREME e-services and roundtripping functionality for XML and HTML. See the e-Internationalisation article for more information about this feature.
Quick overview
Maven artifact | eu.freme-project.bservices.filters.internationalization-filter |
Spring configuration file | spring-configurations/internalization-filter.xml |
Source code location | internalization-filter source code |
Packages that contain this service | broker-dev, freme-full, freme-ner-dev |
Configuration options
The Internalisation Filter can be disabled for certain endpoints by adding them to a blacklist.
The parameter accepts a comma separated list of regular expressions which will be matched with the endpoint subpath.
The following configuration disables the filter for all `/e-entity/freme-ner/documents` endpoints:
freme.einternationalization.endpoint-blacklist = /e-entity/freme-ner/documents.*
Logging Filter
The Logging Filter simplifies logging output. It truncates long requests, for instance.
Quick overview
Maven artifact | eu.freme-project.bservices.filters.logging |
Spring configuration file | spring-configurations/logging.xml |
Source code location | logging source code |
Packages that contain this service | broker-dev, freme-full |
Configuration options
The Logging Filter does not use any configuration options.
e-Internalisation
e-Internalisation implements XML, HTML, ODT and XLIFF to NIF conversion. It is used by Internalisation Filter and NIF Converter. See the e-Internationalisation article for further information.
Quick overview
Maven artifact | eu.freme-project.bservices.package-maker |
Spring configuration file | spring-configurations/internalization.xml |
Source code location | internalization source code |
Packages that contain this service | Internalisation is not used directly in a package, but it is included by Internalisation Filter and NIF Converter. |
Configuration options
e-Internalisation does not use any configuration options.
NIF Converter
The NIF Converter enables an api endpoint
/toolbox/nif-converter
which let you convert documents in several formats like PLAIN TEXT, XML, HTML, ODT or XLIFF into NIF. It uses e-Internalisation.
Quick overview
Maven artifact | eu.freme-project.bservices.controllers.nif-converter |
Spring configuration file | spring-configurations/nif-converter.xml |
Source code location | nif-converter source code |
Packages that contain this service | broker-dev, freme-full |
Configuration options
The NIF Converter does not use any configuration options.
SPARQL Converters
SPARQL Converters enables endpoints to manage postprocessing sparql converter at
/toolbox/convert/manage
and the sparql conversion endpoint
/toolbox/convert
This endpoint is used by the Postprocessing Filter. See the article Simplify FREME output using SPARQL filters for more information about this feature.
Quick overview
Maven artifact | eu.freme-project.bservices.controllers.sparql-converters |
Spring configuration file | spring-configurations/sparql-converters.xml |
Source code location | sparql-converters source code |
Packages that contain this service | broker-dev, freme-full |
Configuration options
SPARQL Converters does not use any configuration options.
Users Controller
The Users Controller enables simple user management via the endpoints located at
/user
This is necessary if you use any Restricted Resource in your package. See the Authentication article for further information.
Quick overview
Maven artifact | eu.freme-project.bservices.controllers.users |
Spring configuration file | spring-configurations/users.xml |
Source code location | users source code |
Packages that contain this service | broker-dev, freme-full |
Configuration options
The Users Controller does not use any configuration options.
XSLT Converter
The XSLT Converter enables endpoints to manage xslt-converter at
/toolbox/xslt-converter/manage
and the XSLT conversion endpoint
/toolbox/xslt-converter/documents/{converterName}
See the article XSLT Conversion for more information about this feature.
Quick overview
Maven artifact | eu.freme-project.bservices.controllers.xslt-converter |
Spring configuration file | spring-configurations/xslt-converter.xml |
Source code location | xslt-converter source code |
Packages that contain this service | broker-dev |
Configuration options
The XSLT Converter does not use any configuration options.
Tika filter
The Tika Filter makes it possible to upload files of many more formats than those e-internationalization can handle.
Quick overview
Maven artifact | eu.freme-project.bservices.filters.tika-filter |
Spring configuration file | spring-configurations/tika-filter.xml |
Source code location | Tika-filter source code |
Packages that contain this service | broker-dev, freme-full |
Configuration options
When you want to upload a file of any format supported by TIKA, you have to specify the following two additional parameters in your request:
- filename=THE_NAME_OF_YOUR_FILE
- informat=TIKAFile