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.ymlfile 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-extin your current directory. - Download either the
...-nar-bundle.jarand unpack this or download the individual required processors (.nar extension) from the nexus repository. Next, place the required processors in thenifi-extdirectory. - Additionally, for using any processor with a persistence layer, you will need to download the needed drivers. Create a
nifi-driversdirectory and place these drivers inside. Possible drivers are: - Finally, start your instance.
docker compose up - Log in at
https://localhost:8443/nifiwith the credentials mentioned in step 1 - All downloaded extensions are available under the
be.vlaanderen.informatievlaanderen.ldes.ldi.nifigroup.
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 Servicestab in the NiFi UI. - Click on the
Create new servicebutton. - Select the
DBCPConnectionPoolservice. - Configure the service with the required properties:
Database Connection URL,jdbc:sqlite:/path/to/database.dbfor SQLitejdbc:postgresql://localhost:5432/databasefor PostgreSQL,
Database Driver Class Nameorg.sqlite.JDBCfor SQLiteorg.postgresql.Driverfor PostgreSQL,
Database User,Password,
- Save the service.
- Enable the service.
- Use the service in the processors that require it.