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

anno.ttl syntax errors #2

Closed
KonradHoeffner opened this issue Nov 27, 2023 · 1 comment
Closed

anno.ttl syntax errors #2

KonradHoeffner opened this issue Nov 27, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@KonradHoeffner
Copy link
Contributor

KonradHoeffner commented Nov 27, 2023

$ wget https://github.com/annosaxfdm/ontology/releases/latest/download/anno.ttl
...
$ rapper -i turtle -c anno.ttl
rapper: Parsing URI file:///home/konrad/projekte/rust/rickview/anno.ttl with parser turtle
rapper: Error - URI file:///home/konrad/projekte/rust/rickview/anno.ttl:17407 - syntax error, unexpected ., expecting a or URI literal or QName
rapper: Failed to parse file anno.ttl turtle content
rapper: Parsing returned 22890 triples

anno.ttl in the release is automatically generated by build.yml.
Also happens locally:

ontology$ scripts/combine
rapper: Parsing URI file:///home/konrad/projekte/anno/ontology/annodc.owl with parser rdfxml
rapper: Serializing with serializer ntriples
rapper: Parsing returned 267 triples
rapper: Parsing URI file:///home/konrad/projekte/anno/ontology/annods.owl with parser rdfxml
rapper: Serializing with serializer ntriples
rapper: Parsing returned 29667 triples
rapper: Parsing URI file:///tmp/anno.ttl with parser turtle
rapper: Serializing with serializer turtle
rapper: Parsing returned 29934 triples
ontology$ rapper -i turtle -c dist/anno.ttl
rapper: Parsing URI file:///home/konrad/projekte/anno/ontology/dist/anno.ttl with parser turtle
rapper: Error - URI file:///home/konrad/projekte/anno/ontology/dist/anno.ttl:17407 - syntax error, unexpected ., expecting a or URI literal or QName
rapper: Failed to parse file dist/anno.ttl turtle content
rapper: Parsing returned 22890 triples

The culprit are those entries:

(:Bone
    :BoneCompound
    :BonePart
) .

The strange thing is that anno.ttl is generated by the very same rapper tool that fails to parse its own output:

#!/bin/sh
# Combine annodc.owl and annods.owl and convert it to anno.ttl.
SCRIPT_PATH=`dirname "$0"`
ROOT=`( cd "$SCRIPT_PATH/.." && pwd )`
DIST=$ROOT/dist
mkdir -p $ROOT/dist
rapper -i rdfxml $ROOT/annodc.owl -o ntriples > /tmp/annodc.nt
rapper -i rdfxml $ROOT/annods.owl -o ntriples > /tmp/annods.nt
# workaround for spaces in URIs
cat $SCRIPT_PATH/prefix.ttl /tmp/annodc.nt /tmp/annods.nt \
| sed  "s/\\\u0020/%20/g" \
> /tmp/anno.ttl
# resulting file is valid turtle but does not use prefixes yet
# reconvert to apply prefixes
rapper -i turtle -o turtle /tmp/anno.ttl > $DIST/anno.ttl
@KonradHoeffner KonradHoeffner added the bug Something isn't working label Nov 27, 2023
@KonradHoeffner KonradHoeffner self-assigned this Nov 27, 2023
@KonradHoeffner
Copy link
Contributor Author

See also dajobe/raptor#64.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant