@@ -501,7 +501,7 @@ api.compactIri = ({
501
501
containers . push (
502
502
'@graph@id' , '@graph@id@set' ) ;
503
503
}
504
- containers . push ( '@graph' , '@graph@set' ) ;
504
+ containers . push ( '@graph' , '@graph@set' , '@set' ) ;
505
505
// allow indexmap if the graph is not indexed
506
506
if ( ! ( '@index' in value ) ) {
507
507
containers . push ( '@graph@index' , '@graph@index@set' , '@index' , '@index@set' ) ;
@@ -586,23 +586,29 @@ api.compactIri = ({
586
586
} else if ( '@type' in value ) {
587
587
typeOrLanguage = '@type' ;
588
588
typeOrLanguageValue = value [ '@type' ] ;
589
- } else if ( ! ( '@index' in value ) ) {
590
- // allw indexing by language even if no language present
591
- containers . push ( '@language' , '@language@set' ) ;
592
589
}
593
590
} else {
594
591
typeOrLanguage = '@type' ;
595
592
typeOrLanguageValue = '@id' ;
596
593
}
597
- if ( _isObject ( value ) && ! ( '@index' in value ) ) {
598
- // allow indexing even if no @index present
599
- containers . push ( '@index' , '@index@set' ) ;
600
- }
601
594
containers . push ( '@set' ) ;
602
595
}
603
596
604
597
// do term selection
605
598
containers . push ( '@none' ) ;
599
+
600
+ // an index map can be used to index values using @none , so add as a low priority
601
+ if ( _isObject ( value ) && ! ( '@index' in value ) ) {
602
+ // allow indexing even if no @index present
603
+ containers . push ( '@index' , '@index@set' ) ;
604
+ }
605
+
606
+ // values without type or language can use @language map
607
+ if ( _isValue ( value ) && Object . keys ( value ) . length === 1 ) {
608
+ // allow indexing even if no @index present
609
+ containers . push ( '@language' , '@language@set' ) ;
610
+ }
611
+
606
612
const term = _selectTerm (
607
613
activeCtx , iri , value , containers , typeOrLanguage , typeOrLanguageValue ) ;
608
614
if ( term !== null ) {
0 commit comments