Skip to content

Commit

Permalink
new crate sophia_sparql_client
Browse files Browse the repository at this point in the history
imported from pchampin/sophia_sparql_client
fixes #97
  • Loading branch information
pchampin committed Oct 25, 2024
1 parent 465885c commit 195ef34
Show file tree
Hide file tree
Showing 8 changed files with 1,305 additions and 28 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ sophia_iri = { version = "0.8.0", path = "./iri" }
sophia_isomorphism = { version = "0.8.0", path = "./isomorphism" }
sophia_jsonld = { version = "0.8.0", path = "./jsonld" }
sophia_resource = { version = "0.8.0", path = "./resource" }
sophia_sparql_client = { version = "0.8.0", path = "./sparql_client" }
sophia_rio = { version = "0.8.0", path = "./rio" }
sophia_term = { version = "0.8.0", path = "./term" }
sophia_turtle = { version = "0.8.0", path = "./turtle" }
Expand Down
62 changes: 35 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,35 @@ A Rust toolkit for RDF and Linked Data.

It comprises the following crates:

* [`sophia_api`] defines a generic API for RDF and linked data,
as a set of core traits and types;
more precisely, it provides traits for describing
- terms, triples and quads,
- graphs and datasets,
- parsers and serializers
* [`sophia_iri`] provides functions, types and traits for validating and resolving IRIs.
* [`sophia_inmem`] defines in-memory implementations of the `Graph` and `Dataset` traits from `sophia_api`.
* [`sophia_term`] defines various implementations of the `Term` trait from `sophia_api`.
* [`sophia_turtle`] provides parsers and serializers for the Turtle-family of concrete syntaxes.
* [`sophia_xml`] provides parsers and serializers for RDF/XML.
* [`sophia_jsonld`] provides preliminary support for JSON-LD.
* [`sophia_c14n`] implements [RDF canonicalization].
* [`sophia_resource`] provides a resource-centric API.
* [`sophia_rio`] is a lower-level crate, used by the ones above.

and finally:
* [`sophia`] is the “all-inclusive” crate,
re-exporting symbols from all the crates above.
(actually, `sophia_xml` is only available if the `xml` feature is enabled)
* Core crates:
+ [`sophia_api`] defines a generic API for RDF and linked data,
as a set of core traits and types;
more precisely, it provides traits for describing
- terms, triples and quads,
- graphs and datasets,
- parsers and serializers
+ [`sophia_iri`] provides functions, types and traits for validating and resolving IRIs.
+ [`sophia_term`] defines various implementations of the `Term` trait from `sophia_api`.
+ [`sophia_inmem`] defines in-memory implementations of the `Graph` and `Dataset` traits from `sophia_api`.
* Parsers and serializers
+ [`sophia_turtle`] provides parsers and serializers for the Turtle-family of concrete syntaxes.
+ [`sophia_jsonld`] provides parsers and serializers for JSON-LD.
+ [`sophia_xml`] provides parsers and serializers for RDF/XML.
+ [`sophia_rio`] is a lower-level crate, used by the ones above.
* Other
+ [`sophia_c14n`] implements [RDF canonicalization].
+ [`sophia_isomorphism`] provides functions to determine if two graphs or datasets are [isomorphic].
+ [`sophia_sparql_client`] provides a client for the [SPARQL 1.1 Protocol].
+ [`sophia_resource`] provides a resource-centric API.
* All-inclusive
+ [`sophia`] re-exports symbols from all the crates above, with the following provisio:
- `sophia_jsonld` is only available with the `jsonld` feature
- `sophia_sparql_client` is only available with the `http_client` feature
- `sophia_xml` is only available with the `xml` feature

In addition to the [API documentation](https://docs.rs/sophia/),
a high-level [user documentation](https://pchampin.github.io/sophia_rs/) is available (although not quite complete yet).

## Licence

[CECILL-B] (compatible with BSD)
Expand Down Expand Up @@ -72,18 +77,21 @@ An outdated comparison of Sophia with other RDF libraries is still available


[`sophia_api`]: https://crates.io/crates/sophia_api
[`sophia_iri`]: https://crates.io/crates/sophia_iri
[`sophia_term`]: https://crates.io/crates/sophia_term
[`sophia_c14n`]: https://crates.io/crates/sophia_c14n
[`sophia_inmem`]: https://crates.io/crates/sophia_inmem
[`sophia_term`]: https://crates.io/crates/sophia_inmem
[`sophia_turtle`]: https://crates.io/crates/sophia_turtle
[`sophia_xml`]: https://crates.io/crates/sophia_xml
[`sophia_iri`]: https://crates.io/crates/sophia_iri
[`sophia_isomorphism`]: https://crates.io/crates/sophia_isomorphism
[`sophia_jsonld`]: https://crates.io/crates/sophia_jsonld
[`sophia_c14n`]: https://crates.io/crates/sophia_c14n
[`sophia_resource`]: https://crates.io/crates/sophia_resource
[`sophia_rio`]: https://crates.io/crates/sophia_rio
[`sophia_sparql_client`]: https://crates.io/crates/sophia_sparql_client
[`sophia_term`]: https://crates.io/crates/sophia_inmem
[`sophia_turtle`]: https://crates.io/crates/sophia_turtle
[`sophia_xml`]: https://crates.io/crates/sophia_xml
[`sophia`]: https://crates.io/crates/sophia
[CECILL-B]: https://cecill.info/licences/Licence_CeCILL-B_V1-en.html
[RDF test-suite]: https://github.com/w3c/rdf-tests/
[JSON-LD test-suite]: https://github.com/w3c/json-ld-api/
[RDF canonicalization]: https://www.w3.org/TR/rdf-canon/
[SPARQL 1.1 protocol]: https://www.w3.org/TR/sparql11-protocol
[isomorphic]: https://www.w3.org/TR/rdf11-concepts/#h3_graph-isomorphism
3 changes: 2 additions & 1 deletion sophia/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ test_macro = ["sophia_api/test_macro"]
# This feature enables the file: URL support in dependencies
file_url = ["sophia_jsonld/file_url", "sophia_resource/file_url"]
# This feature enables the HTTP client in dependencies
http_client = ["sophia_jsonld/http_client", "sophia_resource/http_client"]
http_client = ["dep:sophia_sparql_client", "sophia_jsonld/http_client", "sophia_resource/http_client"]

[dependencies]
sophia_iri.workspace = true
Expand All @@ -34,6 +34,7 @@ sophia_c14n.workspace = true
sophia_isomorphism.workspace = true
sophia_jsonld = { workspace = true, optional = true }
sophia_resource.workspace = true
sophia_sparql_client = { workspace = true, optional = true }
sophia_rio.workspace = true
sophia_turtle.workspace = true
sophia_term.workspace = true
Expand Down
4 changes: 4 additions & 0 deletions sophia/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
//! * [`isomorphism`]
//! * [`jsonld`] (with the `jsonld` feature enabled)
//! * [`resource`]
//! * [`sparql_client`] (with the `http_client` feature enabled)
//! * [`turtle`]
//! * [`term`]
//! * [`xml`] (with the `xml` feature enabled)
Expand Down Expand Up @@ -39,6 +40,9 @@ pub use sophia_isomorphism as isomorphism;
pub use sophia_jsonld as jsonld;
#[doc(inline)]
pub use sophia_resource as resource;
#[cfg(feature = "http_client")]
#[doc(inline)]
pub use sophia_sparql_client as sparql_client;
#[doc(inline)]
pub use sophia_term as term;
#[doc(inline)]
Expand Down
32 changes: 32 additions & 0 deletions sparql_client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[package]
name = "sophia_sparql_client"
description = "A Rust toolkit for RDF and Linked Data - Core API"
documentation = "https://docs.rs/sophia_api"
version.workspace = true
authors.workspace = true
edition.workspace = true
repository.workspace = true
readme.workspace = true
license.workspace = true
keywords.workspace = true

[package.metadata.docs.rs]
all-features = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
sophia_api.workspace = true
sophia_iri.workspace = true
sophia_turtle.workspace = true
sophia_xml.workspace = true
quick-xml = "0.36"
reqwest = { version = "0.12", features = ["blocking", "json"] }
rio_turtle.workspace = true
rio_xml.workspace = true
serde.workspace = true
serde_json = "1.0"
thiserror.workspace = true

[dev-dependencies]
sophia_isomorphism.workspace = true
Loading

0 comments on commit 195ef34

Please sign in to comment.