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 Parse Error: illegal subject type: literal #306
Comments
I have just tested using this more complete turtle document:
It looks like the parser doesn't like the I will need to check the Turtle grammar and see why it isn't working: Thanks for reporting. |
Hi, any news on that. |
It goes down to https://www.w3.org/TR/turtle/#grammar-production-PN_LOCAL where we can see that a dot can't be the first nor the last character of the "after the semicolon part of a prefixed name" but is allowed in the middle. This isn't honored by the Turtle::isNameChar() which always treats it as a prefixed name end. |
I have posted a specific example in #396 It is not clear (in https://github.com/easyrdf/easyrdf/blob/main/lib/Parser/Turtle.php#L1305 that parses char by char) how this can be solved. Is it enough to add . (0x2E) in the list of accepted chars in Names? |
I would say add to the list of accepted ones and on the pname end check if the last character is a dot. If so, remove it from the pname and return it to the input characters queue. |
I am not that familiar with the flow of parsing and the functions used. ||( $c=="." &( $onext >= 0x0300 && $onext <= 0x036F || any help appreciated. thanks |
I got it working by sending to isNameChar (which is static) also the next character using $this->peek() in each call. Here are my changes they seem to work but i am not sure this is a proper fix though since i did not go through the spec.
|
In order for RdfNamespace::expand to work i had also to add . in the regExpr match list. L432 } elseif (preg_match('/^(\w+?):([\w-.]+)$/', $shortUri, $matches)) { shorten works as it is... |
If you think that is helpful to others, you should open a pull request. |
@billyk18278 why your code looking like that? Is that on purpose and we should add that to our work or is that a bug?? |
|
@billyk18278 as far as I can tell the EasyRdf has been abandoned by the @njh. Still he's the only person with rights to merge the code into the main branch and issue new releases. Summing it up there are no chances for a fix, even if it's as simple as you proposed. This leaves you with two options:
|
I have this set of triples:
Easyrdf complains unexpectedly about the
sh:class
line.Or am I missing something?
The text was updated successfully, but these errors were encountered: