0

I am trying the load the triples from a Linked data dump into my local triplestore using RDFlib.

An example triple in my file:

 <http://SubjectURL> <http://propertyURL>   "Some detail about the subject"@EN .

Snippet of the code:

 g.parse(path_of_the_file, format="nt")

Error Message:

File "/usr/local/lib/python2.7/dist-packages/rdflib/graph.py", line 1039, in parse parser.parse(source, self, **args)
File "/usr/local/lib/python2.7/dist-packages/rdflib/plugins/parsers/nt.py", line 26, in parse
parser.parse(f)
File "/usr/local/lib/python2.7/dist-packages/rdflib/plugins/parsers/ntriples.py", line 142, in parse
raise ParseError("Invalid line: %r" % self.line)
rdflib.plugins.parsers.ntriples.ParseError: Invalid line: u'@EN .'

Doesn't RDFlib support language restriction(@en, @fr..)? How do I handle such situation?

RDangol
  • 179
  • 9
  • 2
    Try to replace `@EN` with `@en` (in lower case). – Stanislav Kralin Oct 31 '17 at 05:37
  • @StanislavKralin yea lower case worked. Thank you. I get the same error for other triple as well : 60.0 . – RDangol Oct 31 '17 at 05:47
  • Probably RDFLib expects `"60.0"^^xsd:decimal"` or something like. I do not know, is it possible to override this behaviour, forcing RDFlib to "guess" these datatypes, or you have to add them. Probably you could import your file into more "omnivorous" triplestore and then export triples. – Stanislav Kralin Oct 31 '17 at 06:12
  • @StanislavKralin could you give me an example of such "omnivorous" triplestore? – RDangol Oct 31 '17 at 06:38
  • @StanislavKralin Do you happen to know any linked data dumps (not too large, few million triples at max) without any such issues? It can be about anything. So far I have been searching in datahub but I keep finding data sets with issues. – RDangol Oct 31 '17 at 07:49
  • recently I have downloaded and then imported into my GrapDB installation some files from [here](http://people.aifb.kit.edu/ath/#DBpedia_PageRank). – Stanislav Kralin Nov 01 '17 at 16:22
  • @StanislavKralin Thanks. I will check the data there. Also, FYI, the issue with `@EN` apparently was a rdflib bug and I think it is now fixed – RDangol Nov 01 '17 at 16:46

0 Answers0