You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#196 suggests to allow preston to look up URLs associated with a hash. Doing this quickly requires building an index. I can imagine two ways this could work:
Feed nquads into preston index for indexing
$ echo<nquads>| preston index
# to index everything:
$ preston ls | preston index
# to just index aliases:
$ preston alias| preston index
# to index whatever you want:
$ preston ls | grep <whatever>| preston index
Feed hashes (or nquads containing hashes) into preston index and index their content
$ echo hash://sha256/abc | preston index
# or
$ echo<blah><...hasVersion><hash://sha256/abc>| preston index
# to index everything:
$ preston history| preston index
# to index the latest log:
$ preston head | preston index
Option 1 is simpler and makes it easier for the user to pick and choose what goes into the index
Option 2 has the advantage of being able to record where statements came from, which is a big part of what "indexes" do, and also keeps the provenance chain going, which is great. e.g. in a Lucene index where "documents" represent RDF statements, we could record each statement's origin as a line in a provenance log (line:hash://sha256/abc!/L52)
(There's also an option 3: do both option 1 and option 2)
Option 1 is tempting but I think I favor option 2. @jhpoelen thoughts? Or better ideas?
And, I was wondering . . . building an index in just another transformation of some provenance logs. . . and has a specific result (the index), so I was wondering whether you had in mind to be able to do things like:
preston history | preston index | preston process
where, preston process take the nquads generated by the indexing and adds it to the provenance log.
the index would generate some dataset containing a bunch of lucene index files (or insert your favorite indexing method).
Neat thing about this would be that a provenance log would be securely linked to a specific version of an index. With this, you can ask questions like:
Ok Google, can you find me an alias index derived from hash://sha256/abc123 ?
or
Hey Siri, can you ask Google to find me a taxonomic name index derived from hash://sha256/abc123 ?
Would be fun to say out loud right? And, no need to spin those CPUs unnecessarily to regenerate an index that has already been baked somewhere.
Piping is great! I figured preston index Should automatically append the index generation info to the provenance log because it’s saving to the blobstore, not just pumping results to stdout
So, to clarify, I imagined building the index in temp/, then zipping everything and tossing it into data/ automatically. Then commands that make use of it (thinking of server commands like preston s —registry —index hash://sha256/abc) would unzip it back into tmp/ before using it. But we could keep it ready in an index/ folder so it’s better for one-off commands like alias
#!/bin/bash## index a patched version of provenance graph associated with an anchor# into oxigraph #
preston ls\
--anchor hash://sha256/5b7fa37bf8b64e7c935c4ff3389e36f8dd162f0705410dd719fd089e1ea253cd\
--remote https://linker.bio\
| sed -E 's/(<)([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})([^ ]*)(>)/<urn:uuid:\2>/g'\
| pv -l\
| ./oxigraph_server_v0.3.22_x86_64_linux_gnu load --lenient --format nq --location preston-gib
here's a query for, and resulting list of, contentIds associated with our eBird friends. Note that this accounts for the introduction of activity namespaces in 2020 #41 .
@mielliott perhaps we have found our indexer in oxigraph . . .
At long last! Hopefully with no fun surprises like Jena's demanding urn:uuid prefixes, etc.
I should probably mention that I did implement the indexing functionality described in #199 (comment) in the registry branch, using Lucene. It never made its way into main though. A big limitation with just using Lucene was the lack of a query language like SPARQL, so instead of writing a query.sparql to search the index, I could only do simple string matching.
Do you plan on packaging oxigraph with preston, or keeping it separate as in your examples?
Do you plan on packaging oxigraph with preston, or keeping it separate as in your examples?
@mielliott great question! Not sure yet . . . am almost tempted to treat the oxigraph binaries as assets and add them to the content graph, along with functionality to execute workflows defined in that graph. But other than that, I do not see a compelling reason to merge preston with oxigraph and make it available in a single cli tool. But . . . I we did add a preston scommand to start a web interface, so why not allow something like preston sparql --anchor hash://sha256/.... to start a sparql endpoint for a specific biodiversity data graph. . .
@seltmann you can check whether your UCSB collection is tracked by Preston by embedding DwC-A and EML download buttons on your respective pages using GBIF Dataset DOI, DwC-A endpoint urls, GBIF Dataset UUID, iDigBIo recordset UUIDs -
And this kinda confused me when toying around with the new badge feature, asking for badges of silly things like RSS feeds or fake IDs. I can see this causing some confusion if for example something goes wrong for someone's EML/etc. badge, causing linker.bio to instead make a "DwC-A" badge. May I suggest a more unassuming badge when content type can't be determined? A more general "Content", "Error", or just blank? Or maybe there's an "unknown" MimeType or similar.
@mielliott thanks for sharing your thoughts. I can see how a badge with "DwC-A unknown" can be confusing, especially when plugging in any kind of stuff like https://linker.bio/badge/10.12/345 .
What the badge is trying to say is: I couldn't find any trace of a DwC archive associated with "10.12/345". So even if some content is associated with "10.12/345" but it wasn't intended to be DwC, it'll still show the "DwC-A unknown" badge.
Activity
mielliott commentedon Nov 2, 2022
Could also limit this to
to index all provenance, not allowing any flexibility. But this is significantly less fun
jhpoelen commentedon Nov 2, 2022
I like the piping of things for sure!
And, I was wondering . . . building an index in just another transformation of some provenance logs. . . and has a specific result (the index), so I was wondering whether you had in mind to be able to do things like:
preston history | preston index | preston process
where, preston process take the nquads generated by the indexing and adds it to the provenance log.
the index would generate some dataset containing a bunch of lucene index files (or insert your favorite indexing method).
Neat thing about this would be that a provenance log would be securely linked to a specific version of an index. With this, you can ask questions like:
Ok Google, can you find me an alias index derived from hash://sha256/abc123 ?
or
Hey Siri, can you ask Google to find me a taxonomic name index derived from hash://sha256/abc123 ?
Would be fun to say out loud right? And, no need to spin those CPUs unnecessarily to regenerate an index that has already been baked somewhere.
mielliott commentedon Nov 3, 2022
Piping is great! I figured
preston indexShould automatically append the index generation info to the provenance log because it’s saving to the blobstore, not just pumping results to stdout“hash colon slash slash sha 2 5 6 slash alpha beta 1 2 3 …” sounds great. Everyone loves convenient voice commands
mielliott commentedon Nov 3, 2022
So, to clarify, I imagined building the index in temp/, then zipping everything and tossing it into data/ automatically. Then commands that make use of it (thinking of server commands like
preston s —registry —index hash://sha256/abc) would unzip it back into tmp/ before using it. But we could keep it ready in an index/ folder so it’s better for one-off commands likealiasjhpoelen commentedon Nov 3, 2022
Nice! I want it!
jhpoelen commentedon Dec 15, 2023
using
I was able to load:
with
jhpoelen commentedon Dec 15, 2023
and then, with
another-query.sparqlyielding
jhpoelen commentedon Dec 15, 2023
@mielliott perhaps we have found our indexer in oxigraph . . .
jhpoelen commentedon Dec 16, 2023
Looking up content associated with a GBIF dataset id https://gbif.org/dataset/4fa7b334-ce0d-4e88-aaae-2e0c138d049e
see also
yielding
jhpoelen commentedon Dec 16, 2023
here's a query for, and resulting list of, contentIds associated with our eBird friends. Note that this accounts for the introduction of activity namespaces in 2020 #41 .
with
with first 10 yielding
and last 10,
attached
ebird.tsv.txt
add some examples on indexing preston provenance logs; related to bio…
mielliott commentedon Dec 16, 2023
At long last! Hopefully with no fun surprises like Jena's demanding
urn:uuidprefixes, etc.I should probably mention that I did implement the indexing functionality described in #199 (comment) in the registry branch, using Lucene. It never made its way into main though. A big limitation with just using Lucene was the lack of a query language like SPARQL, so instead of writing a
query.sparqlto search the index, I could only do simple string matching.Do you plan on packaging oxigraph with preston, or keeping it separate as in your examples?
jhpoelen commentedon Dec 20, 2023
@mielliott great question! Not sure yet . . . am almost tempted to treat the oxigraph binaries as assets and add them to the content graph, along with functionality to execute workflows defined in that graph. But other than that, I do not see a compelling reason to merge preston with oxigraph and make it available in a single cli tool. But . . . I we did add a
preston scommand to start a web interface, so why not allow something likepreston sparql --anchor hash://sha256/....to start a sparql endpoint for a specific biodiversity data graph. . .Any ideas? What do you you think, @mielliott ?
towards adding basic web service for gbif/idigbio/biocase (gib) archi…
add config for preston-web related to bio-guoda/preston#199
27 remaining items
parse requested content type for redirect requests; related to #199
include content-type in by contentId query; attempt to simplify badge…
split prov content and index caches; related to bio-guoda/preston#199
jhpoelen commentedon Dec 30, 2023
@seltmann you can check whether your UCSB collection is tracked by Preston by embedding DwC-A and EML download buttons on your respective pages using GBIF Dataset DOI, DwC-A endpoint urls, GBIF Dataset UUID, iDigBIo recordset UUIDs -
e.g.,
https://www.gbif.org/dataset/d6097f75-f99e-4c2a-b8a5-b0fc213ecbd0
can be used as
urn:uuid:d6097f75-f99e-4c2a-b8a5-b0fc213ecbd0
to get most recent archived/tracked related DwC-A content using
https://linker.bio/urn:uuid:d6097f75-f99e-4c2a-b8a5-b0fc213ecbd0
https://linker.bio/urn:uuid:d6097f75-f99e-4c2a-b8a5-b0fc213ecbd0
with badge uri
https://linker.bio/badge/urn:uuid:d6097f75-f99e-4c2a-b8a5-b0fc213ecbd0
introduce the idea of a FAIR DwC-A badge; related to #199
add relation hadPrimarySource to associated the source provenance log…
jhpoelen commentedon Jan 3, 2024
@seltmann please note that I've redesigned the badge to be a FAIR assessment badge.
So, without further ado:
drum roll. . . .
Congratulations to @seltmann and colleagues: UCSB-IZC is FAIR!
Accessed from https://linker.bio/#use-case-4-assessing-fairness-of-biodiversity-data on 2024-01-03 -
jhpoelen commentedon Jan 3, 2024
See also https://discourse.gbif.org/t/assessing-fairness-of-biodiversity-data-through-badges-and-download-buttons/4246
add badge by content id; related to bio-guoda/preston#199
mielliott commentedon Jan 4, 2024
Amazing stuff @jhpoelen, very fun! I noticed the badges default to calling stuff a DwC-A if the content type is unknown or the content doesn't exist:
preston/preston-serve/src/main/java/bio/guoda/preston/server/RedirectingServlet.java
Lines 81 to 89 in 8a912a4
And this kinda confused me when toying around with the new badge feature, asking for badges of silly things like RSS feeds or fake IDs. I can see this causing some confusion if for example something goes wrong for someone's EML/etc. badge, causing linker.bio to instead make a "DwC-A" badge. May I suggest a more unassuming badge when content type can't be determined? A more general "Content", "Error", or just blank? Or maybe there's an "unknown" MimeType or similar.
jhpoelen commentedon Jan 4, 2024
@mielliott thanks for sharing your thoughts. I can see how a badge with "DwC-A unknown" can be confusing, especially when plugging in any kind of stuff like https://linker.bio/badge/10.12/345 .

What the badge is trying to say is: I couldn't find any trace of a DwC archive associated with "10.12/345". So even if some content is associated with "10.12/345" but it wasn't intended to be DwC, it'll still show the "DwC-A unknown" badge.
So requesting:
https://linker.bio/badge/10.12/345
is equivalent to asking:
https://linker.bio/badge/10.12/345?type=application/dwca
With this information, would you have any suggestions on how to make the "DwC-A unknown" badge less confusing and more informative?
mielliott commentedon Jan 11, 2024
How about like https://linker.bio/badge/10.12/345?type=cats?
In this case I'd argue that being less informative is less confusing
PS - I really like the feature to specify the content type 🙌
make content unknown badge less informative and less confusing by rep…
include provenance anchor on unsuccessful redirects; related to #199
add test for indexed blob store; related to #199