RDFLib/pyLODE

Anchor generation in html

Closed this issue · 1 comments

I have URIs with '_' characters in the final tokens (e.g. Geologic_Time_Interval),

in v3, looks like Pylode is using the prefLabel to generate the anchor string. If there's more that one pref label (different languages...) it seems to grab the first one for the Anchor. spaces are removed.

Thus, my rewrite rules won't work (W3ID, Loop3d folder) unless I can remove the '_' somehow in the .htaccess file...
RewriteRule ^([a-z-]+)/([A-Za-z_]+)$ https://rawcdn.githack.com/Loop3D/GKM/1.0.2/docs/$1.html#$2 [NE,R=303,L]
the idea was to generate a URL to get the specific class anchor in the pylode html using the final token in the URI.
I'd like the class with URI
https://w3id.org/gso/rockmaterial/Clastic_Sediment
to have an HTML anchor like #Clastic_Sediment instead of #clasticsediment that PyLode currently generates from the prefLabel.

I commented out lines 154-167 in utils.py to skip building the anchor (fid) from the prefLabel, and used the code that generates the fid from the final URI segment, then built a new exe. This worked.