Open lecoqlibre opened 1 year ago
The hasNutrientCharacteristic, hasPhysicalCharacteristic and hasAllergenCharacteristic could be generalized with a Characteristic base class like:
hasNutrientCharacteristic
hasPhysicalCharacteristic
hasAllergenCharacteristic
Characteristic
import Measurable from "./Measurable.js" import QuantitativeValue from "./QuantitativeValue.js" export default abstract class Characteristic extends QuantitativeValue implements Measurable { private quantityDimension: string; constructor(quantityUnit: string, quantityValue: number, quantityDimension: string) { super(quantityUnit, quantityValue); this.quantityDimension = quantityDimension; this.registerSemanticProperty("http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#hasQuantityDimension", () => this.getQuantityDimension()); } setQuantityDimension(quantityDimension: string): void { this.quantityDimension = quantityDimension; } getQuantityDimension(): string { return this.quantityDimension; } }
The
hasNutrientCharacteristic
,hasPhysicalCharacteristic
andhasAllergenCharacteristic
could be generalized with aCharacteristic
base class like: