w3c / hcls-fhir-rdf

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

R5 cleanup: Update the FHIR build process to reflect R5 RDF changes #110

Closed dbooth-boston closed 11 months ago

dbooth-boston commented 1 year ago

RDF model changes made in R5:

From Lloyd in zulip on 14-Nov-2022: "Final content freeze is slated for Feb. 24, 2023"

R5 bug fixes:

Artifacts to be updated:

Concept IRI tasks:

7/27/23: Gaurav is following up on these:

Update process:

  1. Create jira tickets for desired changes. But do not assign to self (or it goes into "Waiting for Input" state) until AFTER it is resolved and voted!
  2. Get ITS to vote them (done 17-Aug-2022 for substantive changes; need to do it also for editorial changes)
  3. Submit a PR for the proposed change (which will normally be merged by yourself)
  4. Wait for automated build checks to pass
  5. Merge the PR
  6. In Jira, use Workflow->Will Update Spec to record the vote and resolution. In Jira, use "Propose Disposition" button to propose a resolution and mark the changes a pre-applied. Also record the commit tag in a comment. (Sometimes this can be done before ITS votes, e.g., if it's fixing a typo, in which case the ticket should be marked 'Pre-applied'. But major code changes should be voted by ITS first.)
  7. (If UTG proposal for THO update): (Jira ticket will have "up-" prefix.) Get it into "consensus review" state, then get people to vote it. Once enough votes are in favor, THO will take it from there.
  8. DONE!

NOTE: Editorial changes that follow the spirit of the semantic change decision are also okay. Make a note of what is done. If it appears that the voted decision was incorrect, then it needs to go back to ITS for vote again.

balhoff commented 1 year ago

Here is my candidate SPARQL update for transforming RDF lists to a different namespace (to avoid OWL spec violations). This update should only be applied to an RDF file where all the lists are "data", and not part of OWL axiom definitions.

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX fhir: <http://hl7.org/fhir/>
DELETE {
  ?list rdf:first ?item .
  ?list rdf:rest ?rest .
}
INSERT {
  ?list ?first_pred ?item .
  ?list fhir:rdfRest ?rest_obj .
}
WHERE {
  ?list rdf:first ?item .
  ?list rdf:rest ?rest .
  BIND(IF(isLiteral(?item), fhir:rdfFirstLiteral, fhir:rdfFirst) AS ?first_pred)
  BIND(IF(?rest = rdf:nil, fhir:rdfNil, ?rest) AS ?rest_obj)
}

Test input:

@prefix : <http://example.org/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

:a :has_addresses (
    [
      :street "1428 Elm Street" ;
      :state :Ohio
    ]
    [
      :street "2400 Fulton Street" ;
      :state :California
    ]
    "Sesame Street"
    :PlanetEarth
  ) ;
  rdfs:label "Person A" .

Test output:

@prefix :     <http://example.org/> .
@prefix fhir: <http://hl7.org/fhir/> .
@prefix rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

:a      rdfs:label      "Person A" ;
        :has_addresses  [ fhir:rdfFirst  [ :state   :Ohio ;
                                           :street  "1428 Elm Street"
                                         ] ;
                          fhir:rdfRest   [ fhir:rdfFirst  [ :state   :California ;
                                                            :street  "2400 Fulton Street"
                                                          ] ;
                                           fhir:rdfRest   [ fhir:rdfFirstLiteral  "Sesame Street" ;
                                                            fhir:rdfRest          [ fhir:rdfFirst  :PlanetEarth ;
                                                                                    fhir:rdfRest   fhir:rdfNil
                                                                                  ]
                                                          ]
                                         ]
                        ] .
dbooth-boston commented 1 year ago

@balhoff , how about adding another condition to the WHERE clause to ensure that it is applied only to FHIR lists (and not part of OWL axiom definitions)?

balhoff commented 1 year ago

@balhoff , how about adding another condition to the WHERE clause to ensure that it is applied only to FHIR lists (and not part of OWL axiom definitions)?

@dbooth-boston good idea, I've got a revision now. Do we have a proper location to put this in our repo? In here? https://github.com/w3c/hcls-fhir-rdf/tree/gh-pages/scripts

gaurav commented 1 year ago

Concept IRI tasks:

dbooth-boston commented 11 months ago

Done (enough) or moved to separate issues for remaining portions.