Skip to content

Commit

Permalink
Make rui_location optional for ds-graphs
Browse files Browse the repository at this point in the history
  • Loading branch information
bherr2 committed May 13, 2024
1 parent 5a42d01 commit 53b79e6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/normalization/normalize-ds-graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ function createTissueBlockObject(donor, block) {
.append('label', getSampleLabel(block))
.append('class_type', 'TissueBlock')
.append('typeOf', ['TissueBlock'])
.append('partially_overlaps', block.rui_location.ccf_annotations?.map((organ) => organ))
.append('partially_overlaps', block.rui_location?.ccf_annotations?.map((organ) => organ))
.append('pref_label', block.label)
.append('description', block.description)
.append('rui_location', block.rui_location['@id'])
.append('extraction_site', block.rui_location['@id'])
.append('rui_location', block.rui_location?.['@id'])
.append('extraction_site', block.rui_location?.['@id'])
.append('external_link', block.link)
.append('sections', block.sections
?.map((section) => createTissueSectionObject(block, section))
Expand Down Expand Up @@ -185,7 +185,7 @@ function normalizeExtractionSiteData(data) {
}

function createExtractionSiteObject(block, spatialEntity) {
if (!checkExtractionSiteId(spatialEntity['@id'])) {
if (!spatialEntity || !checkExtractionSiteId(spatialEntity['@id'])) {
return null;
}
return new ObjectBuilder()
Expand Down

0 comments on commit 53b79e6

Please sign in to comment.