summaryrefslogtreecommitdiff
path: root/foaf/rdf2turtle.sh
blob: 676cd254b09475b475a7c569ef640c3fff2f33bc (plain)
  1. #!/bin/sh
  2. set -e
  3. rdffile="$1"
  4. ttlfile="${2:-$(basename "$rdffile" .rdf).ttl}"
  5. exit1() {
  6. echo "ERROR: $1"
  7. exit 1
  8. }
  9. [ -e "$rdffile" ] || exit1 "RDF file \"$rdffile\" does not exist."
  10. [ ! -e "$ttlfile" ] || exit1 "Turtle file \"$ttlfile\" already exists."
  11. base="$(perl -ne '/\bxml:base="(http.+)"/ and print $1 and exit;' "$rdffile")" || true #'
  12. rapper -i rdfxml ${base:+-O "$base"} -o turtle "$rdffile" > "$ttlfile"
  13. perl -i -pe 's/ {4}/\t/g' "$ttlfile"
ead?h=master'>tags/e6/b0/20220630084037.C9CB6F95@xayide.jones.dk/unread0
-rw-r--r--tags/e6/b0/3D877FAE-7E3D-4939-9724-3D1E7F6A14DE@bassballs.dk/inbox0
-rw-r--r--tags/e6/b0/3D877FAE-7E3D-4939-9724-3D1E7F6A14DE@bassballs.dk/old0
-rw-r--r--tags/e6/b0/3D877FAE-7E3D-4939-9724-3D1E7F6A14DE@bassballs.dk/replied0
-rw-r--r--tags/e6/b0/4CD26C42.7040705@wiggy.net/spi0
-rw-r--r--tags/e6/b0/CAG+X+3geH9wW++FfsmxRw=_fOoBL=3SEwto_vMTM4ipEVW1z3w@mail.gmail.com/inbox0
-rw-r--r--tags/e6/b0/CAG+X+3geH9wW++FfsmxRw=_fOoBL=3SEwto_vMTM4ipEVW1z3w@mail.gmail.com/old0
13 files changed, 0 insertions, 0 deletions