@dasch-swiss/dsp-js
Version:
JavaScript library that handles API requests to Knora
48 lines • 2.2 kB
JavaScript
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
import { ClassAndPropertyDefinitions } from "../../models/v2/ontologies/ClassAndPropertyDefinitions";
/**
* Represents resource class definitions
* and property definitions the resource classes have cardinalities for.
*
* @category Model V2
*/
var ResourceClassAndPropertyDefinitions = /** @class */ (function (_super) {
__extends(ResourceClassAndPropertyDefinitions, _super);
function ResourceClassAndPropertyDefinitions(resClassDefs, propDefs) {
var _this = _super.call(this) || this;
_this.classes = resClassDefs;
_this.properties = propDefs;
return _this;
}
/**
* Gets all property definitions from the resource's entity info.
*/
ResourceClassAndPropertyDefinitions.prototype.getAllPropertyDefinitions = function () {
return this.getAllEntityDefinitionsAsArray(this.properties);
};
/**
* Gets property definitions restricted by type from the resource's entity info.
*
* @param type restriction to a certain property definition type.
*/
ResourceClassAndPropertyDefinitions.prototype.getPropertyDefinitionsByType = function (type) {
return this.getEntityDefinitionsByTypeAsArray(this.getAllPropertyDefinitions(), type);
};
return ResourceClassAndPropertyDefinitions;
}(ClassAndPropertyDefinitions));
export { ResourceClassAndPropertyDefinitions };
//# sourceMappingURL=resource-class-and-property-definitions.js.map