Skip to content

Commit

Permalink
add queries by hash, url, and uuid; related to bio-guoda/preston#199
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorrit Poelen committed Dec 21, 2023
1 parent 99fc756 commit 9cb5159
Show file tree
Hide file tree
Showing 3 changed files with 129 additions and 0 deletions.
43 changes: 43 additions & 0 deletions hash.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#+ endpoint: https://lod.globalbioticinteractions.org/query
#+ defaults:
#+ - hash: hash://sha256/1e2b7436fce1848f41698e5a9c193f311abaf0ee051bec1a2e48b5106d29524d

SELECT DISTINCT
?doi
?uuid
?contentId
?archiveUrl
?seenAt
WHERE
{
BIND(?_hash_iri as ?contentId)
{
SELECT ?doi ?seenAt ?archiveUrl ?uuid
WHERE {
graph ?g1 {
?uuid <http://www.w3.org/ns/prov#hadMember> ?archiveUrl .
?uuid <http://www.w3.org/1999/02/22-rdf-syntax-ns#seeAlso> ?doi .
?archiveUrl <http://purl.org/dc/elements/1.1/format> "application/dwca" .
}
graph ?activity {
?activity <http://www.w3.org/ns/prov#used> ?archiveUrl .
?activity <http://www.w3.org/ns/prov#generatedAtTime> ?seenAt .
?_hash_iri <http://www.w3.org/ns/prov#qualifiedGeneration> ?activity .
}

}
}
UNION
{
SELECT ?doi ?seenAt ?archiveUrl ?uuid
WHERE {
?uuid <http://www.w3.org/ns/prov#hadMember> ?archiveUrl .
?uuid <http://www.w3.org/1999/02/22-rdf-syntax-ns#seeAlso> ?doi .
?archiveUrl <http://purl.org/dc/elements/1.1/format> "application/dwca" .
?activity <http://www.w3.org/ns/prov#used> ?archiveUrl .
?activity <http://www.w3.org/ns/prov#generatedAtTime> ?seenAt .
?_hash_iri <http://www.w3.org/ns/prov#qualifiedGeneration> ?activity .
}
}
} ORDER BY DESC(?seenAt)

43 changes: 43 additions & 0 deletions url.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#+ endpoint: https://lod.globalbioticinteractions.org/query
#+ defaults:
#+ - url: https://hosted-datasets.gbif.org/eBird/2022-eBird-dwca-1.0.zip

SELECT DISTINCT
?doi
?uuid
?contentId
?archiveUrl
?seenAt
WHERE
{
BIND(?_url_iri as ?archiveUrl)
{
SELECT ?contentId ?seenAt ?uuid ?doi
WHERE {
graph ?g1 {
?uuid <http://www.w3.org/ns/prov#hadMember> ?_url_iri .
?uuid <http://www.w3.org/1999/02/22-rdf-syntax-ns#seeAlso> ?doi .
?_url_iri <http://purl.org/dc/elements/1.1/format> "application/dwca" .
}
graph ?activity {
?activity <http://www.w3.org/ns/prov#used> ?_url_iri .
?activity <http://www.w3.org/ns/prov#generatedAtTime> ?seenAt .
?contentId <http://www.w3.org/ns/prov#qualifiedGeneration> ?activity .
}

}
}
UNION
{
SELECT ?contentId ?seenAt ?uuid
WHERE {
?uuid <http://www.w3.org/ns/prov#hadMember> ?_url_iri .
?uuid <http://www.w3.org/1999/02/22-rdf-syntax-ns#seeAlso> ?doi .
?_url_iri <http://purl.org/dc/elements/1.1/format> "application/dwca" .
?activity <http://www.w3.org/ns/prov#used> ?_url_iri .
?activity <http://www.w3.org/ns/prov#generatedAtTime> ?seenAt .
?contentId <http://www.w3.org/ns/prov#qualifiedGeneration> ?activity .
}
}
} ORDER BY DESC(?seenAt)

43 changes: 43 additions & 0 deletions uuid.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#+ endpoint: https://lod.globalbioticinteractions.org/query
#+ defaults:
#+ - uuid: 4fa7b334-ce0d-4e88-aaae-2e0c138d049e

SELECT DISTINCT
?doi
?uuid
?contentId
?archiveUrl
?seenAt
WHERE
{
BIND(?_uuid_iri as ?uuid)
{
SELECT ?contentId ?seenAt ?archiveUrl ?doi
WHERE {
graph ?g1 {
?_uuid_iri <http://www.w3.org/ns/prov#hadMember> ?archiveUrl .
?_uuid_iri <http://www.w3.org/1999/02/22-rdf-syntax-ns#seeAlso> ?doi .
?archiveUrl <http://purl.org/dc/elements/1.1/format> "application/dwca" .
}
graph ?activity {
?activity <http://www.w3.org/ns/prov#used> ?archiveUrl .
?activity <http://www.w3.org/ns/prov#generatedAtTime> ?seenAt .
?contentId <http://www.w3.org/ns/prov#qualifiedGeneration> ?activity .
}

}
}
UNION
{
SELECT ?contentId ?seenAt ?archiveUrl ?doi
WHERE {
?_uuid_iri <http://www.w3.org/ns/prov#hadMember> ?archiveUrl .
?_uuid_iri <http://www.w3.org/1999/02/22-rdf-syntax-ns#seeAlso> ?doi .
?archiveUrl <http://purl.org/dc/elements/1.1/format> "application/dwca" .
?activity <http://www.w3.org/ns/prov#used> ?archiveUrl .
?activity <http://www.w3.org/ns/prov#generatedAtTime> ?seenAt .
?contentId <http://www.w3.org/ns/prov#qualifiedGeneration> ?activity .
}
}
} ORDER BY DESC(?seenAt)

0 comments on commit 9cb5159

Please sign in to comment.