Created
March 26, 2025 10:28
-
-
Save pchampin/ad883b8d6a35ce4d52e5efe50645b353 to your computer and use it in GitHub Desktop.
script for canonicalizing RDF file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 | |
# ``` | |
# [diff "rdf"] | |
# textconf = rdf-canon | |
# ``` | |
# where `rdf-canon` is this script, made executable and accessible in the PATH. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment