Discussion:
Parsing from stdin breaks in 3.9.0
Martynas Jusevičius
2018-11-22 20:20:36 UTC
Permalink
Hi,

I have such a simple Turtle file called kaunas.ttl:

./create-container.sh \
-b https://linkeddatahub.com:4443/demo/city-graph/ \
-f "cert.pem" \
-p "test1234" \
--title "Kaunas" \
--slug "kaunas" \
https://linkeddatahub.com:4443/demo/city-graph/

It parses from command line using 3.6.0:

***@LAPTOP-BL3MCU0O:/mnt/c/Users/pumba/WebRoot/AtomGraph/LinkedDataHub/scripts$
export JENA_HOME="/mnt/c/Users/pumba/WebRoot/apache-jena-3.6.0"
***@LAPTOP-BL3MCU0O:/mnt/c/Users/pumba/WebRoot/AtomGraph/LinkedDataHub/scripts$
cat kaunas.ttl | turtle
--base="https://linkeddatahub.com:4443/demo/city-graph/"
_:Be9c8204f16652e5daab8df47ee02facf
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
<https://linkeddatahub.com:4443/demo/city-graph/ns/default#Container>
.
_:Be9c8204f16652e5daab8df47ee02facf <http://purl.org/dc/terms/title> "Kaunas" .
_:Be9c8204f16652e5daab8df47ee02facf
<https://www.w3.org/ns/ldt/document-hierarchy/domain#slug> "kaunas" .

But fails using 3.9.0:

***@LAPTOP-BL3MCU0O:/mnt/c/Users/pumba/WebRoot/AtomGraph/LinkedDataHub/scripts$
export JENA_HOME="/mnt/c/Users/pumba/WebRoot/apache-jena-3.9.0"
***@LAPTOP-BL3MCU0O:/mnt/c/Users/pumba/WebRoot/AtomGraph/LinkedDataHub/scripts$
cat kaunas.ttl | turtle
--base="https://linkeddatahub.com:4443/demo/city-graph/"
20:16:32 ERROR riot :: [line: 1, col: 1 ] Expected
BNode or IRI: Got: [DIRECTIVE:prefix]
***@LAPTOP-BL3MCU0O:/mnt/c/Users/pumba/WebRoot/AtomGraph/LinkedDataHub/scripts$

What is happening here? Can't use 3.9.0 as all our CLI scripts would break.

Even stranger that passing the file as an argument and not a stream
works on both versions:

turtle --base="https://linkeddatahub.com:4443/demo/city-graph/" kaunas.ttl

The system is Ubuntu 16.04.3 LTS (Windows Subsystem for Linux).

Martynas
atomgraph.com
Martynas Jusevičius
2018-11-22 20:22:56 UTC
Permalink
Sorry, this is the correct Turtle file:

@prefix def: <ns/default#> .
@prefix dct: <http://purl.org/dc/terms/> .
@prefix dh: <https://www.w3.org/ns/ldt/document-hierarchy/domain#> .
_:container a def:Container .
_:container dct:title "Kaunas" .
_:container dh:slug "kaunas" .
On Thu, Nov 22, 2018 at 9:20 PM Martynas Jusevičius
Post by Martynas Jusevičius
Hi,
./create-container.sh \
-b https://linkeddatahub.com:4443/demo/city-graph/ \
-f "cert.pem" \
-p "test1234" \
--title "Kaunas" \
--slug "kaunas" \
https://linkeddatahub.com:4443/demo/city-graph/
export JENA_HOME="/mnt/c/Users/pumba/WebRoot/apache-jena-3.6.0"
cat kaunas.ttl | turtle
--base="https://linkeddatahub.com:4443/demo/city-graph/"
_:Be9c8204f16652e5daab8df47ee02facf
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
<https://linkeddatahub.com:4443/demo/city-graph/ns/default#Container>
.
_:Be9c8204f16652e5daab8df47ee02facf <http://purl.org/dc/terms/title> "Kaunas" .
_:Be9c8204f16652e5daab8df47ee02facf
<https://www.w3.org/ns/ldt/document-hierarchy/domain#slug> "kaunas" .
export JENA_HOME="/mnt/c/Users/pumba/WebRoot/apache-jena-3.9.0"
cat kaunas.ttl | turtle
--base="https://linkeddatahub.com:4443/demo/city-graph/"
20:16:32 ERROR riot :: [line: 1, col: 1 ] Expected
BNode or IRI: Got: [DIRECTIVE:prefix]
What is happening here? Can't use 3.9.0 as all our CLI scripts would break.
Even stranger that passing the file as an argument and not a stream
turtle --base="https://linkeddatahub.com:4443/demo/city-graph/" kaunas.ttl
The system is Ubuntu 16.04.3 LTS (Windows Subsystem for Linux).
Martynas
atomgraph.com
Andy Seaborne
2018-11-22 21:55:33 UTC
Permalink
Post by Martynas Jusevičius
Post by Martynas Jusevičius
What is happening here? Can't use 3.9.0 as all our CLI scripts would break.
You can use "riot --syntax ttl"

Andy
Post by Martynas Jusevičius
@prefix def: <ns/default#> .
@prefix dct: <http://purl.org/dc/terms/> .
@prefix dh: <https://www.w3.org/ns/ldt/document-hierarchy/domain#> .
_:container a def:Container .
_:container dct:title "Kaunas" .
_:container dh:slug "kaunas" .
On Thu, Nov 22, 2018 at 9:20 PM Martynas Jusevičius
Post by Martynas Jusevičius
Hi,
./create-container.sh \
-b https://linkeddatahub.com:4443/demo/city-graph/ \
-f "cert.pem" \
-p "test1234" \
--title "Kaunas" \
--slug "kaunas" \
https://linkeddatahub.com:4443/demo/city-graph/
export JENA_HOME="/mnt/c/Users/pumba/WebRoot/apache-jena-3.6.0"
cat kaunas.ttl | turtle
--base="https://linkeddatahub.com:4443/demo/city-graph/"
_:Be9c8204f16652e5daab8df47ee02facf
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
<https://linkeddatahub.com:4443/demo/city-graph/ns/default#Container>
.
_:Be9c8204f16652e5daab8df47ee02facf <http://purl.org/dc/terms/title> "Kaunas" .
_:Be9c8204f16652e5daab8df47ee02facf
<https://www.w3.org/ns/ldt/document-hierarchy/domain#slug> "kaunas" .
export JENA_HOME="/mnt/c/Users/pumba/WebRoot/apache-jena-3.9.0"
cat kaunas.ttl | turtle
--base="https://linkeddatahub.com:4443/demo/city-graph/"
20:16:32 ERROR riot :: [line: 1, col: 1 ] Expected
BNode or IRI: Got: [DIRECTIVE:prefix]
What is happening here? Can't use 3.9.0 as all our CLI scripts would break.
Even stranger that passing the file as an argument and not a stream
turtle --base="https://linkeddatahub.com:4443/demo/city-graph/" kaunas.ttl
The system is Ubuntu 16.04.3 LTS (Windows Subsystem for Linux).
Martynas
atomgraph.com
Martynas Jusevičius
2018-11-22 21:58:11 UTC
Permalink
cat kaunas.ttl | riot --syntax ttl
--base="https://linkeddatahub.com:4443/demo/city-graph/"

That worked. trig etc. scripts are broken re. stdin input though.
Post by Martynas Jusevičius
Post by Martynas Jusevičius
Post by Martynas Jusevičius
What is happening here? Can't use 3.9.0 as all our CLI scripts would
break.
You can use "riot --syntax ttl"
Andy
Post by Martynas Jusevičius
@prefix def: <ns/default#> .
@prefix dct: <http://purl.org/dc/terms/> .
@prefix dh: <https://www.w3.org/ns/ldt/document-hierarchy/domain#> .
_:container a def:Container .
_:container dct:title "Kaunas" .
_:container dh:slug "kaunas" .
On Thu, Nov 22, 2018 at 9:20 PM Martynas Jusevičius
Post by Martynas Jusevičius
Hi,
./create-container.sh \
-b https://linkeddatahub.com:4443/demo/city-graph/ \
-f "cert.pem" \
-p "test1234" \
--title "Kaunas" \
--slug "kaunas" \
https://linkeddatahub.com:4443/demo/city-graph/
export JENA_HOME="/mnt/c/Users/pumba/WebRoot/apache-jena-3.6.0"
cat kaunas.ttl | turtle
--base="https://linkeddatahub.com:4443/demo/city-graph/"
_:Be9c8204f16652e5daab8df47ee02facf
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
<https://linkeddatahub.com:4443/demo/city-graph/ns/default#Container>
.
_:Be9c8204f16652e5daab8df47ee02facf <http://purl.org/dc/terms/title> "Kaunas" .
_:Be9c8204f16652e5daab8df47ee02facf
<https://www.w3.org/ns/ldt/document-hierarchy/domain#slug> "kaunas" .
export JENA_HOME="/mnt/c/Users/pumba/WebRoot/apache-jena-3.9.0"
cat kaunas.ttl | turtle
--base="https://linkeddatahub.com:4443/demo/city-graph/"
20:16:32 ERROR riot :: [line: 1, col: 1 ] Expected
BNode or IRI: Got: [DIRECTIVE:prefix]
What is happening here? Can't use 3.9.0 as all our CLI scripts would break.
Even stranger that passing the file as an argument and not a stream
turtle --base="https://linkeddatahub.com:4443/demo/city-graph/" kaunas.ttl
The system is Ubuntu 16.04.3 LTS (Windows Subsystem for Linux).
Martynas
atomgraph.com
Andy Seaborne
2018-11-22 22:05:22 UTC
Permalink
Sure - same issue. "riot --syntax trix". The issue is in "riot", the
superclass of turtle, trix etc.

But why not

riot kaunas.ttl

?

Andy
Post by Martynas Jusevičius
cat kaunas.ttl | riot --syntax ttl
--base="https://linkeddatahub.com:4443/demo/city-graph/"
That worked. trig etc. scripts are broken re. stdin input though.
Post by Martynas Jusevičius
Post by Martynas Jusevičius
Post by Martynas Jusevičius
What is happening here? Can't use 3.9.0 as all our CLI scripts would
break.
You can use "riot --syntax ttl"
Andy
Post by Martynas Jusevičius
@prefix def: <ns/default#> .
@prefix dct: <http://purl.org/dc/terms/> .
@prefix dh: <https://www.w3.org/ns/ldt/document-hierarchy/domain#> .
_:container a def:Container .
_:container dct:title "Kaunas" .
_:container dh:slug "kaunas" .
On Thu, Nov 22, 2018 at 9:20 PM Martynas Jusevičius
Post by Martynas Jusevičius
Hi,
./create-container.sh \
-b https://linkeddatahub.com:4443/demo/city-graph/ \
-f "cert.pem" \
-p "test1234" \
--title "Kaunas" \
--slug "kaunas" \
https://linkeddatahub.com:4443/demo/city-graph/
export JENA_HOME="/mnt/c/Users/pumba/WebRoot/apache-jena-3.6.0"
cat kaunas.ttl | turtle
--base="https://linkeddatahub.com:4443/demo/city-graph/"
_:Be9c8204f16652e5daab8df47ee02facf
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
<https://linkeddatahub.com:4443/demo/city-graph/ns/default#Container>
.
_:Be9c8204f16652e5daab8df47ee02facf <http://purl.org/dc/terms/title> "Kaunas" .
_:Be9c8204f16652e5daab8df47ee02facf
<https://www.w3.org/ns/ldt/document-hierarchy/domain#slug> "kaunas" .
export JENA_HOME="/mnt/c/Users/pumba/WebRoot/apache-jena-3.9.0"
cat kaunas.ttl | turtle
--base="https://linkeddatahub.com:4443/demo/city-graph/"
20:16:32 ERROR riot :: [line: 1, col: 1 ] Expected
BNode or IRI: Got: [DIRECTIVE:prefix]
What is happening here? Can't use 3.9.0 as all our CLI scripts would break.
Even stranger that passing the file as an argument and not a stream
turtle --base="https://linkeddatahub.com:4443/demo/city-graph/" kaunas.ttl
The system is Ubuntu 16.04.3 LTS (Windows Subsystem for Linux).
Martynas
atomgraph.com
Martynas Jusevičius
2018-11-22 22:08:29 UTC
Permalink
I can change our CLI scripts, not a problem.

But my question is, if the per-syntax scripts still exist in 3.9.0,
why are they not parsing from stdin (anymore)? Makes no sense like
this. I would say it's a bug :)
Post by Andy Seaborne
Sure - same issue. "riot --syntax trix". The issue is in "riot", the
superclass of turtle, trix etc.
But why not
riot kaunas.ttl
?
Andy
Post by Martynas Jusevičius
cat kaunas.ttl | riot --syntax ttl
--base="https://linkeddatahub.com:4443/demo/city-graph/"
That worked. trig etc. scripts are broken re. stdin input though.
Post by Martynas Jusevičius
Post by Martynas Jusevičius
Post by Martynas Jusevičius
What is happening here? Can't use 3.9.0 as all our CLI scripts would
break.
You can use "riot --syntax ttl"
Andy
Post by Martynas Jusevičius
@prefix def: <ns/default#> .
@prefix dct: <http://purl.org/dc/terms/> .
@prefix dh: <https://www.w3.org/ns/ldt/document-hierarchy/domain#> .
_:container a def:Container .
_:container dct:title "Kaunas" .
_:container dh:slug "kaunas" .
On Thu, Nov 22, 2018 at 9:20 PM Martynas Jusevičius
Post by Martynas Jusevičius
Hi,
./create-container.sh \
-b https://linkeddatahub.com:4443/demo/city-graph/ \
-f "cert.pem" \
-p "test1234" \
--title "Kaunas" \
--slug "kaunas" \
https://linkeddatahub.com:4443/demo/city-graph/
export JENA_HOME="/mnt/c/Users/pumba/WebRoot/apache-jena-3.6.0"
cat kaunas.ttl | turtle
--base="https://linkeddatahub.com:4443/demo/city-graph/"
_:Be9c8204f16652e5daab8df47ee02facf
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
<https://linkeddatahub.com:4443/demo/city-graph/ns/default#Container>
.
_:Be9c8204f16652e5daab8df47ee02facf <http://purl.org/dc/terms/title> "Kaunas" .
_:Be9c8204f16652e5daab8df47ee02facf
<https://www.w3.org/ns/ldt/document-hierarchy/domain#slug> "kaunas" .
export JENA_HOME="/mnt/c/Users/pumba/WebRoot/apache-jena-3.9.0"
cat kaunas.ttl | turtle
--base="https://linkeddatahub.com:4443/demo/city-graph/"
20:16:32 ERROR riot :: [line: 1, col: 1 ] Expected
BNode or IRI: Got: [DIRECTIVE:prefix]
What is happening here? Can't use 3.9.0 as all our CLI scripts would break.
Even stranger that passing the file as an argument and not a stream
turtle --base="https://linkeddatahub.com:4443/demo/city-graph/" kaunas.ttl
The system is Ubuntu 16.04.3 LTS (Windows Subsystem for Linux).
Martynas
atomgraph.com
Andy Seaborne
2018-11-22 22:10:46 UTC
Permalink
Post by Martynas Jusevičius
I can change our CLI scripts, not a problem.
But my question is, if the per-syntax scripts still exist in 3.9.0,
why are they not parsing from stdin (anymore)? Makes no sense like
this. I would say it's a bug :)
Sure.

Send a PR.

Andy
Post by Martynas Jusevičius
Post by Andy Seaborne
Sure - same issue. "riot --syntax trix". The issue is in "riot", the
superclass of turtle, trix etc.
But why not
riot kaunas.ttl
?
Andy
Post by Martynas Jusevičius
cat kaunas.ttl | riot --syntax ttl
--base="https://linkeddatahub.com:4443/demo/city-graph/"
That worked. trig etc. scripts are broken re. stdin input though.
Post by Martynas Jusevičius
Post by Martynas Jusevičius
Post by Martynas Jusevičius
What is happening here? Can't use 3.9.0 as all our CLI scripts would
break.
You can use "riot --syntax ttl"
Andy
Post by Martynas Jusevičius
@prefix def: <ns/default#> .
@prefix dct: <http://purl.org/dc/terms/> .
@prefix dh: <https://www.w3.org/ns/ldt/document-hierarchy/domain#> .
_:container a def:Container .
_:container dct:title "Kaunas" .
_:container dh:slug "kaunas" .
On Thu, Nov 22, 2018 at 9:20 PM Martynas Jusevičius
Post by Martynas Jusevičius
Hi,
./create-container.sh \
-b https://linkeddatahub.com:4443/demo/city-graph/ \
-f "cert.pem" \
-p "test1234" \
--title "Kaunas" \
--slug "kaunas" \
https://linkeddatahub.com:4443/demo/city-graph/
export JENA_HOME="/mnt/c/Users/pumba/WebRoot/apache-jena-3.6.0"
cat kaunas.ttl | turtle
--base="https://linkeddatahub.com:4443/demo/city-graph/"
_:Be9c8204f16652e5daab8df47ee02facf
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
<https://linkeddatahub.com:4443/demo/city-graph/ns/default#Container>
.
_:Be9c8204f16652e5daab8df47ee02facf <http://purl.org/dc/terms/title> "Kaunas" .
_:Be9c8204f16652e5daab8df47ee02facf
<https://www.w3.org/ns/ldt/document-hierarchy/domain#slug> "kaunas" .
export JENA_HOME="/mnt/c/Users/pumba/WebRoot/apache-jena-3.9.0"
cat kaunas.ttl | turtle
--base="https://linkeddatahub.com:4443/demo/city-graph/"
20:16:32 ERROR riot :: [line: 1, col: 1 ] Expected
BNode or IRI: Got: [DIRECTIVE:prefix]
What is happening here? Can't use 3.9.0 as all our CLI scripts would break.
Even stranger that passing the file as an argument and not a stream
turtle --base="https://linkeddatahub.com:4443/demo/city-graph/" kaunas.ttl
The system is Ubuntu 16.04.3 LTS (Windows Subsystem for Linux).
Martynas
atomgraph.com
Loading...