@dasch-swiss/dsp-js
Version:
TypeScript client library for DSP-API
68 lines • 2.43 kB
JavaScript
import { __decorate, __metadata } from "tslib";
import { JsonObject, JsonProperty } from 'json2typescript';
import { Constants } from '../../Constants';
import { DateTimeStampConverter } from '../../custom-converters/date-time-stamp-converter';
import { ClassAndPropertyDefinitions } from '../ClassAndPropertyDefinitions';
/**
* @category Model V2
*/
let ReadOntology = class ReadOntology extends ClassAndPropertyDefinitions {
constructor() {
super(...arguments);
this.id = '';
this.label = '';
this.comment = undefined;
this.lastModificationDate = undefined;
this.properties = {};
this.classes = {};
}
/**
* Gets all class definitions from the ontology's entity info.
*/
getAllClassDefinitions() {
return this.getAllEntityDefinitionsAsArray(this.classes);
}
/**
* Gets class definitions restricted by type from the ontology's entity info.
*
* @param type restriction to a certain class definition type.
*/
getClassDefinitionsByType(type) {
return this.getEntityDefinitionsByTypeAsArray(this.getAllClassDefinitions(), type);
}
/**
* Gets all property definitions from the ontology's entity info.
*/
getAllPropertyDefinitions() {
return this.getAllEntityDefinitionsAsArray(this.properties);
}
/**
* Gets property definitions restricted by type from the ontology's entity info.
*
* @param type restriction to a certain property definition type.
*/
getPropertyDefinitionsByType(type) {
return this.getEntityDefinitionsByTypeAsArray(this.getAllPropertyDefinitions(), type);
}
};
__decorate([
JsonProperty('@id', String),
__metadata("design:type", Object)
], ReadOntology.prototype, "id", void 0);
__decorate([
JsonProperty(Constants.Label, String),
__metadata("design:type", Object)
], ReadOntology.prototype, "label", void 0);
__decorate([
JsonProperty(Constants.Comment, String, true),
__metadata("design:type", String)
], ReadOntology.prototype, "comment", void 0);
__decorate([
JsonProperty(Constants.LastModificationDate, DateTimeStampConverter, true),
__metadata("design:type", String)
], ReadOntology.prototype, "lastModificationDate", void 0);
ReadOntology = __decorate([
JsonObject('ReadOntology')
], ReadOntology);
export { ReadOntology };
//# sourceMappingURL=read-ontology.js.map