@@ -379,7 +379,7 @@ const mxFunction = (base) => {
379
379
} catch ( _ ) {
380
380
return undefined
381
381
}
382
-
382
+
383
383
}
384
384
385
385
/**
@@ -493,25 +493,27 @@ const mxFunction = (base) => {
493
493
if ( ! shape || ! range ) {
494
494
return undefined ;
495
495
}
496
- // let name;
497
- if (
498
- this . _hasType ( shape , this . ns . aml . vocabularies . apiContract . Parameter )
499
- ) {
500
- return /** @type string */ ( this . _getValue (
501
- range ,
502
- this . ns . aml . vocabularies . core . name
503
- ) ) ;
496
+
497
+ const coreName = this . ns . aml . vocabularies . core . name ;
498
+ const shaclName = this . ns . w3 . shacl . name ;
499
+ const parameterType = this . ns . aml . vocabularies . apiContract . Parameter ;
500
+ const nodeShapeType = this . ns . w3 . shacl . NodeShape ;
501
+
502
+ // Check if the shape is of type Parameter
503
+ if ( this . _hasType ( shape , parameterType ) ) {
504
+ return /** @type string */ ( this . _getValue ( range , coreName ) ) ;
504
505
}
505
- if ( this . _hasType ( range , this . ns . w3 . shacl . NodeShape ) ) {
506
- return /** @type string */ ( this . _getValue (
507
- shape ,
508
- this . ns . w3 . shacl . name
509
- ) ) ;
510
- }
511
- return /** @type string */ ( this . _getValue (
512
- range ,
513
- this . ns . aml . vocabularies . core . name
514
- ) ) ;
506
+
507
+ // Check if the range is of type NodeShape
508
+ if ( this . _hasType ( range , nodeShapeType ) ) {
509
+ return (
510
+ /** @type string */ ( this . _getValue ( range , coreName ) ) ||
511
+ /** @type string */ ( this . _getValue ( shape , shaclName ) )
512
+ ) ;
513
+ }
514
+
515
+ // Default case: return the core name from the range
516
+ return /** @type string */ ( this . _getValue ( range , coreName ) ) ;
515
517
}
516
518
517
519
_computeHasMediaType ( mediaType ) {
0 commit comments