Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,8 @@ convert-rdf-to-rdf:
# OUTPUT_FOLDER_PATH: (Optional) Directory where a ReSpec data JSON file
# should be stored (if not given).
generate-respec:
@## Add a key-value artefact entry to the metadata JSON file. \
@set -eo pipefail; \
## Add a key-value artefact entry to the metadata JSON file. \
extend_metadata_json() { \
local json_file="$$1"; \
local key="$$2"; \
Expand Down Expand Up @@ -523,7 +524,8 @@ generate-respec:
# then the default directory is used.
#
generate-asciidoc-glossary:
@mkdir -p "${OUTPUT_GLOSSARY_PATH}"; \
@set -eo pipefail; \
mkdir -p "${OUTPUT_GLOSSARY_PATH}"; \
## generate a model data JSON if not provided \
GEN_MODEL_DATA_JSON=0; \
if [ ! -e ${MODEL_DATA_JSON_PATH} ]; then \
Expand Down
13 changes: 10 additions & 3 deletions src/rspec/rspec-generation.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@
array{
for $classParentName in $classParentsNames
return
let $parentElement := root($classElement)//element[@xmi:type = 'uml:Class' and @name = $classParentName],
let $parentElement := (root($classElement)//element[@xmi:type = 'uml:Class' and @name = $classParentName])[1],
$defaultLabel := f:lexicalQNameToWords($classParentName, fn:true()),
$parentLabel := if ($parentElement) then f:getCustomLabelOrDefault($parentElement, $defaultLabel) else $defaultLabel
return map{
Expand All @@ -290,6 +290,7 @@
<xsl:template name="classProprietiesFromAttributes" as="array(*)">
<xsl:param name="classElement" as="element()"/>
<xsl:variable name="attributes" select="$classElement/attributes/attribute"/>
<xsl:variable name="root" select="root($classElement)"/>

<xsl:sequence
select="
Expand All @@ -301,7 +302,13 @@
$propertyPrefix := fn:substring-before($attribute/@name, ':'),
$attributeRangeCurie := $attribute/properties/@type,
$attributeRangeDefaultLabel := f:lexicalQNameToWords($attributeRangeCurie, fn:true()),
$attributeRangeLabel := f:getCustomLabelOrDefault(root($classElement)//element[@name = $attributeRangeCurie], $attributeRangeDefaultLabel)
$targetClassElement := ($root//element[@name = $attributeRangeCurie])[1],
$attributeRangeLabel := (
if ($targetClassElement) then
f:getCustomLabelOrDefault($targetClassElement, $attributeRangeDefaultLabel)
else
$attributeRangeDefaultLabel
)
return map{
'uri': f:buildURIfromLexicalQName($attribute/@name),
'name': string($attribute/@name),
Expand Down Expand Up @@ -364,7 +371,7 @@
$propertyPrefix := fn:substring-before($association/@name, ':'),
$associationRangeCurie := $association/target/@name,
$associationRangeDefaultLabel := f:lexicalQNameToWords($associationRangeCurie, fn:true()),
$targetClassElement := $root//element[@name = $associationRangeCurie],
$targetClassElement := ($root//element[@name = $associationRangeCurie])[1],
$associationRangeLabel := (if ($targetClassElement)
then f:getCustomLabelOrDefault($targetClassElement, $associationRangeDefaultLabel)
else $associationRangeDefaultLabel)
Expand Down
Loading