From 4038ab95a094b363f1748f3dcb51511a1217475d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 07:40:05 +0200 Subject: Adding upstream version 2.0.16. Signed-off-by: Daniel Baumann --- scripts/rdfcompare | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100755 scripts/rdfcompare (limited to 'scripts/rdfcompare') diff --git a/scripts/rdfcompare b/scripts/rdfcompare new file mode 100755 index 0000000..6430bf4 --- /dev/null +++ b/scripts/rdfcompare @@ -0,0 +1,55 @@ +#!/bin/sh +# +# Compare two RDF graphs +# +# Needs an external utility to do a true graph compare. +# + + +PROGRAM=`basename $0` + +CMP=cmp +DIFF=diff + +tmpdiff=/tmp/rdfcompare$$ + +if [ $# -lt 1 ] ; then + echo "$PROGRAM: compare two RDF graphs for isomorphism" 1>&2 + echo "USAGE: $PROGRAM RDF-FILE-1 RDF-FILE-2" 1>&2 + echo "where both files are RDF graphs serialized as N-Triples" 1>&2 + exit 0 +fi + +# Try a simple compare first +$CMP $1 $2 2>&1 +status=$? +if test $status -eq 0; then + exit 0 +fi + +echo "$program: Doing an RDF graph compare" 1>&2 + +if test "X$NTC" != X; then + $NTC $1 $2 > $tmpdiff 2>&1 + status=$? + if test $status != 0; then + $DIFF -u $1 $2 + fi +elif test "X$JENAROOT" != X; then + RDFCOMPARE="$JENAROOT/bin/rdfcompare" + + $RDFCOMPARE $1 $2 N-TRIPLE N-TRIPLE + status=$? + if test $status != 0; then + $DIFF -u $1 $2 + fi +else + $DIFF -u $1 $2 > $tmpdiff + status=$? + if test $status != 0; then + cat $tmpdiff + rm $tmpdiff + fi +fi + +exit $status -- cgit v1.2.3