Closed lanfeust21 closed 4 years ago
@lanfeust21, either "http://schema.org" or "https://schema.org" are correct contexts for schema.org. "https://schema.org/Person" is not (it's a type). Please refer to schema.org for valid examples of JSON-LD for Person.
Maybe but it's the example given by the code i did not change anything. The change proposed, did not change anything and still create the same error
@lanfeust21 can you please provide a link to the example that uses
"@context": "https://schema.org/Person",
?
You reported that the proposed changes don't work either. I think I found the underlying reason. See https://github.com/schemaorg/schemaorg/issues/2578#issuecomment-632227864 for more information. schema.org's content negotiation has changed in May 2020. Since then, multiple fixes were proposed by various JSON-LD implementations, including https://github.com/RDFLib/rdflib/pull/1125 and https://github.com/lanthaler/JsonLD/commit/f8dff42283d8fb256c0380fc78fe4e585002991e.
Back to the issue, https://schema.org now returns the following Link in the header:
link: </docs/jsonldcontext.jsonld>; rel="alternate"; type="application/ld+json"
Currently, this library only supports rel="http://www.w3.org/ns/json-ld#context" as per JSON-LD 1.1 spec.
If you use the actual location of schema.org context:
"@context": "https://schema.org/docs/jsonldcontext.jsonld",
The example should work. Please note that it is considered the best practice to cache context documents in production applications.
We will add support for rel="alternate" in the next release. I can't provide ETA just yet.
Thanks for reporting.
The fix is in the master. It will be included in the next minor release.
panic: loading remote context failed: Dereferencing a URL did not result in a valid JSON-LD context: https://schema.org/Person
goroutine 1 [running]: main.main() /Users/denislamotte/Desktop/work/jsonld/jsonld.go:35 +0x578 exit status 2