-
Notifications
You must be signed in to change notification settings - Fork 553
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
from_n3 fails on numeric shortcuts #1769
Comments
I would advise avoiding
These may be fixable problems, but ultimately the best way to parse n3 is to use the n3 parser, if this problem is present there (I'm adding tests for it now) then we should fix it, but essentially we are maintaining two n3 parsers at the moment and it may be better to just maintain one. I would say a much better option is to mark this function as deprecated and remove it in the next major version of RDFLib unless we can unify the parsing of the n3 parser CC: @gjhiggins |
This changeset only adds tests for existing functionality. The tests verifies that the problem reported in RDFLib#1769 does not exist in actual parsers.
I have added tests to confirm the cases in question works correctly with the actual persers: All of the added tests pass without issue, so I would recommend using the actual parser for your parsing needs instead. |
Is there an example of how I can use the parser to parse individual terms?
On Sun, Mar 27, 2022 at 8:18 AM Iwan Aucamp ***@***.***> wrote:
I have added tests to confirm the cases in question works correctly with
the actual persers:
- #1778 <#1778>
All of the added tests pass without issue, so I would recommend using the
actual parser for your parsing needs instead.
—
Reply to this email directly, view it on GitHub
<#1769 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAETCEPHQQLGOC2BXPD2HVLVCBNYTANCNFSM5RLXH5DQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
Jamie McCusker (she/they)
Director, Data Operations
Tetherless World Constellation
Rensselaer Polytechnic Institute
***@***.*** ***@***.***>
http://tw.rpi.edu
|
I would advise trying something like this: rdflib/test/test_parsers/test_parser_turtlelike.py Lines 92 to 99 in e06db40
So essentially create graph template where you can plug your term into as a an object, and then parse it and take the object from the resulting triple. EDIT: just be wary of potential injection cases, as maliciously crafted strings could result in unexpected behaviour, for example creating multiple triples. Not sure it is that relevant here but better to raise the potential just in case. |
All good reasons for general avoidance. However, to deprecate it might be premature, |
This was fixed by @gjhiggins in #1771 |
From the turtle spec [1]:
Testing this, I get:
It does seem to work on positive integers:
[1] https://www.w3.org/TR/turtle/#literals
The text was updated successfully, but these errors were encountered: