Repository navigation
fix: ensure domain and range classes are always visible (fixes #172) - #222
Open
mithunbabbira wants to merge 1 commit into
Open
mithunbabbira wants to merge 1 commit into
mithunbabbira wants to merge 1 commit into
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
WebVOWL treats domain classes differently than range classes. For an ontology like:
WebVOWL displays the
:To(range) class but not the:From(domain) class — unless:Fromis 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 returnsundefined, 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
OwlClassnode and add it to the combined classes array beforecreateNodeStructure()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