Jim Amsden edited this page Feb 21, 2018 · 14 revisions

oslc-service: An Express.js Middleware Component for OSLC services

oslc-service is an Express.js middleware component that can be used to provide OSLC services to any Node/Express Web application. oslc-service provides OSLC services by implementing the OSLC capabilities defined in the OASIS OSLC specifications.

A typical Express Web application would include OSLC 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), the service provider catalog describing the OSLC domains and services the server should be configured with, 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 OSLC middleware services just like any other Express middleware:

module.exports = function() {
    var app = express();
    app.use(oslcService(env));
    return app;
}

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

Key features:

  • Supports OSLC v2 and v3
  • Supports projects that contain root LDPCs for projects and supported OSLC domains (cm, ccm, rm, qm, am)
  • OSLC Discovery (both LDPC Link header based discovery and using OSLC discovery resources)
  • Create, Read, Update and Delete LDPCs and OSLC resources for any domain
  • Resource preview
  • Delegated dialogs for creation and selection of OSLC resources with default dialogs derived from domain vocabularies and shape constraints
  • Query Capability that enables OSLC queries on resources
  • Creation Factory that allows users to POST resources corresponding to a Resource Shape
  • Dynamically configured at startup based on service provider catalog JSON-LD file
    • supported domains with dynamic configuration based on chosen domain vocabularies and shapes
    • default project (create if missing)
    • root LDPCS (create any that are missing on startup)
  • Implemented as an Express.js middleware component to exploiting dynamic and asynchronous capabilities of JavaScript and Node
  • Provides an architecture for implementing OSLC adapters to existing data sources:
    • Utilizes ldp-service for LDP capabilities and persistence of resources as needed

Future features:

  • Actions and Automation
  • Tracked Resource Set

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

Governance

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

  • OSLC/oslc-service GitHub Project: provides source code management
  • Wiki This Wiki: provides project design and detailed documentation
  • Issues: used for project and issue management
  • npm package The Node module is published as an npm package, install with npm install oslc-service

High Level Design

Persistence Strategy

Configuration

Authentication

OSLC and LDP CRUD Resource Operations

OSLC Discovery

Resource Preview

Delegated Dialogs

Attachments

Implementing the Change Management Domain

Using Resource Shapes

Creating Data Source Adapters

OSLC Query

OSLC Creation Factory

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.