Skip to content

Instantly share code, notes, and snippets.

View mbjones's full-sized avatar

Matt Jones mbjones

View GitHub Profile
@mbjones
mbjones / dataone-package-versions.md
Created May 8, 2025 00:01
dataone-package-versions.md
stateDiagram-v2
    direction LR
    [*] --> EML
    state EML {
        direction LR
        [*] --> A
        A --> B: obsoletedBy
        B --> C: obsoletedBy
 }
@mbjones
mbjones / git-reset.md
Last active May 1, 2025 07:04
git reset is my friend

git reset

I often mess up. Sometimes badly 🤯. git reset is my friend.

Here's the current state of the Metacat repo:

image

Imagine I commit a file to develop. When I look at the log, I see its gotten pretty messy, because the merge commit in main wasn't committed into develop. This makes for a messy tree.

DataONE Data Package Upload Example

Table of Contents

This is an example of how to upload content into a repository that implements the DataONE Tier 3 MNStorage API. We focus on a simple yet complete data package example that involves two CSV data files, one EML metadata file, and one OAI-ORE resource map file. This example is based on content in the following published dataset, but has some changes to simplify the example:

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mbjones
mbjones / knb-download-poc.R
Created October 26, 2023 23:42
KNB download CSV
library(dataone)
# Download a CSV-formatted data file from the KNB
# repository, and convert it to a data.frame
get_dataframe <- function(pid) {
d1c <- D1Client("PROD", "urn:node:KNB")
data_raw <- getObject(d1c@mn, pid)
data_char <- rawToChar(data_raw)
csv_text <- textConnection(data_char)
df <- read.csv(csv_text, stringsAsFactors = FALSE)
@mbjones
mbjones / abstractlengths.Rmd
Created October 12, 2021 00:27
Abstract lengths in DataONE
---
title: "abstracts"
author: "Matt Jones"
date: "10/11/2021"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(vroom)
@mbjones
mbjones / geopackage.Rmd
Created July 23, 2021 21:47
geopackage.Rmd
---
title: "geopackage"
author: "Matt Jones"
date: "7/23/2021"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
{
"@context": "https://doi.org/10.5063/schema/codemeta-2.0",
"@type": "SoftwareSourceCode",
"license": "https://spdx.org/licenses/Apache-2.0",
"codeRepository": "https://github.com/codemeta/codemeta",
"dateCreated": "2020-02-04",
"datePublished": "2020-02-05",
"downloadUrl": "https://codemeta.github.io/",
"name": "CodeMeta",
"description": "CodeMeta is a metadata language for code.",
@mbjones
mbjones / FAIR_metrics.Rmd
Last active May 10, 2019 01:12
Plotting FAIR metrics
---
title: "FAIR Metrics"
author: "Matt Jones"
date: "5/8/2019"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(dplyr)
@mbjones
mbjones / repo-split-example.sh
Last active January 23, 2018 06:34
split-repo-test
#!/bin/bash
WORKDIR=${PWD}
create_repos () {
rm -rf repo-split-example repo-split-recent repo-split-history
# Create the repo to be split
example_repo
# Create the repo to contain the historical commits
HISTREPO="file://${WORKDIR}/repo-split-history"