lincd-jsonld-store
Version:
36 lines • 1.6 kB
JavaScript
import { JSONLD } from 'lincd-jsonld/utils/JSONLD';
import { createNameSpace } from 'lincd/utils/NameSpace';
import { linkedOntology } from '../package.js';
//import all the exports of this file as one variable called _this (we need this at the end)
import * as _this from './jsonld-store.js';
/**
* Load the data of this ontology into memory, thus adding the properties of the entities of this ontology to the local graph.
*/
export var loadData = () => {
if (typeof module !== 'undefined' && typeof exports !== 'undefined') {
// CommonJS import
return import('../data/jsonld-store.json').then((data) => JSONLD.parse(data));
}
else {
// ESM import
//@ts-ignore
return import('../data/jsonld-store.json', { with: { type: 'json' } }).then((data) => JSONLD.parse(data.default));
}
};
/**
* The namespace of this ontology, which can be used to create NamedNodes with URI's not listed in this file
*/
export var ns = createNameSpace('http://lincd.org/ont/jsonld-store');
/**
* The NamedNode of the ontology itself
*/
export var _self = ns('');
//A list of all the entities (Classes & Properties) of this ontology, each exported as a NamedNode
export var JSONLD_Store = ns('JSONLD_Store');
//An extra grouping object so all the entities can be accessed from the prefix/name
export const jsonldStore = {
JSONLD_Store,
};
//Registers this ontology to LINCD.JS, so that data loading can be automated amongst other things
linkedOntology(_this, ns, 'jsonld-store', loadData, '../data/jsonld-store.json');
//# sourceMappingURL=jsonld-store.js.map