This section provides a complete reference regarding the configuration possibilities of modules, components and configurations. How these configuration possibilities are interpreted by Components.js can be found here.

Semantic Configuration

Components.js uses semantic configuration files. This means that these files encode their actual meaning by using standard vocabularies in order to make these files machine-readable.

Configuration files must be defined in an RDF, this has the following advantages:

  1. Components and instances are uniquely identifiable (via URIs). This makes it possible to for example split up configurations into multiple files, and refer to the same components and instances using their unique URI.
  2. Configuration files are self-descriptive, and not necessarily tied to Components.js. For example, RDF-consuming applications can be used to discover the structure of your application and possibly even visualize it, just using your config file.
  3. Alternative implementations of a dependency injection framework for these config files can be created as they are based on external vocabularies, possibly even in other programming languages.

Different kinds of RDF serializations exist and are supported by Components.js, such as JSON-LD, Turtle, TriG, N-Triples or N-Quads. We recommend using JSON-LD, because it is based on JSON and is easily interactable with JavaScript.

Components.js can understand a certain set of predicates and types in configuration files. These are used to encode the actual meaning of the contents of these files. Predicates define the relationship type between two things, and types define the type of a thing. For example, a certain predicate can be used to say that a given component is part of a given module. These predicates and types are defined in vocabularies.

Note

RDF allows graph-based datasets to be created by linking things with certain relationships. These things and relationships are represented by literals or URIs. (Standard) vocabularies contain reusable concepts and relationships.

Note

RDF is a W3C recommendation for data interchange on the Web.

Because configuration files are defined in RDF, all applications that can handle RDF can work with these files and act on it, such as reasoners, query engines, other dependency injection framework implementations, ...

Vocabularies

The following vocabularies are understood by Components.js:

Prefix URL
oo https://linkedsoftwaredependencies.org/vocabularies/object-oriented#
om https://linkedsoftwaredependencies.org/vocabularies/object-mapping#
doap http://usefulinc.com/ns/doap#
rdf http://www.w3.org/1999/02/22-rdf-syntax-ns#
rdfs http://www.w3.org/2000/01/rdf-schema#
owl http://www.w3.org/2002/07/owl#
xsd http://www.w3.org/2001/XMLSchema#

If the JSON-LD serialization is used, shortcuts can be used for most of the URLs using Components.js's context: https://linkedsoftwaredependencies.org/bundles/npm/componentsjs/^6.0.0/components/context.jsonld

These vocabularies will be referenced by their prefix and JSON-LD shortcut in the following sections.