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"))
}
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.
ConjunctiveGraph
binds a Graph to the instance variable self.default_context
.
test_dataset_default.py
, it exercises the three aspects of dataset functionality, direct manipulation with Python, indirect manipulation via RDF input and indirect manipulation via SPARQL update. (I've also had to keep the ConjunctiveGraph in lockstep because of Dataset's inheritance of that class). There are two main working outputs test_dataset_anomalies.py
and test_dataset_anomalies_resolved.py, there's also test_dataset_anomalies_wip.py
and test_dataset_graph_ops.py
both for work-in-progress on different aspects of the subject. Apologies for the mess but I've completely failed to be able to reduce it to a logical sequence of changes.
$ git diff origin/master -- rdflib/util.py
diff --git a/rdflib/util.py b/rdflib/util.py
index 7318dcc3..c98dfdac 100644
--- a/rdflib/util.py
+++ b/rdflib/util.py
@@ -364,6 +364,7 @@ SUFFIX_FORMAT_MAP = {
"html": "rdfa",
"svg": "rdfa",
"nq": "nquads",
+ "nquads": "nquads",
"trig": "trig",
"json": "json-ld",
"jsonld": "json-ld",