Skip to content

Instantly share code, notes, and snippets.

@datadavev
datadavev / getsitemaps.sh
Last active February 12, 2020 17:08
Shell script to retrieve sitemaps from a CN to a search instance, correcting URLs and preserving file timestamps.
#/bin/bash
# Retrieve and transform metacat generated sitemaps
#
# Requires wget, xmlstarlet
#
# Run with:
# sudo bash getsitemap.sh
#sitemap namespace
SM_NS="sm=http://www.sitemaps.org/schemas/sitemap/0.9"
#!/usr/bin/env python
"""
Login to DataONE using ORCID and retrieve token.
This script uses Selenium to control a Chrome web browser to log on to
DataONE using ORCID credentials.
Dependencies:
* Keyring: pip install keyring
@datadavev
datadavev / SO_test_rdflib_normalize.ipynb
Created August 4, 2020 13:26
Normalizing sschema.org http-https namespace rdflib
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@datadavev
datadavev / ordering_creators_sparql.ipynb
Last active October 21, 2024 18:40
Example of ordered vs. unordered in JSON-LD
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@datadavev
datadavev / bco-dmo-caching.ipynb
Created March 1, 2021 03:00
server caching and ld
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@datadavev
datadavev / bco-dmo-caching.ipynb
Created March 1, 2021 03:15
server caching and ld
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@datadavev
datadavev / https_schema_org_pyld.ipynb
Created March 30, 2021 13:07
Demonstrate forcing https for schema.org context
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"@context": {
"@vocab": "https://schema.org/",
"datacite": "http://purl.org/spar/datacite/"
},
"@id": "https://doi.org/10.4211/hs.8161a96a08474d12bba219852409be61",
"sameAs": "https://www.hydroshare.org/resource/8161a96a08474d12bba219852409be61",
"url": "https://doi.org/10.4211/hs.8161a96a08474d12bba219852409be61",
"@type": "Dataset",
"additionalType": "http://www.hydroshare.org/terms/CompositeResource",
{
"@context": {
"@vocab": "https://schema.org/",
"datacite": "http://purl.org/spar/datacite/"
},
"@id": "https://doi.org/10.4211/hs.8161a96a08474d12bba219852409be61",
"sameAs": "https://www.hydroshare.org/resource/8161a96a08474d12bba219852409be61",
"url": "https://doi.org/10.4211/hs.8161a96a08474d12bba219852409be61",
"@type": "Dataset",
"additionalType": "http://www.hydroshare.org/terms/CompositeResource",
[
{
"@id": "_:c14n0",
"@type": [
"https://schema.org/PropertyValue"
],
"https://schema.org/additionalType": [
{
"@value": "http://www.wikidata.org/entity/Q161779"
}