@@ -113,7 +113,13 @@ export class EnumerationCharacteristicInstantiator extends CharacteristicInstant
113
113
// create the related instance and attach the metamodel element to it
114
114
const entityInstance = new DefaultEntityInstance ( quad . object . value . split ( '#' ) [ 1 ] , entity , descriptions ) ;
115
115
entityInstanceQuads . forEach ( quad => {
116
- entityInstance [ quad . predicate . value . split ( '#' ) [ 1 ] ] = quad . object . value ;
116
+ if ( Util . isBlankNode ( quad . object ) ) {
117
+ entityInstance [ quad . predicate . value . split ( '#' ) [ 1 ] ] =
118
+ this . solveBlankNodeValues ( [ ...this . metaModelElementInstantiator . rdfModel . resolveBlankNodes ( quad . object . value ) ] ) ;
119
+ }
120
+ else {
121
+ entityInstance [ quad . predicate . value . split ( '#' ) [ 1 ] ] = quad . object . value ;
122
+ }
117
123
} ) ;
118
124
119
125
return entityInstance ;
@@ -124,4 +130,33 @@ export class EnumerationCharacteristicInstantiator extends CharacteristicInstant
124
130
shouldProcess ( nameNode : NamedNode ) : boolean {
125
131
return this . metaModelElementInstantiator . sammC . EnumerationCharacteristic ( ) . equals ( nameNode ) ;
126
132
}
133
+
134
+ solveBlankNodeValues ( resolvedBlankNodes ) {
135
+ const resolvedBlankNodesValues = [ ] ;
136
+ if ( resolvedBlankNodes . length > 0 ) {
137
+ resolvedBlankNodes . forEach ( item => {
138
+ resolvedBlankNodesValues . push ( { value : item . object . value , language : item . object . language } ) ;
139
+ } ) ;
140
+ }
141
+ if ( resolvedBlankNodesValues . length ) {
142
+ const test = this . retrieveStringFromArrayOfValues ( resolvedBlankNodesValues ) ;
143
+ return test ;
144
+ }
145
+ else {
146
+ return '' ;
147
+ }
148
+ }
149
+ retrieveStringFromArrayOfValues ( values ) {
150
+ let result = '' ;
151
+ values . forEach ( obj => {
152
+ if ( obj . language ) {
153
+ result += `${ obj . language } : ${ obj . value } , ` ;
154
+ }
155
+ else {
156
+ result += `${ obj . value } , ` ;
157
+ }
158
+ } ) ;
159
+ result = result . slice ( 0 , - 2 ) ;
160
+ return result ;
161
+ }
127
162
}
0 commit comments