rudof-project / rudof

RDF data shapes implementation in Rust
https://rudof-project.github.io
Apache License 2.0
40 stars 3 forks source link

Validate INSERT queries #199

Open labra opened 1 month ago

labra commented 1 month ago

A typical use case for RDF validation is to validate the RDF data that one wants to insert in a Triplestore.

As an example, imagine want wants to do the following:

INSERT DATA {
 GRAPH <http://example.org/> {
     <http://example.org/node1> <http://example.org/p> 1
 }
}

and there is a shape <S> such as:

prefix xsd: <http://www.w3.org/2001/XMLSchema#>

<S> { 
 <http://example.org/p> xsd:integer  
}

It would be nice to provide directly the INSERT query to the validator before inserting it in the triplestore.

There are two issues to take into account:

If there enough interest for this use case, we could implement it as we already have some of the building blocks, mainly, the SPARQL parser from Oxigraph, which could be used to extract the RDF data.

MarcAntoine-Arnaud commented 1 month ago

Some code is already there to handle first point: for SHACL here and SRDFSparql for Shex as the validator ask for a SRDF (reference)