我对JSON-LD 压缩以及它是否可用于压缩值的 IRI 感到有些困惑。
我有以下 JSON-LD 对象
{
"@context": {
"@base": "file:///",
"x": "https://example.org/pub/x#",
"x-attribute": "https://example.org/pub/x-attribute#",
"x:purpose": {
"@type": "@id"
}
},
"https://example.org/pub/x#purpose": "https://example.org/pub/x-attribute#on"
}
以及以下新上下文
{
"x": "https://example.org/pub/x#",
"x-attribute": "https://example.org/pub/x-attribute#"
}
我期待……并且想要……得到
{
"@context": {
"x": "https://example.org/pub/x#",
"x-attribute": "https://example.org/pub/x-attribute#"
},
"x:purpose": "x-attribute:on"
}
但我最终得到的是
{
"@context": {
"x": "https://example.org/pub/x#",
"x-attribute": "https://example.org/pub/x-attribute#"
},
"x:purpose": "https://example.org/pub/x-attribute#on"
}
如果你想试试这个,你可以把它插入JSON-LD Playground 。
我怎样才能完成我想做的事情?即基本上在价值位置使用紧凑型 IRI。