Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-fox committed Aug 2, 2023
1 parent f231f2c commit 3d06de6
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
3 changes: 1 addition & 2 deletions app/lib/formatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const port = process.env.WEB_APP_PORT || '3000';
const dataModelContext =
process.env.IOTA_JSON_LD_CONTEXT || 'http://localhost:' + port + '/data-models/ngsi-context.jsonld';


//
// Entity types are typically title cased following Schema.org
//
Expand Down Expand Up @@ -54,7 +53,7 @@ function formatResponse(req, inputData, attributeValueCallback) {
const mappedAttributes = parseMapping(req.params.mapping);
const regex = /:.*/gi;
const type = req.params.id.replace('urn:ngsi-ld:', '').replace(regex, '');
const links = req.headers.link ? parseLinks(req.headers.link) : {context: dataModelContext};
const links = req.headers.link ? parseLinks(req.headers.link) : { context: dataModelContext };
const attrs = (req.query.attrs || '').split(',');

const response = {
Expand Down
2 changes: 1 addition & 1 deletion app/public/data-models/alternate-context.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"bewegung": "https://w3id.org/saref#motion",
"bewegungsaktivität": "https://w3id.org/saref#movementActivity",
"multimedia": "https://w3id.org/saref#multimedia",
"name": "ngsi-ld:name",
"name": "schema:name",
"netzwerk": "https://w3id.org/saref#network",
"belegung": "https://w3id.org/saref#occupancy",
"besatzer": "fiware:occupier",
Expand Down
2 changes: 1 addition & 1 deletion app/public/data-models/json-context.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
"movementActivity": "https://w3id.org/saref#movementActivity",
"multimedia": "https://w3id.org/saref#multimedia",
"name": {
"@id": "ngsi-ld:name",
"@id": "schema:name",
"@type": "xsd:string"
},
"network": "https://w3id.org/saref#network",
Expand Down
2 changes: 1 addition & 1 deletion app/public/data-models/ngsi-context.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"motion": "https://w3id.org/saref#motion",
"movementActivity": "https://w3id.org/saref#movementActivity",
"multimedia": "https://w3id.org/saref#multimedia",
"name": "ngsi-ld:name",
"name": "schema:name",
"network": "https://w3id.org/saref#network",
"observedAt": "ngsi-ld:observedAt",
"occupancy": "https://w3id.org/saref#occupancy",
Expand Down
5 changes: 2 additions & 3 deletions app/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,10 @@ router.get('/app/monitor', function (req, res) {
router.get('/device/history', function (req, res) {
const stores = [];
if (process.env.CRATE_DB_SERVICE_URL || process.env.STH_COMET_SERVICE_URL) {

for (let i = 1; i <= numberOfPigs; i++) {
stores.push({
name: ('Device' + i.toString().padStart(3, '0')),
href: ('history/' + i.toString().padStart(3, '0'))
name: 'Device' + i.toString().padStart(3, '0'),
href: 'history/' + i.toString().padStart(3, '0')
});
}
}
Expand Down

0 comments on commit 3d06de6

Please sign in to comment.