HajoRijgersberg / OM

Ontology of units of Measure
88 stars 23 forks source link

Cannot parse om-2.0.rdf anymore #81

Closed mi-les closed 1 year ago

mi-les commented 1 year ago

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?

HajoRijgersberg commented 1 year ago

Hi Michaela, Thanx for the notice. I'll look into it immediately. Best, Hajo

HajoRijgersberg commented 1 year ago

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 42642 42643 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.

HajoRijgersberg commented 1 year ago

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!

mi-les commented 1 year ago

Yep, that was it, works now! Thanks for the super quick response.

HajoRijgersberg commented 1 year ago

Thanx for your testing and quick response too! Hope to get back to this soon with an altered definition of the authorList entries.

jmkeil commented 1 year ago

82 fixes this. Sorry, I uses the wrong attribute. I only checked with Protege, which didn't complain about that.

HajoRijgersberg commented 1 year ago

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!

HajoRijgersberg commented 1 year ago

I also often use Protégé for testing. ;)

mi-les commented 1 year ago

it's working :) thanks again!

HajoRijgersberg commented 1 year ago

Great! Thanx! :)