File tree Expand file tree Collapse file tree 4 files changed +6
-6
lines changed Expand file tree Collapse file tree 4 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 3
3
### Fixed
4
4
- Use rdf-canonize to compare n-quads test results.
5
5
- Multiple graph tests.
6
+ - Sort ` @type ` when looking for scoped contexts.
6
7
7
8
### Changed
8
9
- Use JSON-LD WG tests.
Original file line number Diff line number Diff line change @@ -145,7 +145,10 @@ api.compact = ({
145
145
// apply any context defined on an alias of @type
146
146
// if key is @type and any compacted value is a term having a local
147
147
// context, overlay that context
148
- const types = element [ '@type' ] || [ ] ;
148
+ let types = element [ '@type' ] || [ ] ;
149
+ if ( types . length > 1 ) {
150
+ types = Array . from ( types ) . sort ( ) ;
151
+ }
149
152
for ( const type of types ) {
150
153
const compactedType = api . compactIri (
151
154
{ activeCtx, iri : type , relativeTo : { vocab : true } } ) ;
Original file line number Diff line number Diff line change @@ -157,7 +157,7 @@ api.expand = ({
157
157
const expandedProperty = _expandIri ( activeCtx , key , { vocab : true } ) ;
158
158
if ( expandedProperty === '@type' ) {
159
159
// set scopped contexts from @type
160
- const types = [ ] . concat ( element [ key ] ) ;
160
+ const types = [ ] . concat ( element [ key ] ) . sort ( ) ;
161
161
for ( const type of types ) {
162
162
const ctx = _getContextValue ( activeCtx , type , '@context' ) ;
163
163
if ( ctx ) {
Original file line number Diff line number Diff line change @@ -44,8 +44,6 @@ const TEST_TYPES = {
44
44
/ ^ # t l i 0 5 / ,
45
45
// terms
46
46
/ ^ # t p 0 0 1 / ,
47
- // scoped context on type
48
- / ^ # t c 0 1 2 / ,
49
47
// rel iri
50
48
/ ^ # t 0 0 9 5 /
51
49
]
@@ -76,8 +74,6 @@ const TEST_TYPES = {
76
74
// mode
77
75
/ ^ # t p 0 0 1 / ,
78
76
/ ^ # t p 0 0 2 / ,
79
- // scoped context on type
80
- / ^ # t c 0 1 1 / ,
81
77
// rel iri
82
78
/ ^ # t 0 0 9 2 / ,
83
79
// remote
You can’t perform that action at this time.
0 commit comments