Haywood Slap
Haywood Slap

Reputation: 752

Unable to load a JSON-LD remote context

I am experimenting with JSON-LD and I am having a problem loading a remote context, I keep getting the error “Derefencing a URL did not result in a valid JSON-LD object”.

I have copied the context from http://json-ld.org/contexts/person to our server (http://vocab.lappsgrid.org/person.jsonld) and I am testing on the JSON-LD playground (http://json-ld.org/playground/). My first thought was that the content-type of the returned document is incorrect, but I’ve double checked and the content-type is application/ld+json so I do not know what else could be wrong; as far as I can tell the two contexts are identical, as are all relevant header fields.

Can anyone spot the problem?

Upvotes: 1

Views: 1237

Answers (2)

Haywood Slap
Haywood Slap

Reputation: 752

Yes, that was my post to the mailing list, and it was a problem with the CORS headers not being set correctly.

Upvotes: 0

Gregg Kellogg
Gregg Kellogg

Reputation: 1906

I think this was answered on the [email protected] mailing list. If you're expecting something like the JSON-LD playground to dereference your context, then you need to be sure CORS headers are set to allow access from someplace other than the site defining the context.

Upvotes: 4

Related Questions