Skip to content

Commit

Permalink
Updated dwc:basisOfRecord to basisOfRecord.
Browse files Browse the repository at this point in the history
That's what the publication says we should use. I think we previously
had dwc: prefixes everywhere, but we didn't notice that this was still
around for basisOfRecord until just now.
  • Loading branch information
gaurav committed Jun 19, 2024
1 parent abed61c commit 7710b7d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/wrappers/SpecimenWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ const { PhyxCacheManager } = require('../utils/PhyxCacheManager');
*
* - TaxonomicUnitWrapper.TYPE_SPECIMEN: A specimen.
* - Based on http://rs.tdwg.org/dwc/terms/Occurrence
* - Should have a dwc:occurrenceID with the occurrence identifier.
* - Should have a dwc:basisOfRecord to indicate what sort of occurrence this is.
* - Should have a occurrenceID with the occurrence identifier.
* - Should have a basisOfRecord to indicate what sort of occurrence this is.
*
* Since TaxonNameWrapper follows the TDWG ontology, we'd love to do the same for
* SpecimenWrapper, but unfortunately the TaxonOccurrence ontology has been deprecated
Expand All @@ -38,7 +38,7 @@ class SpecimenWrapper {
const normalizedSpecimen = {
'@type': SpecimenWrapper.TYPE_SPECIMEN,
label: wrapped.label,
'dwc:basisOfRecord': wrapped.basisOfRecord,
basisOfRecord: wrapped.basisOfRecord,
occurrenceID: wrapped.occurrenceID,
catalogNumber: wrapped.catalogNumber,
institutionCode: wrapped.institutionCode,
Expand All @@ -62,7 +62,7 @@ class SpecimenWrapper {
// Prepare the specimen.
const specimen = {
'@type': SpecimenWrapper.TYPE_SPECIMEN,
'dwc:basisOfRecord': basisOfRecord,
basisOfRecord: basisOfRecord,

Check failure on line 65 in src/wrappers/SpecimenWrapper.js

View workflow job for this annotation

GitHub Actions / build (18.x)

Expected property shorthand

Check failure on line 65 in src/wrappers/SpecimenWrapper.js

View workflow job for this annotation

GitHub Actions / build (20.x)

Expected property shorthand
occurrenceID: occurID,
};

Expand Down Expand Up @@ -185,7 +185,7 @@ class SpecimenWrapper {
* Return the basis of record, if one is present.
*/
get basisOfRecord() {
if (has(this.specimen, 'dwc:basisOfRecord')) return this.specimen['dwc:basisOfRecord'];
if (has(this.specimen, 'basisOfRecord')) return this.specimen.basisOfRecord;
return undefined;
}

Expand All @@ -194,7 +194,7 @@ class SpecimenWrapper {
* recommended values.
*/
set basisOfRecord(bor) {
this.specimen['dwc:basisOfRecord'] = bor;
this.specimen.basisOfRecord = bor;
}

/** Return this specimen as a taxon concept if it contains taxon name information. */
Expand Down

0 comments on commit 7710b7d

Please sign in to comment.