Open dbooth-boston opened 11 months ago
ACTION: DBooth to figure out if this was promised for the R01 grant
I gave it a try in 2023. I tried to add a ShEx validator to the Playground UI. I did the work. However, I could not add the ShEx validation code to my implementation with my elementary web development skills. Please find my code at ShExValidator.txt. From a UI perspective, this solution is not visually appealing as it overwhelms the User Interface. I can propose here a better solution to add FHIR RDF validation capability to the Playground instead of directly adding a ShEx validator. The solution is just to get the RDF/N3 code and the ShEx code and generate a link to validate the N3 code using an external online ShEx validator like https://shex.io/webapps/shex.js/doc/shex-simple.html, https://rdfplayground.dcc.uchile.cl/, https://rdfshape.weso.es/shexValidate, and https://www.w3.org/2013/ShEx/FancyShExDemo. This reduces a lot the difficulty of this interesting problem.
The new proposal is to generate a button that redirects to a ShEx validation playground.
nt = playground.outputs['nquads'].getValue()
.ntriples = encodeURI(nt).replaceAll("#", "%23").replaceAll('"', "%22")
.shex_url = "https://build.fhir.org/" + document.querySelector(".active").querySelector("span").innerText.slice(0, document.querySelector(".active").querySelector("span").innerText.indexOf(" (")).toLowerCase() + ".shex"
."https://rdfshape.weso.es/shexValidate?data=" + ntriples + "&dataFormat=turtle&dataInference=NONE&dataSource=byText&schema=" + shex_url +"&schemaEngine=ShEx&schemaFormat=ShExJ&schemaSource=byUrl"
.There can be several problems in encoding nt
as a URL excerpt. But, they can be troubleshot.
I like this idea. I imagine it would limit the size of the data that could be validated, but the Playground already has that limitation, and it was never intended to handle large amounts of data anyway. We will have to see if we can find someone to work on it. I am tagging the issue as "help wanted".
Houcemeddin Turki might be able to work on this.