Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synolib2 #14

Draft
wants to merge 72 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
5da326a
Foundation
nleanba Oct 25, 2024
13c13d5
finds initial name if given colUri
nleanba Oct 25, 2024
ed57af6
working on queuing
nleanba Oct 25, 2024
d58f9e6
mostly working for coL and tc
nleanba Oct 27, 2024
cef7cd9
small cleanup
nleanba Oct 27, 2024
18c96a6
deduplicated code
nleanba Oct 27, 2024
aaaa469
added support for TNuris
nleanba Oct 27, 2024
bd30d55
small tweak
nleanba Oct 27, 2024
b253e7d
justifications!
nleanba Oct 27, 2024
7507c72
doc cleanup
nleanba Oct 27, 2024
229f010
latin names
nleanba Oct 27, 2024
ce97f55
recursife justification display
nleanba Oct 27, 2024
c61f3c0
vernacular names
nleanba Oct 27, 2024
f8e0181
foloow CoL-acceptedName-links
nleanba Oct 27, 2024
9676a3f
fixed kingdom-alignment
nleanba Oct 27, 2024
1e17c3b
updated readme
nleanba Oct 27, 2024
e6c6958
added support for subtaxa
nleanba Oct 27, 2024
d8ead30
reasoning
nleanba Oct 27, 2024
bf3e141
some quick fixes for lindas
nleanba Oct 27, 2024
0658ab1
npm and minimal html example
nleanba Oct 27, 2024
be61578
query params
nleanba Oct 27, 2024
e068088
moved npm build stuff to toplevel, reorganized build and example code
nleanba Oct 28, 2024
4c22ecd
updated README.md to explain example
nleanba Oct 28, 2024
f2bb1d7
looks real nice
nleanba Oct 28, 2024
6d34a0b
tweaks
nleanba Oct 28, 2024
8877e5e
fixed build
nleanba Oct 29, 2024
d822086
order treatments by date
nleanba Oct 29, 2024
04f0a1c
expand treatment details on click
nleanba Oct 29, 2024
3778b51
Merge remote-tracking branch 'origin/main' into synolib2
nleanba Oct 29, 2024
38700ed
move to build example with deno
nleanba Oct 29, 2024
d9edaa0
deno fmt
nleanba Oct 29, 2024
5b28261
fix build and lint
nleanba Oct 30, 2024
36d464d
fixed handling of multiple col taxa for one name
nleanba Oct 30, 2024
c80dc94
improved handling of other infraspecific names
nleanba Oct 30, 2024
d9c1d17
fixed duplicate check
nleanba Oct 30, 2024
c1ff9ef
various small improvements
nleanba Oct 30, 2024
e89be67
fixed github action
nleanba Oct 30, 2024
fb76109
actually fix github action
nleanba Oct 31, 2024
d961840
handle col-taxa without authority
nleanba Oct 31, 2024
986931a
resolve ids to names if the are synonyms
nleanba Oct 31, 2024
35c8c3b
actually require tn to ba a tn
nleanba Nov 5, 2024
d932950
moved queries to own file
nleanba Nov 5, 2024
24af399
simplified treatments
nleanba Nov 5, 2024
936a99c
better figure support
nleanba Nov 5, 2024
9663f68
fixed queries to be usable with lindas
nleanba Nov 5, 2024
46d1d35
handle kingdoms
nleanba Nov 8, 2024
57a0684
sungenus
nleanba Nov 8, 2024
1c1aad9
v3.0.1
nleanba Nov 8, 2024
df61eb0
fix getNameFromCoL query
nleanba Nov 8, 2024
2b610f9
v3.1.1
nleanba Nov 8, 2024
81e71cf
added comment
nleanba Dec 19, 2024
2189046
improved cli
nleanba Dec 19, 2024
a5d04ad
deduplicate authNames if multiple col-authorities found
nleanba Dec 20, 2024
b2b8bd7
unify authoritiy names if they are obviously equivalent
nleanba Dec 20, 2024
aa6f0bf
v3.2.0
nleanba Dec 20, 2024
c258f94
v3.2.1 small fix to cli script
nleanba Dec 20, 2024
f9d0b18
fixed stray "INVALID COL" appearing
nleanba Dec 20, 2024
9d1efbb
v3.2.2
nleanba Dec 20, 2024
ce10463
acceptedCOL is a promise now
nleanba Dec 20, 2024
aa40d75
v3.3.0
nleanba Dec 20, 2024
ffe68cb
handle sections
nleanba Jan 2, 2025
519fc39
v3.3.1
nleanba Jan 2, 2025
bfe62f8
col is no longer a promise
nleanba Jan 5, 2025
967aa1f
added automatic publish
nleanba Jan 5, 2025
d7ba245
v3.4.0
nleanba Jan 5, 2025
7203ee6
quick fix
nleanba Jan 5, 2025
0f5ddfb
handle taxonnames without dwc:kingdom
nleanba Jan 5, 2025
c951292
v3.4.1
nleanba Jan 5, 2025
85713a9
fixed queries for indirect kingdom
nleanba Jan 5, 2025
140d244
v3.4.2
nleanba Jan 5, 2025
4b7fddf
moved fetchOptions to central place
nleanba Jan 6, 2025
5828cfc
force use of cached responses client-side
nleanba Jan 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM denoland/deno:bin-1.41.3 AS deno
FROM denoland/deno:bin-1.45.5 AS deno
FROM mcr.microsoft.com/devcontainers/typescript-node:20
COPY --from=deno /deno /usr/local/bin/deno
43 changes: 21 additions & 22 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
{
"name": "Deno",
"build": {
"dockerfile": "Dockerfile"
},
"name": "Deno",
"build": {
"dockerfile": "Dockerfile"
},

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "yarn install",
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "yarn install",

// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": [
"justjavac.vscode-deno-extensionpack"
]
}
}

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": [
"justjavac.vscode-deno-extensionpack"
]
}
}
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
40 changes: 9 additions & 31 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: GitHub Pages
on:
push:
branches:
- main # Set a branch to deploy
- synolib2 # publish on change in either branch
- main # Set a branch to deploy
- synolib2 # publish on change in either branch
permissions:
contents: write

Expand All @@ -14,41 +14,19 @@ jobs:
runs-on: ubuntu-22.04

steps:

# main / old:
- name: 'Checkout main branch'
uses: actions/checkout@v3
with:
ref: main
- name: Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- name: prepare
run: |
mkdir build
cp index.html build/
- run: deno bundle SynonymGroup.ts build/synonym-group.js
- run: cp SynonymGroup.ts build/

# synolib2 / new:
- name: 'Checkout synolib2 branch'
- name: "Checkout synolib2 branch"
uses: actions/checkout@v3
with:
ref: synolib2
path: 'synolib2'
- name: Use Node.js
uses: actions/setup-node@v4
- name: Setup Deno
uses: denoland/setup-deno@v2
with:
node-version: '20.x'
deno-version: v2.x
- name: Draw the rest of the owl
run: |
cd synolib2
npm ci
npm run example build
mkdir ../build/next
cp ./example/index.* ../build/next/
cd ..
deno task example_build
mkdir ./build
cp ./example/index.* ./build/

- name: Deploy to GitHub Pages
uses: JamesIves/[email protected]
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Publish

on:
push:
branches:
- synolib2

# runs on every push, does not publish unless deno.jsonc version number was updated

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write # The OIDC ID token is used for authentication with JSR.
steps:
- uses: actions/checkout@v4
- run: npx jsr publish
10 changes: 5 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
synonym-group.js

npm-package/node_modules
npm-package/index.js
npm-package/index.d.ts
docs/
build/
example/index.js
example/index.js.map
node_modules/
1 change: 0 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,5 @@
],
"attachSimplePort": 9229
}

]
}
57 changes: 57 additions & 0 deletions DESIGN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Design

<!-- deno-fmt-ignore -->
> [!NOTE]
> This currently (2024-07-27) describes a potential future design, not
> the current one.

## Overview

The central taxonomic entity is one object `N` per latin name.\
Synolib returns as results a list of `N`s.

Each `N` exists because of a taxon-name, taxon-concept or col-taxon in the
data.\
Each `N` is uniquely determined by its human-readable latin name (for taxa
ranking below genus, this is a multi-part name — binomial or trinomial) and
kingdom.\
Each `N` contains `N+A` objects which represent latin names with an authority.\
Each `N` contains, if present, `treatment`s directly associated with the
respective taxon-name.\
Other metadata (if present) of a `N` are the list of its parent names (family,
order, ...); vernacular names; and taxon-name URI.

Each `N+A` exists because of a taxon-concept or col-taxon in the data. It always
has a parent `N`.\
Each `N+A` is uniquely determined by its human-readable latin name (as above),
kingdom and (normalized [^1]) authority.\
Each `N+A` contains, if present, `treatment`s directly associated with the
respective taxon-concept.\
Other metadata (if present) of a `N` are CoL IDs; and taxon-concept URI.

A `treatment` exists because it is in the data, and is identifed by its RDF
URI.\
A `treatment` may _define_, _augment_, _deprecate_ or _cite_ a `N+A`, and
_treat_ or _cite_ a `N`.\
If a `treatment` does _define_, _augment_, _deprecate_ or _treat_ different `N`
and/or `N+A`s, they are considered synonyms.\
Note that _cite_ does not create synonmic links.\
Other metadata of a `treatment` are its authors, material citations, and images.

Starting point of the algorithm is a latin name or the URI of either a
taxon-name, tacon-conecpt or col-taxon.\
It will first try to find the respective `N` and all associated metadata, `N+A`s
and `treatment`s.\
This `N` is the first result.\
Then it will recursively use all synonyms indicated by the found `treatment`s to
find new `N`s.\
For each new `N`, it will find all associated metadata, `N+A`s and `treatment`s;
and return it as the next result.\
Then it will continue to expand recursively until no more new `N`s are found.

The algorithm keeps track of which treatment links it followed and other reasons
it added a `N` to the results.\
This "justification" is also proved as metadata of a `N`.

[^1]: I.e. ignoring differences in punctuation, diacritics, capitalization and
such.
114 changes: 0 additions & 114 deletions JustificationSet.ts

This file was deleted.

Loading
Loading