inrupt / inrupt/solid-client-js
Turtle manipulation/validation
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 245
- Forks
- 42
- Avg merge
- 12h 49m
- Merged PRs (30d)
- 22
Description
Search terms you've used
Asked this question in Gitter chat. Was directed here to explain the use case.
Use Case
This is part question/feature-request.
I'm working on a prototype that extensively uses solid pods for storing/retrieving information.
Because I noticed most solid apps use schema names all over the place, I was trying to abstract away all the schema names, so potential app developers could work with datastructures without worrying about underlying schema's. In my case, I'm working on a project that involves Surveys. Based on the 'survey-ontology' (that can be found at https://cefriel.github.io/survey-ontology/docs/index.html), I'm in the process of creating a simple wrapper library to abstract away all the schema stuff (which is a public npm package for now: @consolidate/survey-ontology-ts. This package is Solid agnostic and its goals is to provide an interface for creating survey datastructures and don't worry about the underlying schemas: it can generate turtle files out of the survey you constructed with it.
However, I'm now noticing not every turtle file is solid compatible (or I'm building the wrong turtle files).
Whatever the case, I'm trying to convert my turtle files to valid SolidDatastructures. But there doesn't seem to be interfaces in the solid-client to deal with this. The only way to construct SOlidDatastructures is to use the interfaces provided by dealing with 'Quads' (which is part of the n3 library apparently).
Feature Request
It would certainly help to have some kind of 'processing' and/or 'validation' steps that can create SolidDatasets from turtle files directly. This would bypass the conversion from turtle >> quads >> load all quads in SolidDataset, and instead go directly from turtle >> SolidDataset. This could also potentially help if there is some build in validation of the provide turtlefile with helpfull messages regarding syntax and other errors.
(Another thing I noticed, is that, even though I'm able to add 'Quads' to an empty SolidDataset, that doesn't mean it's valid. When I try to save it to my solid-pod, I get a lot of errors telling me nothing was saved in the end without much further explanation. There is no build in 'validation'. You have to try and save it to know it's valid or not, but this validation step is maybe part of another feature request, so I'm leaving this here..)
Expected functionality/enhancement
Example usage:
try {
const solidDataset = SolidDataset.fromTurtle("...")
} catch (e) {
console.error("parsing errors: ", e)
}
So the fromTurtle could be a factory method:
class SolidDataset {
static fromTurtle(input: string): SolidDataset
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how SolidDataset is currently constructed from Quads supplied by the n3 library; the issue names no repository files or tests. Compare that path with the proposed SolidDataset.fromTurtle(input) entry point, and define done as producing a SolidDataset from Turtle while exposing useful parsing or validation errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, data
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100