Currently, the provenance of a bibliographic resource gets reverse engineered in the front-end (as shown in the ugly accessor code below). For long-term it would be desirable to attach the provenance property already in the back-end, as soon as the data is retrieved from the respective external source. Would you agree?
export class ProvenResource extends BibliographicResource {
constructor(br: BibliographicResource) {
super();
Object.assign(this, br);
}
get provenance(): Provenance {
let prov = Provenance.unknown;
if (this._id) {
prov = Provenance.locdb;
} else if (this.identifiers.find(id => id.scheme === ExternalSource.swb)) {
prov = Provenance.swb;
} else if (this.identifiers.find(id => id.scheme === ExternalSource.crossref )) {
prov = Provenance.crossref
} else if (this.identifiers.find(id => id.scheme === ExternalSource.gScholar)) {
prov = Provenance.gScholar;
}
return prov
}
}
Hey @anlausch
Currently, the provenance of a bibliographic resource gets reverse engineered in the front-end (as shown in the ugly accessor code below). For long-term it would be desirable to attach the provenance property already in the back-end, as soon as the data is retrieved from the respective external source. Would you agree?