Skip to content

Commit

Permalink
explicitly indicate missing kingdom
Browse files Browse the repository at this point in the history
  • Loading branch information
nleanba committed Jan 2, 2025
1 parent 31dea55 commit ee26435
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 6 deletions.
28 changes: 27 additions & 1 deletion deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added errors.log
Binary file not shown.
10 changes: 5 additions & 5 deletions src/gg2rdf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,10 @@ export function gg2rdf(
status = Math.max(status, Status.has_errors);
} else if (!taxon.getAttribute("kingdom")) {
log(
"Warning: treatment taxon is missing ancestor kingdom, defaulting to 'Animalia'",
"Warning: treatment taxon is missing ancestor kingdom",
);
output(
"# Warning: treatment taxon is missing ancestor kingdom, defaulting to 'Animalia'",
"# Warning: treatment taxon is missing ancestor kingdom",
);
status = Math.max(status, Status.has_warnings);
}
Expand Down Expand Up @@ -1246,7 +1246,7 @@ export function gg2rdf(
/** replaces <xsl:call-template name="taxonNameBaseURI"> */
function taxonNameBaseURI({ kingdom }: { kingdom: string }) {
return `http://taxon-name.plazi.org/id/${
kingdom ? partialURI(kingdom) : "Animalia"
kingdom ? partialURI(kingdom) : "INVALID"
}`;
}

Expand Down Expand Up @@ -1362,10 +1362,10 @@ export function gg2rdf(

/** Get kingdom of taxonName
*
* If `taxonName.getAttribute("kingdom")` is falsy (e.g. null or empty), returns "Animalia".
* If `taxonName.getAttribute("kingdom")` is falsy (e.g. null or empty), returns "INVALID".
*/
function getKingdom(taxonName: Element) {
return taxonName.getAttribute("kingdom") || "Animalia";
return taxonName.getAttribute("kingdom") || "INVALID";
}

/** returns plain uri
Expand Down

0 comments on commit ee26435

Please sign in to comment.