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

[Bug] Turtle parsing of prefixed URIs trigger an error #165

Open
MaillPierre opened this issue Dec 15, 2023 · 1 comment
Open

[Bug] Turtle parsing of prefixed URIs trigger an error #165

MaillPierre opened this issue Dec 15, 2023 · 1 comment

Comments

@MaillPierre
Copy link
Contributor

Issue Description:
An exception is triggered when parsing a turtle document containing some prefixed URIs with the % after the prefix.

Bug Details:

The exception triggered is Lexical error at line 2, column 21. Encountered: "%" (37), after: ""

Steps to Reproduce:
Load the example:

@prefix ex: <http://example.com/> .
ex:1 ex:property ex:%3CspanStyle .

Expected Behavior:

Strings looking like %[alphanum] are common in URIs as they result from the encoding into URL characters of Unicode characters. Because of this, they are part of the authorized characters in a URI. Furthermore, the Turtle recommendation states clearly that they are acceptable in prefixed names (Cf the note in section 6.3).

Actual Behavior:

The loading is said to have been completed after raising the exception, not sure that the entirety of the file has been loaded

System
Tested on corese-gui-4.5.0.jar and corese-server-4.5.0.jar

@MaillPierre
Copy link
Contributor Author

MaillPierre commented Feb 28, 2024

Adding another case: URIs containing "-" characters such as ORCiD URLs.

Example:

File test.ttl, generated by a Corese server:

@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix ns177: <http://orcid.org/> .

<http://example.org> dc:contributor ns177:0000-0001-6938-0820 ;
  dc:contributor ns177:0000-0002-0643-3144 ;
  dc:contributor ns177:0000-0002-5711-4872 .

For any query, corese-command returns:

java -jar corese-command-4.5.0.jar sparql -i test.ttl -q query.rq -of text/csv
Error: Failed to parse RDF file. Check if file is well-formed and that the input format is correct. Encountered "-0001 -6938" at line 4, column 47.
Was expecting one of:
...

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

1 participant