Skip to content

Instantly share code, notes, and snippets.

@ewg118
Last active September 24, 2021 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ewg118/6098a82032154a48914210e8782e814c to your computer and use it in GitHub Desktop.
Save ewg118/6098a82032154a48914210e8782e814c to your computer and use it in GitHub Desktop.
OpenRefine Nomisma RDF template with IIIF services (Getty example)
<nmo:NumismaticObject rdf:about="{{cells['URI'].value}}">
<dcterms:title xml:lang="en">{{cells["name"].value}}</dcterms:title>
<dcterms:identifier>{{cells["accession"].value}}</dcterms:identifier>
<nmo:hasCollection rdf:resource="http://nomisma.org/id/getty_museum"/>
<nmo:hasTypeSeriesItem rdf:resource="{{cells["Type URI"].value}}"/>
{{forNonBlank(cells["weight"], c, '<nmo:hasWeight rdf:datatype="http://www.w3.org/2001/XMLSchema#decimal">' + c.value + '</nmo:hasWeight>', "")}}
{{forNonBlank(cells["Obverse IIIF Service"], c, '<nmo:hasObverse>\n\t\t<rdf:Description>\n\t\t\t<foaf:thumbnail rdf:resource="' + c.value + '/full/,120/0/native.jpg"/>\n\t\t\t<foaf:depiction rdf:resource="' + c.value + '/full/600,/0/native.jpg"/>\n\t\t</rdf:Description>\n\t</nmo:hasObverse>', "")}}
{{forNonBlank(cells["Reverse IIIF Service"], c, '<nmo:hasReverse>\n\t\t<rdf:Description>\n\t\t\t<foaf:thumbnail rdf:resource="' + c.value + '/full/,120/0/native.jpg"/>\n\t\t\t<foaf:depiction rdf:resource="' + c.value + '/full/600,/0/native.jpg"/>\n\t\t</rdf:Description>\n\t</nmo:hasReverse>', "")}}
<void:inDataset rdf:resource="http://www.getty.edu/museum/"/>
</nmo:NumismaticObject>
{{forNonBlank(cells["Obverse IIIF Service"], c, '<edm:WebResource rdf:about="' + c.value + '/full/600,/0/native.jpg">\n\t\t<svcs:has_service rdf:resource="' + c.value + '"/>\n\t\t<dcterms:isReferencedBy rdf:resource="' + c.value + '/info.json"/>\n\t</edm:WebResource>', "")}}
{{forNonBlank(cells["Obverse IIIF Service"], c, '<svcs:Service rdf:about="' + c.value + '">\n\t\t<dcterms:conformsTo rdf:resource="http://iiif.io/api/image"/>\n\t\t<doap:implements rdf:resource="http://iiif.io/api/image/2/level1.json"/>\n\t</svcs:Service>', "")}}
{{forNonBlank(cells["Reverse IIIF Service"], c, '<edm:WebResource rdf:about="' + c.value + '/full/600,/0/native.jpg">\n\t\t<svcs:has_service rdf:resource="' + c.value + '"/>\n\t\t<dcterms:isReferencedBy rdf:resource="' + c.value + '/info.json"/>\n\t</edm:WebResource>', "")}}
{{forNonBlank(cells["Reverse IIIF Service"], c, '<svcs:Service rdf:about="' + c.value + '">\n\t\t<dcterms:conformsTo rdf:resource="http://iiif.io/api/image"/>\n\t\t<doap:implements rdf:resource="http://iiif.io/api/image/2/level1.json"/>\n\t</svcs:Service>', "")}}
@ewg118
Copy link
Author

ewg118 commented Apr 2, 2021

Prefix:

<?xml version="1.0" encoding="UTF-8"?>\n<rdf:RDF xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xmlns:nm="http://nomisma.org/id/" xmlns:nmo="http://nomisma.org/ontology#" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:void="http://rdfs.org/ns/void#" xmlns:edm="http://www.europeana.eu/schemas/edm/" xmlns:svcs="http://rdfs.org/sioc/services#" xmlns:doap="http://usefulinc.com/ns/doap#">

Suffix:

</rdf:RDF>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment