Skip to content

[Fix] Remove ontology namespace URI from HTML node ID after decoding URL#820

Merged
dgarijo merged 1 commit into
dgarijo:developfrom
lukaskabc:lukaskabc/fix-namespace-uri-not-removed
May 11, 2026
Merged

[Fix] Remove ontology namespace URI from HTML node ID after decoding URL#820
dgarijo merged 1 commit into
dgarijo:developfrom
lukaskabc:lukaskabc/fix-namespace-uri-not-removed

Conversation

@lukaskabc

Copy link
Copy Markdown
Contributor

The current implementation of LODEParser first attempts to remove the ontology namespace from the node identifier, then decodes it and processes it further.

That expects the ontology namespace URI to be a URL-encoded identifier, which I believe is a bug.

This PR moves the namespace removal after the ID is decoded.

Example:
Consider the following ontology:

@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix vann: <http://purl.org/vocab/vann/> .
# intentionally using non ASCII characters
@prefix example: <http://example.com/spéciál/ontology/> .

<http://example.com/spéciál/ontology/> a owl:Ontology ;
    rdfs:label "Example ontology"@en;
    vann:preferredNamespaceUri <http://example.com/spéciál/ontology/> ;
    vann:preferredNamespacePrefix "example".


example:Class a owl:Class;
    rdfs:label "Example class"@en .

Before this fix, the generated HTML looks like

<div class="entity" id="http://example.com/spéciál/ontology/Class">

With this fix applied:

<div class="entity" id="Class">

Running widoco with: java -jar widoco-1.4.26-jar-with-dependencies.jar -ontFile example-ontology.ttl -uniteSections

@dgarijo

dgarijo commented May 11, 2026

Copy link
Copy Markdown
Owner

Yep, you are right. Merging

@dgarijo dgarijo merged commit 9abff89 into dgarijo:develop May 11, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants