Home

Awesome

Trifid

<img src="https://cdn.rawgit.com/zazuko/trifid/master/logo.svg" width="140px" height="140px" align="right" alt="Trifid-ld Logo"/>

What is Trifid?

It's a Web server specialized in Linked Data.

The main functionalities of Trifid are:

Dereference Linked data entities

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.

Using a SPARQL endpoint

If a SPARQL endpoint is the source of the RDF data, some additional plugins are enabled by default.

Further use

This server can also be extended with plugins, depending on the use case of the deployment.

Examples

Who Uses Trifid?

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.

Installations

Example resources using Trifid:

Trifid objectives

The main trifid package provides some default plugins:

Documentation

Trifid Core

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.

Installation

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

Usage

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

Parameters

The following parameters are available:

Configuration

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.

Examples

Big Bang Theory dataset

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.

SPARQL configuration

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.

SPARQL endpoint with self-signed certificate

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

Production Best Practices

Note that it is not recommended to run Node applications on well-known ports (< 1024). You should use a reverse proxy instead.

Using with Docker

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

Trifid environment variables

You can use the following environment variables:

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:

Reverse Proxy

If you run Trifid behind a reverse proxy, the proxy must set the X-Forwarded-Host header field.

Debugging

The log level can be configured by using the server.logLevel property. Supported log levels are: fatal, error, warn, info, debug, trace and silent.

Monorepo

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:

PackageLatest version
trifidBundle with commonly used plugins
trifid-coreCore package
@zazuko/trifid-entity-rendererEntity renderer
trifid-plugin-graph-explorerGraph Explorer plugin
@zazuko/trifid-plugin-ckanCKAN harvester endpoint
trifid-handler-fetchFetch handler for Trifid
trifid-plugin-i18ni18n support for Trifid
@zazuko/trifid-markdown-contentCreate pages from Markdown files
@zazuko/trifid-plugin-sparql-proxyTrifid plugin for SPARQL proxy
trifid-plugin-spexSPEX plugin for Trifid
trifid-plugin-yasguiYASGUI plugin for Trifid

More to come as we gradually consolidate other, initially separate repositories.

Support

Issues & feature requests should be reported on GitHub.

Pull requests are very welcome.

License

Copyright Zazuko GmbH.

Trifid is licensed under the Apache License, Version 2.0.