From 977aa3dfda0d1773f0e35b5d934acd8bf75e06ca Mon Sep 17 00:00:00 2001 From: Naomi Dushay Date: Mon, 31 Aug 2015 15:53:16 -0700 Subject: [PATCH 1/2] convert-saxon.sh: add usebnodes=false argument to command --- bin/convert-saxon.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bin/convert-saxon.sh b/bin/convert-saxon.sh index 546cd3d..e24a8c5 100755 --- a/bin/convert-saxon.sh +++ b/bin/convert-saxon.sh @@ -15,7 +15,7 @@ function die { exit 1 } function valid_serialization { - case $1 in + case $1 in rdfxml) return 0 ;; rdfxml-raw) return 0 ;; ntriples) return 0 ;; @@ -24,7 +24,7 @@ function valid_serialization { esac return 1 } - + while getopts "s:u:j:" arg; do case $arg in @@ -37,7 +37,7 @@ done shift $((OPTIND-1)) -if [ $# -ne 2 ]; then +if [ $# -ne 2 ]; then usage fi @@ -46,6 +46,8 @@ fi valid_serialization $SERIALIZATION || die "Invalid serialization: $SERIALIZATION" +BN_ARG='usebnodes=false' + # Note - saxon Xquery changes to xbin sub-directory, so we make all paths absolute # readlink also validates the paths @@ -58,5 +60,5 @@ OUTPUT=`readlink -f $2` # Okay - run the conversion -java -cp $SAXON_JAR net.sf.saxon.Query $MYDIR/../xbin/saxon.xqy marcxmluri="$MARCPATH" baseuri="$BASEURI" serialization="$SERIALIZATION" 1>$OUTPUT +java -cp $SAXON_JAR net.sf.saxon.Query $MYDIR/../xbin/saxon.xqy marcxmluri="$MARCPATH" baseuri="$BASEURI" serialization="$SERIALIZATION" $BN_ARG 1>$OUTPUT From 20f0eda10049bf9ca488e132ad0db1056dc34b0f Mon Sep 17 00:00:00 2001 From: Naomi Dushay Date: Mon, 31 Aug 2015 15:54:17 -0700 Subject: [PATCH 2/2] convert-saxon.sh: comment out readlink calls as this utility isn't always avail (or may not have -e and -f options) --- bin/convert-saxon.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/convert-saxon.sh b/bin/convert-saxon.sh index e24a8c5..eef166b 100755 --- a/bin/convert-saxon.sh +++ b/bin/convert-saxon.sh @@ -51,10 +51,12 @@ BN_ARG='usebnodes=false' # Note - saxon Xquery changes to xbin sub-directory, so we make all paths absolute # readlink also validates the paths -MARCPATH=`readlink -e $1` +#MARCPATH=`readlink -e $1` +MARCPATH=$1 [[ -n "$MARCPATH" ]] || die "marcxml-input-path '$1' must exist" -OUTPUT=`readlink -f $2` +#OUTPUT=`readlink -f $2` +OUTPUT=$2 [[ -n "$OUTPUT" ]] || die "output-path '$2' all directory components must exist"