-
Notifications
You must be signed in to change notification settings - Fork 565
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
Issue parsing Turtle with info URI #816
Comments
This issue is not valid perfectly. As the public id part is coded in such a way. That you can merge the absolute uri of public id with the relative uri of the base of ttl. But here both are absolute so public id uri is overwritten by ttl base uri. If you want to make public id as base then follow the comment given in notation3.py at line 623 regarding the base. Though we could not able to exactly replicate the error as given but we found that it is not getting updated. |
No longer causes an Exception. def test_issue816_issue_parsing_turtle_with_iri():
g1 = Graph().parse(
data="<http://ex.org/res/1> a <http://auth.edu/ns#Resource> .", format="turtle"
)
ttl1 = g1.serialize(format="turtle", base="http://ex.org/res")
print(f"{ttl1}")
# @base <http://ex.org/res> .
#
# </1> a <http://auth.edu/ns#Resource> .
g2 = Graph().parse(data=ttl1, format="turtle", publicID=URIRef("info:ns"))
print(f"{g2.serialize(format='ttl')}")
# <http://ex.org/1> a <http://auth.edu/ns#Resource> . |
I am trying to read a TTL stream and parse into a graph by replacing a public URI (
http://ex.org/res/
) with an internal URI (info:ns/
). I want to do this using the tools provided by RDFLib rather than writing tedious and error-prone pattern matching code.The following is a minimal example:
The last line triggers the following error:
To my knowledge,
info:ns/...
is a valid URI. Is this something that conflicts with the N3 syntax, or something else?Thanks.
The text was updated successfully, but these errors were encountered: