Closed AlasdairGray closed 5 years ago
This is not recognised as JSON-LD
{
"@id": "http://example.com/ex1",
"name": "Jane Doe"
}
This is recognised as JSON-LD and changed to nquads in the display
{
"@type": "http://schema.org/Person",
"name": "Jane Doe"
}
This should be recognised as JSON-LD but nothing happens
{
"@context": "http://schema.org/",
"@type": "http://schema.org/Person",
"name": "Jane Doe"
}
So @type
is required for the recognition of JSON-LD but @context
causes problems.
Using at @context
results in the following CORS error
Access to XMLHttpRequest at 'http://schema.org/' from origin 'http://localhost' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Need to enable CORS.
Using the chrome CORS extension as a workaround still does not solve the problem in this issue.
The problem now is that the resolving of the context is done asynchronously and the validation is complete before the context is loaded. The json-ld is now getting converted to nquads but not in time for it to be picked up by the rest of the Validata framework.
When JSON-LD is put in the input box, it is either not detected as JSON-LD or it fails to parse and replace the input.