It's a Web server specialized in Linked Data.
The main functionalities of Trifid are:
Providing different serializations using content-negotiation of entities in a file or queried using a SPARQL endpoint. The serializations include HTML rendering based on customizable templates.
If a SPARQL endpoint is the source of the RDF data, some additional plugins are enabled by default.
- SPARQL Proxy: Public access to the configured store.
- YASGUI: UI to write, execute, and analyze SPARQL queries.
- Graph Explorer: UI to explore the data in a graph view
- SPEX: Introspects the data on the endpoint and shows the data model
This server can also be extended with plugins, depending on the use case of the deployment.
Trifid is open source and meant to work out of the box for data publishers. Most users will use only the main features. We, or people that dive deeper into the code, maintain and develop instances with additional plugins.
Example resources using Trifid:
- Default view: http://lod.opentransportdata.swiss/didok/8500011
- Customized for one gov entity in Switzerland: https://ld.geo.admin.ch/boundaries/municipality/296
The main trifid package provides some default plugins:
- Handlers to read RDF data from the file system and SPARQL endpoints
- The handlebars template engine
- A HTML renderer for the RDF data
- The plugins mentioned here
- See the configuration wiki page for more details on the configuration system.
- See the customize-the-templates wiki page for more details on the template system.
Trifid Core contains the HTTP server component and a configuration system to load plugins. Usually, it's not required to use the Trifid Core package. The main trifid package provides an opinionated setup that works for most use cases.
Trifid is a Node.js-based application. To install and run it, you will need to install Node.js on your system.
Install the npm package:
npm install -g trifid
To start the server, execute the following command:
npx trifid
If you want to run Trifid using a SPARQL endpoint and default settings, you can run it even without a config file:
trifid --sparql-endpoint-url=http://localhost:3030/sparql
The following parameters are available:
-c
or--config
: Expects a path to a config as value, which will be used by Trifid-p
or--port
: Expects a port number as value, which will be used by the HTTP listener of Trifid--sparql-endpoint-url
: Expects a SPARQL HTTP query interface URL value, which will be used by the Trifid SPARQL handler--dataset-base-url
: Expects a Base URL value, which will be used to translate the request URLs
Trifid uses YAML or JSON configuration files.
One configuration file can use another file as base.
The extends
property must point to the other file.
Values of the base file will be overwritten.
If you use instances/tbbt/config.yaml
as a base configuration, you will get a server that serves the Big Bang Theory dataset.
It will load the triples from the following remote file: https://raw.githubusercontent.com/zazuko/tbbt-ld/master/dist/tbbt.nt.
You will then be able to access its content, e.g. Amy Farrah Fowler.
This is a good starting point to understand how dereferencing works.
For production systems, we recommend data access via the SPARQL 1.1 Protocol interface.
instances/docker-sparql/config.yaml
can be used as base configuration.
Sometimes SPARQL endpoints are running on TLS/SSL but provide an incomplete configuration or a self-signed certificate.
In that case, one can disable strict certificate checking by setting the environment variable NODE_TLS_REJECT_UNAUTHORIZED
.
For example:
export NODE_TLS_REJECT_UNAUTHORIZED=0
Note that it is not recommended to run Node applications on well-known ports (< 1024). You should use a reverse proxy instead.
Trifid can be installed using Docker. With this method, you only need to have Docker installed. See https://docs.docker.com/installation/ for installation instructions for your platform.
docker run --rm -it -p 8080:8080 ghcr.io/zazuko/trifid
You can use the following environment variables:
TRIFID_CONFIG
: the configuration file to use (default value:instances/docker-sparql/config.yaml
, which enable the following environment variables)SPARQL_ENDPOINT_URL
: the SPARQL endpoint URL to useDATASET_BASE_URL
: the base URL to use to enable rewritingSPARQL_ENDPOINT_USERNAME
: the user to use to authenticate against the SPARQL endpointSPARQL_ENDPOINT_PASSWORD
: the password to use to authenticate against the SPARQL endpoint
If you want to use a file that contains your triples instead of a SPARQL endpoint, you can set TRIFID_CONFIG
to instances/docker-fetch/config.yaml
, and you will be able to use the following environment variables to configure your instance:
FETCH_HANDLER_FILE
: the file to use to fetch the data (default value:https://raw.githubusercontent.com/zazuko/tbbt-ld/master/dist/tbbt.nt
)FETCH_HANDLER_FILE_TYPE
: the type of the file to use to fetch the data (default value:application/n-triples
)DATASET_BASE_URL
: the base URL to use to enable rewriting
If you run Trifid behind a reverse proxy, the proxy must set the X-Forwarded-Host
header field.
The log level can be configured by using the server.logLevel
property.
Supported log levels are: fatal
, error
, warn
, info
, debug
, trace
and silent
.
To improve the maintenability of the whole project, we decided to use a monorepo architecture.
Here is the list of all packages that are maintained here:
Package | Latest version | |
---|---|---|
trifid |
Bundle with commonly used plugins | |
trifid-core |
Core package | |
@zazuko/trifid-entity-renderer |
Entity renderer | |
trifid-plugin-graph-explorer |
Graph Explorer plugin | |
@zazuko/trifid-plugin-ckan |
CKAN harvester endpoint | |
trifid-handler-fetch |
Fetch handler for Trifid | |
trifid-plugin-i18n |
i18n support for Trifid | |
@zazuko/trifid-markdown-content |
Create pages from Markdown files | |
@zazuko/trifid-plugin-sparql-proxy |
Trifid plugin for SPARQL proxy | |
trifid-plugin-spex |
SPEX plugin for Trifid | |
trifid-plugin-yasgui |
YASGUI plugin for Trifid |
Issues & feature requests should be reported on GitHub.
Pull requests are very welcome.
Copyright Zazuko GmbH.
Trifid is licensed under the Apache License, Version 2.0.