Linked Data Interactions For Apache NiFi
Apache Nifi is an easy to use, powerful, and reliable system to process and distribute data.
Set up NiFi instance with LDI processors
The processors can be imported into a NiFi docker instance via volume binding:
- Create a
docker-compose.yml
file with the following content in a new directoryservices: nifi: image: apache/nifi:2.0.0 environment: SINGLE_USER_CREDENTIALS_USERNAME: admin SINGLE_USER_CREDENTIALS_PASSWORD: ctsBtRBKHRAx69EqUghvvgEvjnaLjFEB ports: - 8443:8443 volumes: - ./nifi-ext:/opt/nifi/nifi-current/nar_extensions:rw - ./nifi-drivers:/opt/nifi/nifi-current/lib_temp:rw entrypoint: [ "/bin/bash", "-c", "cp -r /opt/nifi/nifi-current/lib_temp/* /opt/nifi/nifi-current/lib/ && exec /opt/nifi/scripts/start.sh" ]
- Create a directory
nifi-ext
in your current directory. - Download either the
...-nar-bundle.jar
and unpack this or download the individual required processors (.nar extension) from the nexus repository. Next, place the required processors in thenifi-ext
directory. - Additionally, for using any processor with a persistence layer, you will need to download the needed drivers. Create a
nifi-drivers
directory and place these drivers inside. Possible drivers are: - Finally, start your instance.
docker compose up
- Log in at
https://localhost:8443/nifi
with the credentials mentioned in step 1 - All downloaded extensions are available under the
be.vlaanderen.informatievlaanderen.ldes.ldi.nifi
group.
All documentation and notes about configuration are available in the NiFi component itself.
Setting up Database Connection Pools
As of LDI 2.13.0, some processors require a database connection pool to be set up. Although this is a pure NiFi configuration, a minimal explanation will be mentioned here.
For more details, please refer to the NiFi documentation on DBCP. This can be done by following these steps:
- Go to the
Controller Services
tab in the NiFi UI. - Click on the
Create new service
button. - Select the
DBCPConnectionPool
service. - Configure the service with the required properties:
Database Connection URL
,jdbc:sqlite:/path/to/database.db
for SQLitejdbc:postgresql://localhost:5432/database
for PostgreSQL,
Database Driver Class Name
org.sqlite.JDBC
for SQLiteorg.postgresql.Driver
for PostgreSQL,
Database User
,Password
,
- Save the service.
- Enable the service.
- Use the service in the processors that require it.