@base treats trailing hash ('#') different from slash '/' #915
-
{
"@context": {
"@version": 1.1,
"@base":"http://example.com/vocab/",
"name": {"@id": "http://example.com/vocab#test", "@type": "@id"}
},
"@id": "http://example.org/places#BrewEats",
"@type": "Restaurant",
"name": "Restaurant"
}expands to [
{
"@id": "http://example.org/places#BrewEats",
"@type": [
"http://example.com/vocab/Restaurant"
],
"http://example.com/vocab#test": [
{
"@id": "http://example.com/vocab/Restaurant"
}
]
}
](playground) {
"@context": {
"@version": 1.1,
"@base":"http://example.com/vocab#",
"name": {"@id": "http://example.com/vocab#test", "@type": "@id"}
},
"@id": "http://example.org/places#BrewEats",
"@type": "Restaurant",
"name": "Restaurant"
}ignores the hash and falls back to the last slash [
{
"@id": "http://example.org/places#BrewEats",
"@type": [
"http://example.com/Restaurant"
],
"http://example.com/vocab#test": [
{
"@id": "http://example.com/Restaurant"
}
]
}
]Is this behaviour intended? I did not found any hint in the spec |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
|
This follows RFC3987 resolution of IRI references, which does not have special provision for IRIs ending with
|
Beta Was this translation helpful? Give feedback.
-
|
Thank you for the clarification. So there is no way to use a vocabulary that uses {"type": "string"}to {"type": "http://www.w3.org/2001/XMLSchema#string"}? |
Beta Was this translation helpful? Give feedback.
-
|
Certainly, you can use
|
Beta Was this translation helpful? Give feedback.
Certainly, you can use
@vocabfor thins like@typeIRI expansion.@typeis special as it can expand either relative to the vocabulary or document base. Vocabulary expansion, also used for keys, uses string concatenation, rather than IRI resolution, for this purpose.@baseis used to override the document location, for entities described within that document.