weso / shapes-rs

RDF data shapes implementation in Rust
https://www.weso.es/shapes-rs/
Apache License 2.0
23 stars 1 forks source link

Implement a converter of simple ShEx to SPARQL queries #67

Closed labra closed 1 week ago

labra commented 2 weeks ago

Some users are interested in converting simple ShEx shapes to SPARQL queries.

Of course, this conversion is not possible for complex ShEx, but it can be useful for simple cases and could be used, for example, for converting some Wikidata entity schemas to the skeleton of SPARQL queries that a user could later edit.

As an example, the following ShEx:

<Person> { 
 wdt:P31  [ wd:Q5 ]  ;
 wdt:P19  @<Place> * ;
}

could be converted to this SPARQL query:

SELECT * WHERE { 
 ?this wdt:P31 wd:Q5 .
 ?this wdt:P19 ?P19 .
}
labra commented 1 week ago

First implementation in PR #68 and added to release v0.0.13