emmo-repo / EMMO

Elementary Multiperspective Material Ontology (EMMO)
Other
62 stars 16 forks source link

Readded initial "EMMO_" to all IRIs #182

Closed jesper-friis closed 2 years ago

jesper-friis commented 2 years ago

It turns out that the XML specification require that the name part of an IRI must start with an alphabetic character. Serialising EMMO to rdfxml using Owlready2 now produces invalid XML. Protege manage to produce valid XML by converting an IRI like

<emmo:967080e5_2f42_4eb2_a3a9_c58143e835f9>

to

<emmo2:e5_2f42_4eb2_a3a9_c58143e835f9>

where the namespace "emmo2" is "http://emmo.info/emmo#967080". But this completely messes up everything.

This PR readds the initial EMMO_ to all IRIs using

find -name '*.ttl' | xargs sed -i 's/\([#:]\)\([[:xdigit:]]\{8\}_[[:xdigit:]]\{4\}_[[:xdigit:]]\{4\}_[[:xdigit:]]\{4\}_[[:xdigit:]]\{12\}\)/\1EMMO_\2/g'