W3C home > Mailing lists > Public > public-linked-json@w3.org > March 2015

Re: [FHIR JSON-LD] Different mappings for different nestings? And implied triples?

From: David Booth <david@dbooth.org>
Date: Mon, 16 Mar 2015 23:41:34 -0400
Message-ID: <5507A26E.6020801@dbooth.org>
To: Linked JSON <public-linked-json@w3.org>, Jim McCusker <mccusj@rpi.edu>
CC: Markus Lanthaler <markus.lanthaler@gmx.net>, msporny@digitalbazaar.com
P.S. Here is another example, simplified from
http://hl7-fhir.github.io/observation-example.json.html
Notice that "code" is used in different ways at different nesting 
levels.   What is the best way to handle this, in order to cause "code" 
to be mapped to different RDF properties with different ranges?

{
   "resourceType": "Observation",
   "code": {
     "coding": [
       {
         "system": "http://loinc.org",
         "code": "3141-9"
       }
     ]
   }
}

Thanks,
David Booth

On 03/16/2015 11:32 PM, David Booth wrote:
> 1. (Nesting)  In FHIR, the same JSON element may have different content
> and meaning when it appears in different JSON objects.  I would like to
> map them to different RDF properties.  What is the best way to do this?
>    For example, a FHIR AdverseReaction resource may contain a nested
> "code" element that holds an object:
>
> {
>    "resourceType": "Alert",
>    ...
>    "symptom":[{"code":{"coding": ...
> }
>
> whereas a FHIR ConceptMap resource may contain a "code" element that
> holds a string:
>
> {
>    "resourceType": "ConceptMap",
>    ...
>    "concept": [
>      {
>        "system": "http://hl7.org/fhir/address-use",
>        "code": "home",
>        ...
> }
>
> I would like to process AdverseReaction.code differently than
> ConceptMap.code .   Would I have to use a different @context for each
> resource type, like this, or is there a better way?
>
> {
>    "@context": "http://example/fhir/Alert",
>    "resourceType": "Alert",
>    ...
> }
>
> and
>
> {
>    "@context": "http://example/fhir/ConceptMap",
>    "resourceType": "ConceptMap",
>    ...
> }
>
> 2. (Implied triples)  If that is the best way to do it, is there some
> way to reduce the redundancy, so that the "resourceType" line does not
> have to be included in the instance data and the @context will still
> generate the same RDF?  For example, assuming that the following JSON
>
> {
>    "@context": "http://example/fhir/ConceptMap",
>    "resourceType": "ConceptMap",
>    "foo": "bar"
> }
>
> causes this RDF to be generated:
>
>    _:b1 fhir:resourceType fhir:ConceptMap .
>    _:b1 fhir:foo "bar" .
>
> Is there some way to make the @context generate the same RDF from the
> following JSON?
>
> {
>    "@context": "http://example/fhir/ConceptMap",
>    "foo": "bar"
> }
>
> Thanks,
> David Booth
Received on Tuesday, 17 March 2015 03:42:03 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:18:44 UTC