Cannot parse om-2.0.rdf anymore
Closed this issue · 10 comments
Hi,
after the recent changes, I cannot parse the om-2.0.rdf file using rdflib
anymore, like so:
from rdflib import Graph
ontology_url = ("https://raw.githubusercontent.com/HajoRijgersberg/OM/master/om-2.0.rdf")
g = Graph()
g.parse(ontology_url, format="xml")
This throws the following error:
rdflib.exceptions.ParserError: https://raw.githubusercontent.com/HajoRijgersberg/OM/master/om-2.0.rdf:42642:2: Invalid property attribute URI: http://www.w3.org/1999/02/22-rdf-syntax-ns#resource
It worked just fine before the weekend. Anything gone wrong in the recent merges?
Hi Michaela,
Thanx for the notice. I'll look into it immediately.
Best, Hajo
I think I've found it: your error message gives a line number, 42642, that points to the first (of three) changes of authorLists of literature sources:
42641 <bibo:authorList rdf:parseType="Collection">
42642 <rdf:Description rdf:resource="&ombibo;Edwin_Budding"/>
42643 <rdf:Description rdf:resource="&ombibo;Osman_Demircan"/>
42644 </bibo:authorList>
In the past I did not have any rdf:Description in OM, so I think for some reason something goes wrong there. For now I'll comment such lines out. I'll give you a sign when I have done that (I'll do that immediately). Subsequently I will look for a more sustainable solution. I will keep you updated about that.
I have commented the lines out and uploaded a new version of om-2.0.rdf. Can you check if this one is parsing correctly? Thanx in advance.
Sorry for any inconvenience!
Yep, that was it, works now! Thanks for the super quick response.
Thanx for your testing and quick response too! Hope to get back to this soon with an altered definition of the authorList entries.
#82 fixes this. Sorry, I uses the wrong attribute. I only checked with Protege, which didn't complain about that.
No problem Jan Martin, thanx for your (quick) help! :) So do I understand correctly that the use of rdf:Description was not the problem, but the use of rdf:resource after that rather than rdf:about?
Anyway, I have merged your pull request, and Michaela if you could try parsing this new version of OM again, that would be great! :) Thanx in advance!
I also often use Protégé for testing. ;)
it's working :) thanks again!
Great! Thanx! :)