Skip to content

Commit

Permalink
Merge pull request #224 from lbl-srg/issue95_BRICK
Browse files Browse the repository at this point in the history
fixing an error in how instance names were used.
  • Loading branch information
anandkp92 authored Mar 19, 2024
2 parents 2d8affd + d068978 commit 39f60b6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/semanticExtractor.js
Original file line number Diff line number Diff line change
Expand Up @@ -393,20 +393,21 @@ function getSemanticInformation (className, outputDir) {
const content = {}
for (const id in instances) {
const semantics = instances[id].semantics
const newId = id.replaceAll('.', '_')
for (const language in semantics) {
if (language.split(' ').length === 3) {
if (language.split(' ')[2] === 'text/turtle') {
if (language in content) {
content[language] += semantics[language].replaceAll('<cdl_instance_name>', id)
content[language] += semantics[language].replaceAll('<cdl_instance_name>', newId)
} else {
content[language] = semantics[language].replaceAll('<cdl_instance_name>', id)
content[language] = semantics[language].replaceAll('<cdl_instance_name>', newId)
}
}
} else {
if (language in content) {
content[language] += String(semantics[language].replaceAll('<cdl_instance_name>', id) + '\n')
content[language] += String(semantics[language].replaceAll('<cdl_instance_name>', newId) + '\n')
} else {
content[language] = String(semantics[language].replaceAll('<cdl_instance_name>', id) + '\n')
content[language] = String(semantics[language].replaceAll('<cdl_instance_name>', newId) + '\n')
}
}
}
Expand Down

0 comments on commit 39f60b6

Please sign in to comment.