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

Can't parse Turtle (TTL) boolean values followed by a spacebar #393

Open
joepio opened this issue Feb 23, 2022 · 3 comments
Open

Can't parse Turtle (TTL) boolean values followed by a spacebar #393

joepio opened this issue Feb 23, 2022 · 3 comments

Comments

@joepio
Copy link

joepio commented Feb 23, 2022

Hi! just noticed a parsing issue.

go to https://www.easyrdf.org/converter

Try this:

@prefix dc: <http://purl.org/dc/terms/> .
@prefix dcat: <http://www.w3.org/ns/dcat#> .
@prefix dex: <https://dexpods.eu/ns/core#> .

<https://daan.staging.dexpods.eu/distributions/14> a <https://daan.staging.dexpods.eu/distributions/14>;
  dc:title true;
  dex:offer <https://daan.staging.dexpods.eu/offers/62160576efe0e3622296210e> .
Error! Turtle Parse Error: expected '.', found 'd' on line 7, column 4

However, ending with a . instead of ; works just fine:

@prefix dc: <http://purl.org/dc/terms/> .
@prefix dcat: <http://www.w3.org/ns/dcat#> .
@prefix dex: <https://dexpods.eu/ns/core#> .

<https://daan.staging.dexpods.eu/distributions/14> a <https://daan.staging.dexpods.eu/distributions/14>;
  dc:title true .
@joepio joepio changed the title Can' Can't parse Turtle (TTL) boolean values Feb 23, 2022
@zozlak
Copy link
Collaborator

zozlak commented Feb 23, 2022

It's not a dot versus semicolon but lack of space. Check:

@prefix dc: <http://purl.org/dc/terms/> .
@prefix dcat: <http://www.w3.org/ns/dcat#> .
@prefix dex: <https://dexpods.eu/ns/core#> .

<https://daan.staging.dexpods.eu/distributions/14> a <https://daan.staging.dexpods.eu/distributions/14>;
  dc:title true ;
  dex:offer <https://daan.staging.dexpods.eu/offers/62160576efe0e3622296210e> .

and

@prefix dc: <http://purl.org/dc/terms/> .
@prefix dcat: <http://www.w3.org/ns/dcat#> .
@prefix dex: <https://dexpods.eu/ns/core#> .

<https://daan.staging.dexpods.eu/distributions/14> a <https://daan.staging.dexpods.eu/distributions/14>;
  dc:title true.

Now someone should dig into the Turtle specification and check if it's a bug or maybe the syntax without space is not a valid Turtle. I'm afraid I won't do it.

@joepio
Copy link
Author

joepio commented Feb 23, 2022

Thanks for the quick reply! Pretty much all TTL validators that I tried succesfully parsed and validated the one with the spacebar for the .:

https://www.w3.org/2015/03/ShExValidata/

http://ttl.summerofcode.be/

http://rdfvalidator.mybluemix.net/

I think we can safely classify this as a parsing bug, at least practically - if most other implementations do parse this without errors.

@joepio joepio changed the title Can't parse Turtle (TTL) boolean values Can't parse Turtle (TTL) boolean values followed by a spacebar Feb 23, 2022
@gkellogg
Copy link

In W3C EBNF grammars, such as Turtle, whitespace is typically not required, except in rare circumstances.

From the Turtle spec 6.1 White Space:

White space (production WS) is used to separate two terminals which would otherwise be (mis-)recognized as one terminal. Rule names below in capitals indicate where white space is significant; these form a possible choice of terminals for constructing a Turtle parser.

The rule names in capitals all denote terminal productions, although neither true nor false are terminal productions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants