Hi, solid n00b here. I’m busy trying to proof a concept of integration between FHIR server and a SOLID pod. Where I’m stuck at the moment is directly uploading the response from a Patient query submitted to a FHIR server as a Thing into a SOLID POD on locally hosted SOLID server
@mornemaritz If you have time to debug, simply try to remove entries from the turtle file and simplify strings until it’s valid. This way you will know which line, symbols or chars cause the problem
The file itself seems to be valid turtle (this can be validated by running the following javascript code snippet)
import { Parser } from "n3";
const parser = new Parser({ format: 'text/turtle' });
async function main() {
const text = await (await fetch("http://fhirserver.hl7fundamentals.org/fhir/Patient/3?_format=ttl")).text()
console.log('file content', text)
const quads = parser.parse(text)
console.log(quads)
}
main();
and noting the the CSS server is parsing turtle using n3 under the hood.
I suspect the problem is that you or mashlib may be applying some incorrect escaping of the quotes or backslashes inside the literal on line 9 prior to saving.
From what I understand the issue is with the dots in minimized predicates.
Turtle is a flavor of RDF. Among other things it uses , ; . to parse the text
It look like you parsed a json file to make it turtle.
Do you made your ontology ?
fhir:Patient.name is not valid ttl <http://hl7.org/fhir/Patient.name> is valid
You must add more prefixes like : @prefix patient: <http://hl7.org/fhir/Patient.>.
with this patient:name is valid turtle.
This may be wrong (the prefix may not be valid ?) :
You must add more prefixes like : @prefix patient: <http://hl7.org/fhir/Patient.>.
with this patient:name is valid turtle.
@bourgeoa Whilst fhir:Patient.name is fairly malicious as a term I think it is valid turtle (if I am interpreting correctly it is permitted in the suffix according to RDF 1.1 Turtle); and N3.js seems to parse it fine as http://hl7.org/fhir/Patient.birthDate.
Hi @A_A, thank you very much for taking the time to respond so quickly. Apologies for the delay in my response. Because this is a side-project, I have very little time to spend on it.
I did try a while ago to trim the document down to the bare minimum which ended up being the only the prefix statements and the first line.
Something like this
That unfortunately did not succeed either. I do not recall the error and I did want to retry this approach but I somehow managed to completely destroy the pod I was hosting locally.
I’ve abandoned mashlib and I’m now attempting to make rest calls directly from insomnia (rest client UI) to a pod that I’ve registered on solidcommunity.net.
So far I’ve managed to authenticate. next step is to retrieve and update datasets,
hi @jeswr, thank you for taking the time to respond to my query.
I’ve abandoned mashlib and I’m now attempting to make rest calls directly from insomnia (rest client UI) to a pod that I’ve registered on solidcommunity.net.
I’ve taken note of your posted js code for when I need to parse turtle with the N3 parser though. I’m sure it will come in handy.