Skip to content

Instantly share code, notes, and snippets.

View pchampin's full-sized avatar

Pierre-Antoine Champin pchampin

View GitHub Profile
@pchampin
pchampin / rdfdiff.sh
Created September 13, 2024 09:54
RDF diff
#!/bin/bash
# usage: rdfdiff <file1> <file2> [git-diff options...]
# set base URI with the BASE environment variable, if necessary
# requires a "release" build of sophia examples 'parse' and 'canonicalize'
# in a clone of https://github.com/pchampin/sophia_rs
# indicated by SOPHIA_HOME (defaults to ~/dev/sophia_rs)
#
# To produce them, run
@pchampin
pchampin / gist:ad883b8d6a35ce4d52e5efe50645b353
Created March 26, 2025 10:28
script for canonicalizing RDF file
#!/usr/bin/bash
# dependency: https://github.com/pchampin/sophia-cli
sop parse "$1" --base x-dummy-base: ! canonicalize
# NB: we use a dummy base so that the result does not depend on the location of "$1".
# Indeed, I use this script primarily to re-process RDF files before git diff,
# so the different copies of the *same* files should not be considered to have different bases.
#
# Snippet from by ~/.gitconfig file