My project is to build a solid server and then build a client app (with Node.js) to interact with that server. My server will store data with FHIR (a health data standard).
I reused the Community Solid Server and configured it for the server, but when I tried to build a client app, I had some questions:
FHIR data:
The HL7 company provides a FHIR vocabulary, but I don’t know how to import and use it to create data, like some rdf-common-vocabularies.
Are there any npm packages/projects that can help convert FHIR Json ↔ FHIR turtle (or just Json ↔ turtle)? I need it because when other client apps interact with my server, they usually use the JSON format, but Solid server must store RDF data.
I have seen many solid client apps, but in these apps, users have to enter a webID to give access to their data to client apps. However, I want users to just receive a notification and choose the option to accept/deny. Any suggestions?
For 2. the SOLID spec is about explicit consent of data sharing to allow applications to interact with user data. For just notifications, the notifications specification defines some ways to use notifications with static client credentials on the Inrupt server and the Community Solid server^6.0.0.
// in browser
// authenticated fetch
import { fetch } from '@inrupt/solid-client-authn-browser'
// within async function
// fetch document
const response = await fetch(uri, {
headers: { accept: 'application/ld+json' } // this is important
})
// get body in JSON format
const data = await response.json()
I tried it with both NSS and CSS and it works.
Depending on your needs, also check out LDO library. Especially useful if you build app that consumes RDF documents from Solid server. It allows you to read and write RDF data as TypeScript/JavaScript objects.
Thank you so much.
I read Vocabularies overview :Solid and i found that ArtifactGenerator can hepl but when i try it follow the document, it doesn’t work, just creating a js file with some name definition and no classes or properties like: const OBELISK = {
PREFIX: “obelisk”,
NAMESPACE: _NAMESPACE,
PREFIX_AND_NAMESPACE: { “obelisk”: “http://w3id.org/obelisk/” },
NS: _NS,
Have you ever try it and dit it work?
Thank you so much.
I read Vocabularies overview :Solid and i found that ArtifactGenerator can hepl but when i try it follow the document, it doesn’t work, just creating a js file with some name definition and no classes or properties like: const OBELISK = {
PREFIX: “obelisk”,
NAMESPACE: _NAMESPACE,
PREFIX_AND_NAMESPACE: { “obelisk”: “http://w3id.org/obelisk/” },
NS: _NS,
Have you ever try it and dit it work?
I tried that once, and apparently succeeded, but i remember setting it up was a pain. Are your source files in proper RDF+XML or Turtle or similar format? (i didn’t find a way to get that from FHIR)
I’m guessing the vocabulary may also need to be in a single file. Hard to say. edit: @Vincentfound that file. Very cool
Hopefully, folks from Inrupt may be able to help you more here.
"You can download the FHIR ontology from https://www.hl7.org/fhir/downloads.html. However, it includes many ontologies, and my database is quite simple. Therefore, I think I can try to set it up manually, like you suggested. But if I do that, although it can help my users create and modify their data, I cannot specify which terms or resources the client apps use when they send their data, even if it’s FHIR data. Thank you again for your help
Using fhir from rdf-namespaces solves the same problem as my manual method, only better. So please kindly ignore my solution in favor of rdf-namespaces.
If your needs go beyond exporting terms from the vocabulary, this won’t help much, unfortunately. If that’s the case, sorry for misunderstanding.
For step 4, if you wanted to associate some contact information with a user’s pod, I’d just use something like a Twilio API to send requests, and then consume those responses and have the server-side application determine what to do depending on the response to a text message, but there are definitely other solutions