FHIR Chat · json-ld · implementers

Stream: implementers

Topic: json-ld


view this post on Zulip Grahame Grieve (Dec 25 2016 at 21:47):

@Josh Mandel - if I go to the json-ld playground and enter the json-ld below, I get an error dereferencing the context. Since the address is valid, I think it must be a CORS issue. is this something we can fix on build.fhir.org

{
  "@context": "http://build.fhir.org/Patient.jsonld",
  "@id": "http://hl7.org/fhir/Patient/example",
  "Patient.gender": {
    "code.value": "male"
  },
  "Patient.birthDate": {
    "date.value": "1974-12-25"
  }
}

view this post on Zulip Josh Mandel (Dec 26 2016 at 02:50):

Thanks for the report. If CORS Is the issue, we should be able to fix this easily enough.

view this post on Zulip Grahame Grieve (Dec 26 2016 at 05:23):

indeed. do we configure nginx centrally, or is there some file I should generate to make this happen?

view this post on Zulip Grahame Grieve (Dec 29 2016 at 10:34):

@Josh Mandel - this is time critical for me - any chance we can close this out?

view this post on Zulip Josh Mandel (Dec 29 2016 at 14:38):

Yikes, ok. Digging into this now

view this post on Zulip Josh Mandel (Dec 29 2016 at 14:43):

Ok, added:

        add_header 'Access-Control-Allow-Origin' '*';
        add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
        add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';

to /etc/nginx/sites-enabled/vhosts.conf. Note this file is managed with a tool ("Ansible"), so I've also updated https://github.com/hl7-fhir/fhir-svn/wiki/build.fhir.org to reflect

view this post on Zulip Josh Mandel (Dec 29 2016 at 14:45):

Do note though that (unrelated to CORS) I'm currently seeing:

$ curl -s 'http://build.fhir.org/Patient.jsonld' | json_pp
malformed JSON string, ...

view this post on Zulip Josh Mandel (Dec 29 2016 at 14:49):

EF BB BF at the start of the payload...

$ curl -s 'http://build.fhir.org/Patient.jsonld' | hexdump -C | head -n 1
00000000  ef bb bf 7b 0a 20 20 22  40 63 6f 6e 74 65 78 74  |...{.  "@context|

view this post on Zulip Grahame Grieve (Dec 29 2016 at 18:05):

thanks for that. The json-ld playground works - for a given meaning of works. I don't understand why starting with a standard UTF BOM would cause a claim of a malformed json string

view this post on Zulip Grahame Grieve (Dec 30 2016 at 19:34):

ok. so the json-ld playground is 'working' at least in terms of casual inspection. does anyone have any ideas how to qa the generated expressions?

view this post on Zulip Grahame Grieve (Dec 30 2016 at 20:06):

thanks to Gregg Kellogg, this sequence:
- read turtle file into Jena
- use ShEx to validate turtle file
- read json-ld file into Jena
- ask Jena to compare them


Last updated: Apr 12 2022 at 19:14 UTC