Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turtle serialisation in precommit #51

Merged
merged 5 commits into from
May 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions etc/git-hook/pre-commit
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -117,18 +117,22 @@ function serialize() {
local file="$1"
if [ -f "$file" ] ; then
local extension="${file##*.}"
local target_format="rdf-xml"
if [ -d "$TEMP" ] ; then
local logcfg="$TEMP/sesame-serializer-log"
else
if [ -d "/tmp/" ] ; then
local logcfg="/tmp/sesame-serializer-log"
fi
fi



case ${extension} in
rdf)
target_format="rdf-xml"
;;
ttl)
target_format="turtle"
;;
*)
log "Skipping unsupported file $file"
return 0
Expand Down Expand Up @@ -168,7 +172,7 @@ __log_config__
"${java_exe}" -Xmx1g "-Dorg.clapper.avsl.config=${logcfg}" -cp "${RDF_TOOLKIT_JAR}" org.edmcouncil.rdf_toolkit.RdfFormatter \
--source "${file}" \
--target "${file}X" \
--target-format rdf-xml \
--target-format ${target_format} \
--use-dtd-subset \
--inline-blank-nodes \
--infer-base-iri
Expand Down
10 changes: 7 additions & 3 deletions etc/git-hook/serialize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,18 +126,22 @@ function serialize() {
local file="$1"
if [ -f "$file" ] ; then
local extension="${file##*.}"
local target_format="rdf-xml"
if [ -d "$TEMP" ] ; then
local logcfg="$TEMP/sesame-serializer-log"
else
if [ -d "/tmp/" ] ; then
local logcfg="/tmp/sesame-serializer-log"
fi
fi



case ${extension} in
rdf)
target_format="rdf-xml"
;;
ttl)
target_format="turtle"
;;
*)
log "Skipping unsupported file $file"
return 0
Expand Down Expand Up @@ -177,7 +181,7 @@ __log_config__
"${java_exe}" -Xmx1g "-Dorg.clapper.avsl.config=${logcfg}" -cp "${RDF_TOOLKIT_JAR}" org.edmcouncil.rdf_toolkit.RdfFormatter \
--source "${file}" \
--target "${file}" \
--target-format rdf-xml \
--target-format ${target_format} \
--use-dtd-subset -ibn -ibu \
-sdt implicit
rc=$?
Expand Down