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

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:32:52 UTC