BD2KOnFHIR / fhirtordf

Python based FHIR to RDF conversion utility
Creative Commons Zero v1.0 Universal
15 stars 8 forks source link

Missing rdf:type for property values #22

Open bajrachar opened 3 years ago

bajrachar commented 3 years ago

If you run fhirtordf util on example patient json url --> http://hl7.org/fhir/R4/patient-example-f201-roel.json you get an rdf representation like follows -->

@prefix fhir: <http://hl7.org/fhir/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix sct: <http://snomed.info/id/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
<http://hl7.org/fhir/Patient/f201> a fhir:Patient ;
    fhir:nodeRole fhir:treeRoot ;
...

fhir:Patient.address [
        fhir:index "0"^^xsd:integer ;
        fhir:Address.city [
            fhir:value "Amsterdam"
        ] ;
        fhir:Address.country [
            fhir:value "NLD"
        ] ;
        fhir:Address.line [
            fhir:index "0"^^xsd:integer ;
            fhir:value "Bos en Lommerplein 280"
        ] ;
        fhir:Address.postalCode [
            fhir:value "1055RW"
        ] ;
        fhir:Address.use [
            fhir:value "home"
        ]
    ] ;

...

As you notice, the principal FHIR resource i.e. Patient has a rdf:type assigned as fhir:Patient class however the inner resources associated with property such as Addresses are missing an rdf:type. As a result, corresponding rdf graph seems to be missing an assigned type on these nodes: image

They show up as anonymous types on the graph. Would it be possible to assign types to these property value resources based on the range of the property.