#!/bin/bash if [ $# -ne 2 ] ; then echo "Usage: $0 collect-name ttl-file" >&2 exit 1 fi graph_name=$1 # triplestore server setup to also add to 'default' graph automatically file_ttl=$2 port=${FUSEKI3_PORT:-8383} if [ "x$FULL_GREENSTONE_URL_PREFIX" != "x" ] ; then graph_uri="$FULL_GREENSTONE_URL_PREFIX/collection/$graph_name" else graph_uri="http://localhost:$port/greenstone3/library/collection/$graph_name" fi ## The following line helps with runing a she-bang line of: ## '#!/usr/bin/env ruby' ## when the current script has been run from Perl under Cygwin ## #export PATH=/usr/bin:$PATH #echo s-post http://localhost:$port/fuseki3/greenstone/data "$graph_uri" "$file_ttl" #s-post http://localhost:$port/fuseki3/greenstone/data "$graph_uri" "$file_ttl" echo " " curl POST: http://localhost:$port/fuseki3/greenstone/data?graph="$graph_uri" "$file_ttl" curl --silent -X POST \ -F "filename=@$file_ttl" \ "http://localhost:$port/fuseki3/greenstone/data?graph=$graph_uri" 1>/dev/null # -H 'text/turtle;charset=utf-8' \