w3c / hcls-fhir-rdf

Sketching out an RDF representation for FHIR
38 stars 15 forks source link

How do we discriminate polymorphic primitive types #138

Open ericprud opened 11 months ago

ericprud commented 11 months ago

Turtle filename

FHIR Resource URL of corresponding attribute on build.fhir.org, e.g. https://build.fhir.org/observation.html#a26.b

Observation.instantiates Observation.subject

ShEx shape @<Observation>~fhir:instantiates

Description Current definition of polymorphic types requires addition of either

Is e.g. xsd:date a representation of more than one primitive type? Are there any polymorphic properties that include those primitive types? (Will there ever be?)

What about primitive types that are xsd:strings?

à la:

  <Observation/123>
    #  instantiates Reference
    fhir:instantiates [
+      a fhir:Reference ; # type needed because fhir:instantiates is polymorphic
       fhir:link <http://example.org/fhir/PlanDefinition/KDN5> ; # current
       fhir:reference [
         fhir:v "http://example.org/fhir/PlanDefinition/KDN5"^^xsd:anyURI # note: no version on reference
      ]
    ] ; 
    #  instantiates canonical
    fhir:instantiates [
+      a fhir:canonical ; # type needed because fhir:instantiates is polymorphic
       fhir:link <http://example.org/fhir/PlanDefinition/KDN5?version=v123> ; # new with this proposal
       fhir:v "http://example.org/fhir/PlanDefinition/KDN5|v123"^^xsd:anyURI ;
    ] ; # 
dbooth-boston commented 10 months ago

AGREED to add type arc on today's call. See: https://www.w3.org/2024/01/04-hcls-irc#T16-46-55

ACTION: DBooth to draft edits of the rdf.html page

dbooth-boston commented 9 months ago

Reopened pending the merge of the actual fix.

dbooth-boston commented 1 week ago

Needs to be fixed in HAPI. @balhoff will work on it.

dbooth-boston commented 2 days ago

The xsd:anyURI definition seems to allow IRIs, but AFAICT http://example.org/fhir/PlanDefinition/KDN5|v123 is still not technically permissible because the pipe character is not syntactically allowed by RFC 3986/3987. However, xs:anyURI is the datatype shown by the FHIR spec, so this inconsistency seems to be an FHIR issue rather than a specifically FHIR RDF issue.