Skip to content

Instantly share code, notes, and snippets.

View resource_relationship.jsonld
{
"@context": {
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"dwc": "http://rs.tdwg.org/dwc/terms/",
"dcterms": "http://purl.org/dc/terms/",
"dwc:relationshipEstablishedDate": {"@type": "http://www.w3.org/2001/XMLSchema#dateTime"}
},
"@graph": [
{
"@type": "http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement",
@baskaufs
baskaufs / resource_relationship.csv
Created Oct 16, 2021
Tabular data for ResourceRelationship example
View resource_relationship.csv
dwc:resourceRelationshipID dwc:relationshipEstablishedDate dwc:relationshipRemarks dwc:resourceID dwc:relationshipOfResourceID dwc:relatedResourceID dwc:relationshipAccordingTo
04b16710-b09c-11e8-96f8-529269fb1459 1963-03-08T14:07-0600 pollinator captured in the act f809b9e0-b09b-11e8-96f8-529269fb1459 http://purl.obolibrary.org/obo/RO_0002456 dc609808-b09b-11e8-96f8-529269fb1459 Julie Woodruff
@baskaufs
baskaufs / construct_resource_relationship_triple.rq
Last active Oct 16, 2021
SPARQL CONSTRUCT query to create a triple for a resource relationship to be run at https://sparql.vanderbilt.edu/
View construct_resource_relationship_triple.rq
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix dcterms: <http://purl.org/dc/terms/>
construct {?subject ?predicate ?object}
from <https://resourcerelationship>
where {
bind("http://example.org/.well-known/genid/" as ?skolem)
?statement rdf:subject/dcterms:identifier ?subjectID.
?statement rdf:predicate/dcterms:identifier ?predicateID.
?statement rdf:object/dcterms:identifier ?objectID.
@baskaufs
baskaufs / find_concepts.rq
Created Oct 15, 2021
SPARQL query to run at https://sparql.vanderbilt.edu/ to find related format concepts
View find_concepts.rq
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix skos: <http://www.w3.org/2004/02/skos/core#>
prefix acformat: <http://rs.tdwg.org/format/values/>
select distinct ?broaderConcept ?label ?mediaType ?match ?matchLabel ?fileExtension
from <https://tdwg.github.io/rs.tdwg.org/cvJson/format.jsonld>
where {
# Limit concepts to current terms in pathway scheme
?concept skos:inScheme acformat:m.
@baskaufs
baskaufs / switch.rq
Created Oct 6, 2021
SPARQL query to find non-artwork items whose ACT ID needs to be switched to the artwork.
View switch.rq
# work1 has an ACT ID, and is NOT an artwork. work2 is an artwork and may or may not have an ACT ID.
# If work2 does not have an ACT ID, then the ACT ID used with work1 should be transferred to work2 and the work1 ACT ID be deleted.
select distinct ?work1 ?actId1 ?work1Label ?class1Label ?work2 ?actId2 ?work2Label ?class2Label where {
?work1 wdt:P9092 ?actId1.
?work1 wdt:P18 ?commonsImage.
optional {?work1 wdt:P31 ?class1.}
?work2 wdt:P18 ?commonsImage.
?work2 wdt:P31 ?class2.
optional {?work2 wdt:P9092 ?actId2.}
filter(?work1 != ?work2)
@baskaufs
baskaufs / remove.rq
Created Oct 6, 2021
SPARQL query for finding ACT IDs to remove from non-artwork
View remove.rq
# work1 has an ACT ID, and is an artwork. work2 is NOT an artwork and may or may not have an ACT ID.
# If work2 has an ACT ID, it should be removed. If it doesn't, no action is required.
select distinct ?work1 ?actId1 ?work1Label ?class1Label ?work2 ?actId2 ?work2Label ?class2Label where {
?work1 wdt:P9092 ?actId1.
?work1 wdt:P18 ?commonsImage.
?work1 wdt:P31 ?class1.
?work2 wdt:P18 ?commonsImage.
optional{?work2 wdt:P31 ?class2.}
optional {?work2 wdt:P9092 ?actId2.}
filter(?work1 != ?work2)
@baskaufs
baskaufs / generated_manifest.json
Created Apr 14, 2021
IIIF manifest generated by script
View generated_manifest.json
{
"@context": [
"http://iiif.io/api/presentation/3/context.json",
"http://www.w3.org/ns.anno.jsonld"
],
"id": "https://iiif.vam.ac.uk/collections/O1023003/manifest.json",
"type": "Manifest",
"viewingDirection": "left-to-right",
"behavior": [
"individuals"
View iiif_2_manifest.json
{
"@context": "http://iiif.io/api/presentation/2/context.json",
"@id": "https://storiiies.cogapp.com/wasp/manifest.json",
"@type": "sc:Manifest",
"label": {
"@value": "Hemipepsis heros – Tarantula Hawk wasp",
"@language": "en"
},
"description": {
"@value": "Introduction",
View test_manifest.json
{
"@context": "http://iiif.io/api/presentation/3/context.json",
"id": "https://iiif.io/api/cookbook/recipe/0001-mvm-image/manifest.json",
"type": "Manifest",
"label": {
"en": [
"Image 1"
]
},
"items": [
@baskaufs
baskaufs / authors.csv
Created Mar 12, 2021
Authors table to go with articles table
View authors.csv
qid label_en author_uuid author author_series_ordinal author_stated_as author_ref1_hash author_ref1_referenceUrl author_ref1_retrieved_nodeId author_ref1_retrieved_val author_ref1_retrieved_prec
Q105899588 Evaluation of Low Temperature Mortality as a Range-limiting Factor for the Southwestern Corn Borer (Lepidoptera: Crambidae) Q40670042 1 S. J. Baskauf https://doi.org/10.1603/0046-225X-30.2.181 2021-03-11
Q105899588 Evaluation of Low Temperature Mortality as a Range-limiting Factor for the Southwestern Corn Borer (Lepidoptera: Crambidae) Q74442060 2 D. E. McCauley https://doi.org/10.1603/0046-225X-30.2.181 2021-03-11