Regarding test tpi07, I can't figure out how the @index
handling should result in the expected test output.
Expansion algorithm step 13.8.3.7.2 seems like relevant code:
If container mapping includes
@index
,index key
is not@index
,item
does not have an entry@index
andexpanded index
is not@none
, initializeindex property values
to the concatenation ofexpanded index
with any existing values ofindex key
initem
. Add the key-value pair (expanded index
-index property values
) toitem
. Ifitem
is a value object, it MUST NOT contain any extra properties; aninvalid value object error
has been detected and processing is aborted.
I'm not sure why it checks index key
in item and not the expansion of index key
. but even that isn't enough, as 13.8.3.7.2 will still set the 'http://example.com/regular' key to:
[
"http://example.com/regular",
{
"@value": "foo"
}
]
The first value needs expansion, and the key being set here needs to change to 'http://example.com/prop' so it overrides the existing values.
I can get the test to pass by rewriting 13.8.3.7.2 to do something like this:
If container mapping includes
@index
,index key
is not@index
,item
does not have an entry@index
andexpanded index
is not@none
: Initializeexpanded index key
to the result of using the IRI Expansion algorithm, passingactive context
,index
, andtrue
for vocab. Initializeindex property values
to an array containing a map{'@value': index}
. Append any existing values ofexpanded index key
initem
toindex property values
. Add the key-value pair (expanded index key
-index property values
) to item. Ifitem
is a value object, it MUST NOT contain any extra properties; aninvalid value object error
has been detected and processing is aborted.
But I'm not sure what affect that might have on other tests/code paths.
w3c/json-ld-api#290