Page MenuHomeDevCentral

Publish SPARQL client in Rust
Closed, ResolvedPublic

Description

FANTOIR uses SQARQL to query data from Wikidata.

Did you know there is no standalone SPARQL client crate currently available in Rust?

Our code uses the Tpt library sparesults, from the Oxigraph project, but there is no client component (as of January 2023).

Plan is to:

  • move services/sparql.rs to a standalone crate
  • add into_bool() method from P308
  • add unit test for other methods
  • refactor query to get an iterator, so we can directly apply HOF to HashMap<Variable, Term> to another item

Event Timeline

dereckson triaged this task as Wishlist priority.
dereckson created this task.
dereckson moved this task from New features to Working on on the Nasqueron Databases board.

The SPARQL client also depends of our HTTP client, so plan is to:

  • move from services/ the HTTP client to a crate ds-http-client
  • move from services/ the SPARQL client to a crate sparql-client
  • create new dependencies
    • sparql-client depends from ds-http-client
    • fantoir-datasource depends from sparql-client
    • fantoir-datasource depends from ds-http-client directly too to download file

The prefix ds- allows to identify crates offering services for our datasources project, when there is a need to disambiguate the names.

refactor query to get an iterator, so we can directly apply HOF to HashMap<Variable, Term> to another item

This is unclear, as QuerySolution already iterates to (Variable, Term) tuples.

If it applies to query() method directly, that methods returns SparqlResults, which can be either an iterable solution, either a boolean.

Crate seems ready for publishing with D3425, but ds-http-client needs to be published first.