Skip to content

Instantly share code, notes, and snippets.

View ashepherd's full-sized avatar

Adam Shepherd ashepherd

View GitHub Profile
@ashepherd
ashepherd / convert.py
Created March 6, 2023 22:01
Use RDFLib to convert triples to quads
import rdflib
cg = rdflib.ConjunctiveGraph()
g = rdflib.Graph(cg.store, 'urn:bcodmo:dataset:3300')
g.parse('https://www.bco-dmo.org/node/3300/rdf/xml', format='xml')
serialization = cg.serialize(format='nquads')
print(serialization)
@ashepherd
ashepherd / install-docker.md
Created November 21, 2020 02:05 — forked from npearce/install-docker.md
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
@ashepherd
ashepherd / nanopub.jsonld
Created October 23, 2019 11:01
Nanopublication: Dataset Metadata submitted by an email from a PI to BCO-DMO
{
"@context": {
"bcodmo": "http://lod.bco-dmo.org/id/",
"odo": "http://ocean-data.org/schema/",
"np": "http://www.nanopub.org/nschema#",
"prov": "http://www.w3.org/ns/prov#",
"xsd": "http://www.w3.org/2001/XMLSchema#"
},
"@set":[
{
{
"@context":{
"@vocab": "http://schema.org/",
"schema": "http://schema.org/",
"time": "http://www.w3.org/2006/time#"
},
"@graph":[
{
"@id": "time:TemporalEntity"
},
@prefix : <http://data.example.org/id/dataset/1234/v1/> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix provone: <http://purl.dataone.org/provone/2015/01/15/ontology#> .
@prefix schema: <http://schema.org/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2000/10/XMLSchema#> .
@prefix : <http://data.example.org/id/dataset/1234/v1/> .
{
"profile": "data-package",
"hash": "6ff68c0d91b13546191daa9e59eb7b87",
"name": "bariumvub_mulvfs",
"title": "Barium VUB - Dissolved Ba; particulate Ba, Sr, Ca, Al from MULVFS from VERTIGO cruises KM0414, ZHNG09RR from the Hawaiian Islands HOT Site, NW SubArctic Pacific Ocean K2 Site, 2004-2005 (VERTIGO project)",
"bytes": 7008,
"sources'": [
{
"path": "https://www.bco-dmo.org/dataset/2953",
"title": "BCO-DMO"
{
"@context": {
"@vocab": "http://schema.org/",
"datacite": "http://purl.org/spar/datacite/",
"BuildPackageAction": { "@id": "Action" },
"SubmitForBuildPackageAction": { "@id": "Action" }
},
"@type": "SubmitForBuildPackageAction",
"actionStatus": "CompletedActionStatus",
"agent" : {
{
"@context": {
"@vocab": "http://schema.org",
"gtime": "http://sweetontology.net/stateTime/"
},
"@type": "Dataset",
"name": "test",
"about": [
{
"@type": "PropertyValue",
@ashepherd
ashepherd / README.md
Created November 17, 2017 20:17 — forked from anonymous/README.md
JSON-LD Playground: schema:GeoShape JSON-LD Frame

schema:GeoShape JSON-LD Frame

This gist was automatically created by the JSON-LD Playground. You can see it loaded there by visiting:

http://json-ld.org/playground#/gist/<gist id>