WebVOWL_work

Show all annotations with prefixed names including rdfs:comment -

6/9/2026 9:15:03 AM

Changes

src/app/js/sidebar.js 36(+26 -10)

Details

src/app/js/sidebar.js 36(+26 -10)

diff --git a/src/app/js/sidebar.js b/src/app/js/sidebar.js
index e36a681..cce15d9 100644
--- a/src/app/js/sidebar.js
+++ b/src/app/js/sidebar.js
@@ -87,10 +87,12 @@ module.exports = function ( graph ){
     var other = ontologyInfo.other || {};
     for ( var key in other ) {
       if ( other.hasOwnProperty(key) ) {
-        var ann = other[key][0];
-        if ( ann ) {
-          renderPair(panel, ann.identifier, ann.value, ann.type === "iri" ? ann.value : undefined);
-        }
+        var entries = other[key];
+        if ( !entries ) continue;
+        entries.forEach(function ( ann ){
+          if ( !ann ) return;
+          renderPair(panel, prefixedName(ann.identifier), ann.value, ann.type === "iri" ? ann.value : undefined);
+        });
       }
     }
 
@@ -219,8 +221,8 @@ module.exports = function ( graph ){
     var attrs = getAttributes(property.attributes());
     if ( attrs ) renderPair(panel, "Characteristics", attrs);
 
-    renderPair(panel, "Description", property.descriptionForCurrentLanguage());
-    renderPair(panel, "Comment", property.commentForCurrentLanguage());
+    renderPair(panel, "rdfs:comment", property.commentForCurrentLanguage());
+    renderPair(panel, "rdfs:label", property.descriptionForCurrentLanguage());
 
     renderAnnotationPairs(panel, property.annotations());
   }
@@ -238,12 +240,26 @@ module.exports = function ( graph ){
     });
   }
 
+  function prefixedName( iri ){
+    var pm = graph.options().prefixModule();
+    if ( pm && pm.getPrefixRepresentationForFullURI ) {
+      var prefixed = pm.getPrefixRepresentationForFullURI(iri);
+      if ( prefixed !== iri ) return prefixed;
+    }
+    return iri;
+  }
+
   function renderAnnotationPairs( panel, annotationObject ){
     annotationObject = annotationObject || {};
     for ( var key in annotationObject ) {
       if ( annotationObject.hasOwnProperty(key) ) {
-        var ann = annotationObject[key][0];
-        if ( ann ) renderPair(panel, ann.identifier, ann.value, ann.type === "iri" ? ann.value : undefined);
+        var entries = annotationObject[key];
+        if ( !entries ) continue;
+        entries.forEach(function ( ann ){
+          if ( !ann ) return;
+          var label = prefixedName(ann.identifier);
+          renderPair(panel, label, ann.value, ann.type === "iri" ? ann.value : undefined);
+        });
       }
     }
   }
@@ -277,8 +293,8 @@ module.exports = function ( graph ){
     var attrs = getAttributes(node.attributes());
     if ( attrs ) renderPair(panel, "Characteristics", attrs);
 
-    renderPair(panel, "Description", node.descriptionForCurrentLanguage());
-    renderPair(panel, "Comment", node.commentForCurrentLanguage());
+    renderPair(panel, "rdfs:comment", node.commentForCurrentLanguage());
+    renderPair(panel, "rdfs:label", node.descriptionForCurrentLanguage());
 
     renderAnnotationPairs(panel, node.annotations());
   }