IndexModel

IndexModel

The index model handles processing of for data shown on the root route of the server

Constructor

new IndexModel()

Source:

Extends

Members

prefixes :Object

Source:
Overrides:

Key - value pairs containing default prefixes we always need

Type:
  • Object

prefixRegex :RegExp

Source:
Overrides:
To Do:
  • move this out

Regular expression to match prefixes that need to be adjusted to the server's url

Only used once at startup in app.js

Type:
  • RegExp

replacementPrefixes :Object

Source:
Overrides:
To Do:
  • move this out, only used on startup

The prefixes which depend on the server's current URL and thus always need to point to the right address.

Type:
  • Object

subpathlinkRegex :RegExp

Source:
Overrides:
To Do:
  • move this out

Regular expression to match 'subpathlinks' that need to be adjusted to the server's url

Only used once at startup in app.js

Type:
  • RegExp

Methods

(async) getAll(req) → {Object}

Source:
Overrides:

gets all of the items from the 'shapes', 'states' and 'steps' models and converts them to jsonLD

Parameters:
Name Type Description
req Object

Request, currently unused

Returns:
  • Json representation of data
Type
Object

replacePrefixesInFile(file)

Source:
Overrides:
To Do:
  • - replacing the sublinkpath links won't work if there are references to links not pointing to a 'plan' - pull this out of baseModel as it's only used once on startup but never in any of the derived classes

Replaces all "@prefix..." and "ex:sublinkpath..." lines in the supplied file with the correct links as these links depend on the hostname of the server

Parameters:
Name Type Description
file string

name of the file whose contents we will be replacing