Open rorlic opened 21 hours ago
FYI: the JSON-LD playground produces the same result for both examples:
<https://example.com/id/1> <http://example.com/#property> "anything" .
<https://example.com/id/1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/#something> .
<https://example.com/id/1> <http://www.w3.org/2000/01/rdf-schema#label> "A simple document" .
The referenced context is as follows:
{
"@context": {
"@base": "http://example.com/",
"@vocab": "#",
"label": "http://www.w3.org/2000/01/rdf-schema#label"
}
}
The root cause of the problem is the relative "@vocab": "#"
and can be fixed by prepending it with the @base
value, i.e. "@vocab": "http://example.com/#"
. Unfortunately, we do not always have control over the context so a fix in Titanium would be appreciated.
Describe the bug The
@base
is handled differently when referencing a context vs. when embedding a context. When using an embedded context containing a@base
, it is used - as expected - for creating a valid URI from relative properties and values. However, when referencing the same context, it seems that the@base
is not used, resulting in different behavior.To Reproduce In order to easy showcase the issue I use the latest Jena (5.2.0) command line tools which according to the Jena developers now use titanium.
Example files:
Pre-requisites:
set PATH=$PATH:{install-location}/bin
Steps to reproduce the behavior:
riot --base=http://should-not-happen.org embedded-context.jsonld
this results in:riot --base=http://should-not-happen.org referenced-context.jsonld
this results in:Expected behavior I would expect that both would return the same result as it should not make any difference if the context is embedded or referenced. Am I correct in my assumption or am I missing something here?