Open vadyushkins opened 3 years ago
I'm sorry for the late reply. Thank you for the very clear report!
A quick solution is to specify base_iri
of parse()
to some absolute URI (like https://ftp.uniprot.org/pub/databases/uniprot/current_release/rdf/pathways.rdf.xz
):
import lightrdf
import sys
parser = lightrdf.Parser()
cnt = 0
for triple in parser.parse(sys.argv[1], base_iri="https://ftp.uniprot.org/pub/databases/uniprot/current_release/rdf/pathways.rdf.xz"):
cnt += 1
print(cnt)
More specifically, the problem is <owl:Ontology rdf:about="">
in pathways.rdf
, for rdf:about=""
means "the URI of the document containing the ontology" (as stated in OWL1/2 specs and in general), but there is no definitive URI/IRI for downloaded local files.
RDFLib avoids this problem by using the local IRI of the file (file:///.../pathways.rdf
) for base IRI by default.
We may make lightrdf do the same thing, but before that I'd like to investigate if it is reasonable.
Thanks for your reply @ozekik!
I think the best solution would be to put your example in the README, as the base IRI default setting might be more confusing in other situations.
Hi @ozekik!
Thank you for the awesome library! :clap:
Unfortunately, while using your library, I got the error :bug: mentioned in the title. :disappointed: But using rdflib I was not getting a similar error. :thinking:
Environment
Steps to reproduce.
Download pathways archive.
Unzip it using xz package.
Run count_triples_lightrdf_parser.py.
Error log.
Please tell me where I am wrong. Thank you :pray: