sophia_api/lib.rs
1//! This crate provides a foundation,
2//! as a set of traits and core types,
3//! for building interoperable implementations of [RDF] and [Linked Data] in Rust.
4//!
5//! For an all-inclusive crate
6//! (providing actual implementations of the traits defined here),
7//! see [`sophia`](https://docs.rs/sophia/latest/sophia/).
8//!
9//! # RDF
10//!
11//! [RDF] is a data model
12//! designed to exchange knowledge on the Web
13//! in an interoperable way.
14//! Each piece of knowledge in RDF (a *statement*)
15//! is represented by a [triple], made of three [term]s.
16//! A set of [triple]s forms an RDF [graph].
17//! Finally, several [graph]s can be grouped in a collection
18//! called a [dataset], where each [graph] is identified by a unique name.
19//!
20//! [RDF]: https://www.w3.org/TR/rdf-primer/
21//! [Linked Data]: http://linkeddata.org/
22//!
23//! # Generalized vs. Strict RDF model
24//!
25//! The data model supported by this crate is in fact
26//! a superset of the RDF data model as defined by the W3C.
27//! When the distinction matters,
28//! they will be called, respectively,
29//! the *generalized* RDF model, and the *strict* RDF model.
30//!
31//! The generalized RDF model extends RDF as follows:
32//!
33//! * In addition to standard RDF terms (IRIs, blank nodes and literals),
34//! Sophia supports
35//!
36//! - RDF-star [quoted triples](https://www.w3.org/2021/12/rdf-star.html#dfn-quoted)
37//! - Variables (a concept borrowed from [SPARQL] or [Notation3])
38//!
39//! * Sophia allows any kind of term in any position (subject, predicate, object, graph name).
40//!
41//! * Sophia allow IRIs to be relative IRI references
42//! (while in strict RDF, [IRIs must be absolute](https://www.w3.org/TR/rdf11-concepts/#h3_section-IRIs)).
43//!
44//! # Feature gates
45//!
46//! - **test_macros**: with this feature enabled,
47//! this crate exposes macros that can help implementors of the API to test their implementation.
48//!
49//! [SPARQL]: https://www.w3.org/TR/sparql11-query/
50//! [Notation3]: https://www.w3.org/TeamSubmission/n3/
51#![deny(missing_docs)]
52
53pub mod dataset;
54pub mod graph;
55pub mod ns;
56pub mod parser;
57pub mod prefix;
58pub mod prelude;
59pub mod quad;
60pub mod serializer;
61pub mod source;
62pub mod sparql;
63pub mod term;
64pub mod triple;
65
66/// Re-export MownStr to avoid dependency version mismatch.
67///
68pub use mownstr::MownStr;