Groups
Groups
Sign in
Groups
Groups
rdflib-dev
Conversations
About
Send feedback
Help
rdflib.exceptions.ParserError: Invalid line:
149 views
Skip to first unread message
Tom Tang
unread,
Dec 2, 2021, 2:45:56 AM
12/2/21
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to rdflib-dev
Dear rdflib manitainers,
I am a user of rdflib. When I use rdflib.Graph to parse one .nt file, the terminal output is
rdflib.exceptions.ParserError: Invalid line: <
http://dbpedia.org/resource/2015_African_Rugby_Under-19_Cup_Division_
"A"> .
While I remove the double quotations of ”A", i.e., "A" -> A,the program is OK. I want to know if there are other ways to parsing the .nt file rather than remove the double quotations of ”A".
Thanks a lot.
Yours Sincerely.
Appendix
Data{
<a:>
<
http://www.w3.org/2002/07/owl#sameAs
>
<
http://dbpedia.org/resource/2015_African_Rugby_Under-19_Cup_Division_
"A"> .}
Code{
from rdflib import Graph
g = Graph()
g.parse("./data/example.nt")
print(f"Graph g has {len(g)} statements.")
print(g.serialize(format="turtle"))
}
Graham Higgins
unread,
Dec 2, 2021, 11:35:05 AM
12/2/21
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to rdflib-dev
As posted on Gitter, included here for completeness: Looks like a problematic URL for dbpedia. With, or without the double quotes, that dbpedia URL returns a “301 See other” and the relocate is
https://dbpedia.org/resource/2015_African_Rugby_Under-19_Cup_Division_%22A%22
- which itself fails to resolve. OTOH, wikipedia returns a corresponding redirect
https://en.wikipedia.org/wiki/2015_African_Rugby_Under-19_Cup_Division_%22A%22
which
is
found. The dbpedia page is essentially blank, it has none of the info for that entry on wikipedia.
Cheers,
Graham
Reply all
Reply to author
Forward
0 new messages