Skip to content

fix: ensure domain and range classes are always visible (fixes #172) - #222

Open
mithunbabbira wants to merge 1 commit into
VisualDataWeb:masterfrom
mithunbabbira:fix/domain-range-placeholder
Open

mithunbabbira wants to merge 1 commit into
VisualDataWeb:masterfrom
mithunbabbira:fix/domain-range-placeholder

Conversation

@mithunbabbira

Copy link
Copy Markdown

Problem

WebVOWL treats domain classes differently than range classes. For an ontology like:

prefix : <https://example.com/>

:simple
  rdfs:domain :From;
  rdfs:range :To.

WebVOWL displays the :To (range) class but not the :From (domain) class — unless :From is explicitly declared as a class with :From a owl:Class.

Root Cause

The parser builds a class map from declared classes in the ontology data. When a property references a class ID that's not in the declared classes list, the classMap[] lookup returns undefined, and the property gets silently dropped rather than having its domain node rendered.

Fix

After parsing properties, collect all domain/range class IDs referenced by properties. For any class ID not already in the ontology's class list, create a placeholder OwlClass node and add it to the combined classes array before createNodeStructure() is called.

This ensures both domain and range classes are treated identically — both will always be visible when referenced by a property, regardless of whether they're explicitly declared in the ontology data.

Fixes #172

…taWeb#172)

WebVOWL currently only displays range classes but not domain classes
when the domain class is not explicitly declared in the ontology data.

This fix collects all domain/range references from properties and
creates placeholder nodes for any referenced class not already in the
ontology. This ensures both domain and range are treated consistently.
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.

Inconsistent treatment of domain and range

1 participant