Jim Amsden edited this page Feb 16, 2016 · 2 revisions

ldp-service: An Express.js Middleware Component for W3C Linked Data Platform services

ldp-service is an Express.js middleware component that can be used to provide W3C Linked Data Platform (LDP) services to any Node/Express Web application.

A typical Express Web application would include LDP services using code similar to the following:

// The NODE_ENV environment variable is often not properly set, default to development
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
var env = require('./config/env.js');

// Load, configure and initialize the Express module given its configuration
var express = require('./config/express');
var app = express();

app.listen(env.listenPort, env.listenHost);
module.exports = app;
console.log('oslc-server running on port:'+env.listenPort);

Environment and other configuration information is provided in env.js. This configuration information would usually include the environment in which the application is intended to run (dev, test, production), configuration information for the underlying database, and any other configuration information that might be specific to the application. Configuration information for Express itself is in config/express.js. This contains the setup for other Express middleware components for authentication, logging, body parsing, entity body compression, session management, dynamic document processing, and static document access. The express.js config file includes LDP middleware services just like any other Express middleware:

module.exports = function() {
    var app = express();
    return app;

app.use(ldpService(env)); configures the OSLC services and sets the express routes for any LDPCs that are defined by the configuration information.

Key features:

  • Supports W3C Linked Data Platform 1.0
  • Create, Read, Update and Delete LDP container and resources
  • Implemented as an Express.js middleware component to exploiting dynamic and asynchronous capabilities of JavaScript and Node
  • Provides an architecture for implementing LDP adapters to existing data sources:
  • Implemented using MongoDB to store LDP resources as JSON-LD objects.

The rest of this Wiki contains notes on the implementation of and documentation for the use of the ldp-service.


ldp-service, like all the OSLC4JS projects is Open Source software using the Apache v2 license.

  • OSLC/ldp-service GitHub Project: provides source code management
  • Wiki This Wiki: provides project design and detailed documentation
  • Track & Plan IBM DevOps Services Track & Plan: used for project planning and issue management
  • npm package The Node module is published as an npm package, install with npm install ldp-service

High Level Design



CRUD Resource Operations

Creating Data Source Adapters

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.