@@ -534,7 +534,7 @@ export class MappingService extends AbstractService {
534534 for ( const uri of ancestors . map ( a => a && a . uri ) . filter ( Boolean ) ) {
535535 mappings = await this . queryItems ( Object . assign ( { } , query , { from : uri , type : types . join ( "|" ) } ) )
536536 if ( mappings . length ) {
537- return mappings . map ( m => {
537+ return Promise . all ( mappings . map ( async m => {
538538 const mapping = {
539539 from : { } ,
540540 fromScheme : m . fromScheme ,
@@ -566,7 +566,7 @@ export class MappingService extends AbstractService {
566566 mapping . type = [ type ]
567567 }
568568 return jskos . addMappingIdentifiers ( mapping )
569- } )
569+ } ) )
570570 }
571571 }
572572 } catch ( error ) {
@@ -631,7 +631,7 @@ export class MappingService extends AbstractService {
631631 mapping . uri = mapping . uri . replace ( "http:" , "https:" )
632632 }
633633 // Set mapping identifier
634- mapping . identifier = jskos . addMappingIdentifiers ( mapping ) . identifier
634+ mapping . identifier = ( await jskos . addMappingIdentifiers ( mapping ) ) . identifier
635635 // Set mapping type to mappingRelation if not set
636636 if ( ! mapping . type || ! mapping . type . length ) {
637637 mapping . type = [ "http://www.w3.org/2004/02/skos/core#mappingRelation" ]
@@ -667,7 +667,7 @@ export class MappingService extends AbstractService {
667667 mapping . uri = existing . uri
668668 mapping . created = existing . created
669669 // Set mapping identifier
670- mapping . identifier = jskos . addMappingIdentifiers ( mapping ) . identifier
670+ mapping . identifier = ( await jskos . addMappingIdentifiers ( mapping ) ) . identifier
671671 // Set mapping type to mappingRelation if not set
672672 if ( ! mapping . type || ! mapping . type . length ) {
673673 mapping . type = [ "http://www.w3.org/2004/02/skos/core#mappingRelation" ]
@@ -721,7 +721,7 @@ export class MappingService extends AbstractService {
721721 // Merge mappings
722722 const newMapping = Object . assign ( { } , existing , mapping )
723723 // Set mapping identifier
724- newMapping . identifier = jskos . addMappingIdentifiers ( newMapping ) . identifier
724+ newMapping . identifier = ( await jskos . addMappingIdentifiers ( newMapping ) ) . identifier
725725 // Set mapping type to mappingRelation if not set
726726 if ( ! mapping . type || ! mapping . type . length ) {
727727 mapping . type = [ "http://www.w3.org/2004/02/skos/core#mappingRelation" ]
0 commit comments