Skip to content

Commit

Permalink
sungenus
Browse files Browse the repository at this point in the history
and fmt
  • Loading branch information
nleanba committed Nov 8, 2024
1 parent 46d1d35 commit 57a0684
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 13 deletions.
16 changes: 13 additions & 3 deletions Queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ BIND(<${colUri}> as ?col)
?col dwc:genericName ?genus .
OPTIONAL { ?col (dwc:parent|dwc:acceptedName)* ?p . ?p dwc:rank "kingdom" ; dwc:taxonName ?colkingdom . }
BIND(COALESCE(?colkingdom, "") AS ?kingdom)
OPTIONAL { ?col dwc:infragenericEpithet ?colsubgenus . }
BIND(COALESCE(?colsubgenus, "") AS ?subgenus)
OPTIONAL {
?col dwc:specificEpithet ?species .
OPTIONAL { ?col dwc:infraspecificEpithet ?infrasp . }
Expand All @@ -52,7 +54,9 @@ BIND(<${colUri}> as ?col)
FILTER(LCASE(?rank) = LCASE(?trank))
?tn dwc:kingdom ?kingdom .
?tn dwc:genus ?genus .
OPTIONAL { ?tn dwc:subGenus ?tnsubgenus . }
FILTER(?subgenus = COALESCE(?tnsubgenus, ""))
OPTIONAL { ?tn dwc:species ?tnspecies . }
FILTER(?species = COALESCE(?tnspecies, ""))
OPTIONAL { ?tn dwc:subSpecies|dwc:variety|dwc:form ?tninfrasp . }
Expand Down Expand Up @@ -108,13 +112,14 @@ export const getNameFromTC = (tcUri: string) =>
?tn dwc:rank ?tnrank .
?tn dwc:kingdom ?kingdom .
?tn dwc:genus ?genus .
OPTIONAL { ?tn dwc:subGenus ?subgenus . }
OPTIONAL { ?tn dwc:subGenus ?tnsubgenus . }
OPTIONAL {
?tn dwc:species ?tnspecies .
OPTIONAL { ?tn dwc:subSpecies|dwc:variety|dwc:form ?tninfrasp . }
}
BIND(LCASE(?tnrank) AS ?rank)
BIND(COALESCE(?tnsubgenus, "") AS ?subgenus)
BIND(COALESCE(?tnspecies, "") AS ?species)
BIND(COALESCE(?tninfrasp, "") AS ?infrasp)
Expand All @@ -125,6 +130,8 @@ export const getNameFromTC = (tcUri: string) =>
OPTIONAL { ?col (dwc:parent|dwc:acceptedName)* ?p . ?p dwc:rank "kingdom" ; dwc:taxonName ?colkingdom . }
FILTER(?kingdom = COALESCE(?colkingdom, ""))
OPTIONAL { ?col dwc:infragenericEpithet ?colsubgenus . }
FILTER(?subgenus = COALESCE(?colsubgenus, ""))
OPTIONAL { ?col dwc:specificEpithet ?colspecies . }
FILTER(?species = COALESCE(?colspecies, ""))
OPTIONAL { ?col dwc:infraspecificEpithet ?colinfrasp . }
Expand Down Expand Up @@ -173,13 +180,14 @@ export const getNameFromTN = (tnUri: string) =>
?tn dwc:rank ?tnrank .
?tn dwc:genus ?genus .
?tn dwc:kingdom ?kingdom .
OPTIONAL { ?tn dwc:subGenus ?subgenus . }
OPTIONAL { ?tn dwc:subGenus ?tnsubgenus . }
OPTIONAL {
?tn dwc:species ?tnspecies .
OPTIONAL { ?tn dwc:subSpecies|dwc:variety|dwc:form ?tninfrasp . }
}
BIND(LCASE(?tnrank) AS ?rank)
BIND(COALESCE(?tnsubgenus, "") AS ?subgenus)
BIND(COALESCE(?tnspecies, "") AS ?species)
BIND(COALESCE(?tninfrasp, "") AS ?infrasp)
Expand All @@ -190,6 +198,8 @@ export const getNameFromTN = (tnUri: string) =>
OPTIONAL { ?col (dwc:parent|dwc:acceptedName)* ?p . ?p dwc:rank "kingdom" ; dwc:taxonName ?colkingdom . }
FILTER(?kingdom = COALESCE(?colkingdom, ""))
OPTIONAL { ?col dwc:infragenericEpithet ?colsubgenus . }
FILTER(?subgenus = COALESCE(?colsubgenus, ""))
OPTIONAL { ?col dwc:specificEpithet ?colspecies . }
FILTER(?species = COALESCE(?colspecies, ""))
OPTIONAL { ?col dwc:infraspecificEpithet ?colinfrasp . }
Expand Down
2 changes: 1 addition & 1 deletion SynonymGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,7 @@ SELECT DISTINCT ?url ?description WHERE {
*/
export type Name = {
/** taxonomic kingdom
*
*
* may be empty for some CoL-taxa with missing ancestors */
kingdom: string;
/** Human-readable name */
Expand Down
11 changes: 5 additions & 6 deletions example/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,13 @@ syno-treatment,
transition: all 200ms;
clear: both;

&>svg {
& > svg {
height: 1rem;
vertical-align: sub;
margin: 0 0.2rem 0 -1.2rem;
}

>.icon.button {
> .icon.button {
float: right;
}

Expand Down Expand Up @@ -133,7 +133,7 @@ syno-treatment,

.figures {
display: grid;
grid-template-columns: repeat( auto-fill, minmax(12rem, 1fr) );
grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
grid-template-rows: masonry;
margin: 0.2rem 0 0.2rem 2.2rem;
gap: 1rem;
Expand All @@ -147,7 +147,6 @@ syno-treatment,
}
}


.icon.button {
border-radius: 1rem;
border: none;
Expand All @@ -158,7 +157,7 @@ syno-treatment,
padding: 0;
position: relative;

&>svg {
& > svg {
height: 1rem;
margin: 0;
}
Expand Down Expand Up @@ -196,4 +195,4 @@ syno-treatment,

.gray {
color: #666666;
}
}
6 changes: 3 additions & 3 deletions example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ <h1>SynoLib</h1>
</li>
</ul>
<br />
Expand a treatment with the button on the right to show all cited taxa, figures and materials. Click on a taxon identifier
beneath a treatment to scroll to that name — if it is (already) in the
list.
Expand a treatment with the button on the right to show all cited taxa,
figures and materials. Click on a taxon identifier beneath a treatment to
scroll to that name — if it is (already) in the list.
</p>

<div id="root"></div>
Expand Down

0 comments on commit 57a0684

Please sign in to comment.