Description
The way that the Value Expansion algorithm, steps 1
and 2
always construct node reference, even if value is not a string, which is pretty odd.
This came up in ShEx, where the term max
can take an integer, or the vocabulary term unbounded
, to represent unbounded cardinality:
{"@context": {
"shex": "http://shex.io/ns/shex#",
"max": {"@id": "shex:max", "@type": "@vocab"},
"unbounded": "shex:unbounded"},
"max": 2
}
Generally, when expanding a native value, it is retained, in this case, it results in the following:
[
{
"http://shex.io/ns/shex#max": [
{
"@id": "http://json-ld.org/playground/2"
}
]
}
]
I think instead, it should retain the value and expand as follows:
[
{
"http://shex.io/ns/shex#max": [
{
"@value": 2
}
]
}
]
This should stand for true
/false
and null
as well, to be consistent. Corrective text would be to add ", and value is a string
" to steps 1) and 2).
If the present behavior were intended (not as far as I remember), then it should have had text about coercing value to a string. There is provision in IRI expansion for a null
value, but nothing else.