Releases v0.4.0-alpha.1

pull/715/head v0.4.0-alpha.1
Tpt 11 months ago committed by Thomas Tanon
parent a84b898fda
commit a5781d1187
  1. 12
      .github/workflows/artifacts.yml
  2. 55
      CHANGELOG.md
  3. 76
      Cargo.lock
  4. 2
      Cargo.toml
  5. 2
      cli/Cargo.toml
  6. 2
      js/Cargo.toml
  7. 14
      lib/Cargo.toml
  8. 8
      lib/README.md
  9. 4
      lib/oxrdf/Cargo.toml
  10. 2
      lib/oxrdf/README.md
  11. 10
      lib/oxrdfio/Cargo.toml
  12. 2
      lib/oxrdfio/README.md
  13. 7
      lib/oxrdfio/src/parser.rs
  14. 32
      lib/oxrdfio/src/serializer.rs
  15. 6
      lib/oxrdfxml/Cargo.toml
  16. 2
      lib/oxrdfxml/README.md
  17. 2
      lib/oxsdatatypes/Cargo.toml
  18. 6
      lib/oxttl/Cargo.toml
  19. 3
      lib/oxttl/src/nquads.rs
  20. 3
      lib/oxttl/src/trig.rs
  21. 3
      lib/oxttl/src/turtle.rs
  22. 4
      lib/sparesults/Cargo.toml
  23. 3
      lib/sparesults/README.md
  24. 32
      lib/sparesults/src/serializer.rs
  25. 4
      lib/spargebra/Cargo.toml
  26. 6
      lib/sparopt/Cargo.toml
  27. 2
      lib/sparql-smith/Cargo.toml
  28. 2
      lib/src/io/mod.rs
  29. 8
      lib/src/io/write.rs
  30. 42
      lib/src/store.rs
  31. 2
      python/Cargo.toml
  32. 13
      python/docs/migration.rst

@ -351,12 +351,24 @@ jobs:
- run: cargo publish
working-directory: ./lib/oxrdf
continue-on-error: true
- run: cargo publish
working-directory: ./lib/oxrdfxml
continue-on-error: true
- run: cargo publish
working-directory: ./lib/oxttl
continue-on-error: true
- run: cargo publish
working-directory: ./lib/oxrdfio
continue-on-error: true
- run: cargo publish
working-directory: ./lib/sparesults
continue-on-error: true
- run: cargo publish
working-directory: ./lib/spargebra
continue-on-error: true
- run: cargo publish
working-directory: ./lib/sparopt
continue-on-error: true
- run: cargo publish
working-directory: ./lib/sparql-smith
continue-on-error: true

@ -1,3 +1,58 @@
## [0.4.0-alpha.1] - 2024-01-03
### Added
- `sparopt` crate: A new still quite naive query optimizer.
- `oxttl` crate: A N-Triples/N-Quads/Turtle/TriG/N3 parser and serializer compatible with Tokio.
- `oxrdfxml` crate: A RDF/XML parser and serializer compatible with Tokio.
- `oxrdfio` crate: A stand-alone crate with oxigraph I/O related APIs.
- Rust: SPARQL results I/O is now exposed in the `oxigraph` crate (`oxigraph::sparql::results` module).
- Rust: It is now possible to dynamically link rocksdb with the `rocksdb-pkg-config` feature.
- Python: error location is now included in some `SyntaxError` exceptions.
- Python: the file type can be guessed from the file path extension during parsing and serialization.
- Python: the serialization method returns a `bytes` value if no output-related argument is given.
- Python: SPARQL query results I/O is now exposed (`parse_query_results` function and `.serialize` method).
- Python: `RdfFormat` and `QueryResultsFormat` enum to encode supported formats.
- CLI: a `convert` command to convert RDF file between different formats.
### Removed
- Rust: automated flush at the end of serialization. This should be done explicitly now.
- oxsdatatypes: Deprecated methods.
- Python: 3.7 and Musl linux 1.1 support.
- Python: `GraphName.value`.
### Changed
- SPARQL: a digit after `.` is now required for `xsd:decimal`.
- SPARQL: calendar subtraction returns `xsd:dayTimeDuration` and not `xsd:duration`.
- SPARQL: Unicode escapes (`\u` and `\U`) are now only supported in IRIs and strings and not everywhere.
- Literal serialization now produces canonical N-Triples according to the RDF 1.2 and RDF Dataset Canonicalization drafts
- Rust: MSRV is now 1.70.
- Rust Makes `GraphName` implement `Default`.
- Rust: `wasm32-unknown-unknown` does not assumes JS platform by default. Enable the `js` feature for that.
- Rust: Parsers take `Read` and not `BufRead` for input.
- Rust: `GraphFormat` and `DatasetFormat` have been merged into `RdfFormat`.
- Rust: `GraphParser` and `DatasetParser` have been merged into `RdfParser`.
- Rust: `GraphSerializer` and `DatasetSerializer` have been merged into `RdfSerializer`.
- Rust: query results are now `Send` and `Sync`.
- Rust: `Store.load_graph` and `Store.load_dataset` have been merged into a `load_from_read` method.
- Rust: `Store.dump_graph` and `Store.dump_dataset` have been renamed to `dump_graph_to_write` and `dump_to_write`.
- Rust: `BulkLoader.set_*` methods have been renamed to `BulkLoader.with_*`.
- oxsdatatypes: pass by-values instead of by-reference parameters when relevant.
- oxsdatatypes: error types have been redesigned.
- oxsdatatypes: return an error when building not serializable duration (year-month and day-time of opposite signs).
- sparesults: renames some methods to move closer to the new oxrdfio crate.
- Python: raise `OSError` instead of `IOError` on OS errors.
- Python: the `mime_type` parameter have been renamed to `format`.
- Python: boolean SPARQL results are now encoded with a `QueryBoolean` class and not a simple `bool`.
- Python: a `path` parameter has been added to all I/O method to read from a file.
The existing `input` parameter now consider `str` values to be a serialization to parse.
- JS: the `mime_type` parameter have been renamed to `format`.
- CLI: the `oxigraph_server` binary has been renamed to `oxigraph`.
- CLI: the `--location` argument is now part of sub-commands where it is relevant.
`oxigraph_server --location foo serve` is not possible anymore.
One need to write `oxigraph serve --location foo`.
- CLI: is is now possible to upload gzip encoded files to the HTTP API with the `Content-Encoding: gzip` header.
## [0.3.22] - 2023-11-29
### Changed

76
Cargo.lock generated

@ -82,9 +82,9 @@ dependencies = [
[[package]]
name = "anyhow"
version = "1.0.78"
version = "1.0.79"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca87830a3e3fb156dc96cfbd31cb620265dd053be734723f22b760d6cc3c3051"
checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca"
[[package]]
name = "arbitrary"
@ -279,9 +279,9 @@ dependencies = [
[[package]]
name = "clang-sys"
version = "1.6.1"
version = "1.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f"
checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1"
dependencies = [
"glob",
"libc",
@ -837,12 +837,12 @@ checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4"
[[package]]
name = "libloading"
version = "0.7.4"
version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f"
checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161"
dependencies = [
"cfg-if",
"winapi 0.3.9",
"windows-sys 0.48.0",
]
[[package]]
@ -1033,7 +1033,7 @@ dependencies = [
[[package]]
name = "oxigraph"
version = "0.4.0-alpha.1-dev"
version = "0.4.0-alpha.1"
dependencies = [
"codspeed-criterion-compat",
"digest",
@ -1063,7 +1063,7 @@ dependencies = [
[[package]]
name = "oxigraph-cli"
version = "0.4.0-alpha.1-dev"
version = "0.4.0-alpha.1"
dependencies = [
"anyhow",
"assert_cmd",
@ -1082,7 +1082,7 @@ dependencies = [
[[package]]
name = "oxigraph-js"
version = "0.4.0-alpha.1-dev"
version = "0.4.0-alpha.1"
dependencies = [
"console_error_panic_hook",
"js-sys",
@ -1092,7 +1092,7 @@ dependencies = [
[[package]]
name = "oxigraph-testsuite"
version = "0.4.0-alpha.1-dev"
version = "0.4.0-alpha.1"
dependencies = [
"anyhow",
"clap",
@ -1119,7 +1119,7 @@ checksum = "b225dad32cfaa43a960b93f01fa7f87528ac07e794b80f6d9a0153e0222557e2"
[[package]]
name = "oxrdf"
version = "0.2.0-alpha.1-dev"
version = "0.2.0-alpha.1"
dependencies = [
"oxilangtag",
"oxiri",
@ -1129,7 +1129,7 @@ dependencies = [
[[package]]
name = "oxrdfio"
version = "0.1.0-alpha.1-dev"
version = "0.1.0-alpha.1"
dependencies = [
"oxrdf",
"oxrdfxml",
@ -1139,7 +1139,7 @@ dependencies = [
[[package]]
name = "oxrdfxml"
version = "0.1.0-alpha.1-dev"
version = "0.1.0-alpha.1"
dependencies = [
"oxilangtag",
"oxiri",
@ -1150,7 +1150,7 @@ dependencies = [
[[package]]
name = "oxrocksdb-sys"
version = "0.4.0-alpha.1-dev"
version = "0.4.0-alpha.1"
dependencies = [
"bindgen",
"cc",
@ -1160,14 +1160,14 @@ dependencies = [
[[package]]
name = "oxsdatatypes"
version = "0.2.0-alpha.1-dev"
version = "0.2.0-alpha.1"
dependencies = [
"js-sys",
]
[[package]]
name = "oxttl"
version = "0.1.0-alpha.1-dev"
version = "0.1.0-alpha.1"
dependencies = [
"memchr",
"oxilangtag",
@ -1323,9 +1323,9 @@ dependencies = [
[[package]]
name = "prettyplease"
version = "0.2.15"
version = "0.2.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d"
checksum = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5"
dependencies = [
"proc-macro2",
"syn",
@ -1333,9 +1333,9 @@ dependencies = [
[[package]]
name = "proc-macro2"
version = "1.0.72"
version = "1.0.74"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a293318316cf6478ec1ad2a21c49390a8d5b5eae9fab736467d93fbc0edc29c5"
checksum = "2de98502f212cfcea8d0bb305bd0f49d7ebdd75b64ba0a68f937d888f4e0d6db"
dependencies = [
"unicode-ident",
]
@ -1403,7 +1403,7 @@ dependencies = [
[[package]]
name = "pyoxigraph"
version = "0.4.0-alpha.1-dev"
version = "0.4.0-alpha.1"
dependencies = [
"oxigraph",
"pyo3",
@ -1421,9 +1421,9 @@ dependencies = [
[[package]]
name = "quote"
version = "1.0.33"
version = "1.0.35"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae"
checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef"
dependencies = [
"proc-macro2",
]
@ -1664,18 +1664,18 @@ dependencies = [
[[package]]
name = "serde"
version = "1.0.193"
version = "1.0.194"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89"
checksum = "0b114498256798c94a0689e1a15fec6005dee8ac1f41de56404b67afc2a4b773"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
version = "1.0.193"
version = "1.0.194"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3"
checksum = "a3385e45322e8f9931410f01b3031ec534c3947d0e94c18049af4d9f9907d4e0"
dependencies = [
"proc-macro2",
"quote",
@ -1684,9 +1684,9 @@ dependencies = [
[[package]]
name = "serde_json"
version = "1.0.108"
version = "1.0.110"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b"
checksum = "6fbd975230bada99c8bb618e0c365c2eefa219158d5c6c29610fd09ff1833257"
dependencies = [
"itoa",
"ryu",
@ -1735,7 +1735,7 @@ checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970"
[[package]]
name = "sparesults"
version = "0.2.0-alpha.1-dev"
version = "0.2.0-alpha.1"
dependencies = [
"json-event-parser",
"memchr",
@ -1746,7 +1746,7 @@ dependencies = [
[[package]]
name = "spargebra"
version = "0.3.0-alpha.1-dev"
version = "0.3.0-alpha.1"
dependencies = [
"oxilangtag",
"oxiri",
@ -1757,7 +1757,7 @@ dependencies = [
[[package]]
name = "sparopt"
version = "0.1.0-alpha.1-dev"
version = "0.1.0-alpha.1"
dependencies = [
"oxrdf",
"rand",
@ -1766,7 +1766,7 @@ dependencies = [
[[package]]
name = "sparql-smith"
version = "0.1.0-alpha.5-dev"
version = "0.1.0-alpha.5"
dependencies = [
"arbitrary",
]
@ -1791,9 +1791,9 @@ checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc"
[[package]]
name = "syn"
version = "2.0.43"
version = "2.0.46"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ee659fb5f3d355364e1f3e5bc10fb82068efbf824a1e9d1c9504244a6469ad53"
checksum = "89456b690ff72fddcecf231caedbe615c59480c93358a93dfae7fc29e3ebbf0e"
dependencies = [
"proc-macro2",
"quote",
@ -1802,9 +1802,9 @@ dependencies = [
[[package]]
name = "target-lexicon"
version = "0.12.12"
version = "0.12.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "14c39fd04924ca3a864207c66fc2cd7d22d7c016007f9ce846cbb9326331930a"
checksum = "69758bda2e78f098e4ccb393021a0963bb3442eac05f135c30f61b7370bbafae"
[[package]]
name = "tempfile"

@ -19,7 +19,7 @@ members = [
resolver = "2"
[workspace.package]
version = "0.4.0-alpha.1-dev"
version = "0.4.0-alpha.1"
authors = ["Tpt <thomas@pellissier-tanon.fr>"]
license = "MIT OR Apache-2.0"
homepage = "https://oxigraph.org/"

@ -29,7 +29,7 @@ rustls-webpki = ["oxigraph/http-client-rustls-webpki"]
anyhow = "1.0.72"
oxhttp = { version = "0.2.0-alpha.3", features = ["flate2"] }
clap = { version = "4.0", features = ["derive"] }
oxigraph = { version = "0.4.0-alpha.1-dev", path = "../lib" }
oxigraph = { version = "0.4.0-alpha.1", path = "../lib" }
rand = "0.8"
url = "2.4"
oxiri = "0.2.3-alpha.1"

@ -16,7 +16,7 @@ crate-type = ["cdylib"]
name = "oxigraph"
[dependencies]
oxigraph = { version = "0.4.0-alpha.1-dev", path="../lib", features = ["js"] }
oxigraph = { version = "0.4.0-alpha.1", path="../lib", features = ["js"] }
wasm-bindgen = "0.2.83"
js-sys = "0.3.60"
console_error_panic_hook = "0.1.7"

@ -32,21 +32,21 @@ json-event-parser = "0.2.0-alpha.2"
md-5 = "0.10"
oxilangtag = "0.1"
oxiri = "0.2.3-alpha.1"
oxrdf = { version = "0.2.0-alpha.1-dev", path = "oxrdf", features = ["rdf-star", "oxsdatatypes"] }
oxrdfio = { version = "0.1.0-alpha.1-dev", path = "oxrdfio", features = ["rdf-star"] }
oxsdatatypes = { version = "0.2.0-alpha.1-dev", path="oxsdatatypes" }
oxrdf = { version = "0.2.0-alpha.1", path = "oxrdf", features = ["rdf-star", "oxsdatatypes"] }
oxrdfio = { version = "0.1.0-alpha.1", path = "oxrdfio", features = ["rdf-star"] }
oxsdatatypes = { version = "0.2.0-alpha.1", path="oxsdatatypes" }
rand = "0.8"
regex = "1.7"
sha1 = "0.10"
sha2 = "0.10"
siphasher = ">=0.3, <2.0"
sparesults = { version = "0.2.0-alpha.1-dev", path = "sparesults", features = ["rdf-star"] }
spargebra = { version = "0.3.0-alpha.1-dev", path = "spargebra", features = ["rdf-star", "sep-0002", "sep-0006"] }
sparopt = { version = "0.1.0-alpha.1-dev", path="sparopt", features = ["rdf-star", "sep-0002", "sep-0006"] }
sparesults = { version = "0.2.0-alpha.1", path = "sparesults", features = ["rdf-star"] }
spargebra = { version = "0.3.0-alpha.1", path = "spargebra", features = ["rdf-star", "sep-0002", "sep-0006"] }
sparopt = { version = "0.1.0-alpha.1", path="sparopt", features = ["rdf-star", "sep-0002", "sep-0006"] }
[target.'cfg(not(target_family = "wasm"))'.dependencies]
libc = "0.2.147"
oxrocksdb-sys = { version = "0.4.0-alpha.1-dev", path="../oxrocksdb-sys" }
oxrocksdb-sys = { version = "0.4.0-alpha.1", path="../oxrocksdb-sys" }
oxhttp = { version = "0.2.0-alpha.3", optional = true }
[target.'cfg(all(target_family = "wasm", target_os = "unknown"))'.dependencies]

@ -14,7 +14,7 @@ It also provides a set of utility functions for reading, writing, and processing
Oxigraph is in heavy development and SPARQL query evaluation has not been optimized yet.
Oxigraph also provides [a standalone HTTP server](https://crates.io/crates/oxigraph-cli) and [a Python library](https://pyoxigraph.readthedocs.io/) based on this library.
Oxigraph also provides [a CLI tool](https://crates.io/crates/oxigraph-cli) and [a Python library](https://pyoxigraph.readthedocs.io/) based on this library.
Oxigraph implements the following specifications:
@ -48,8 +48,8 @@ if let QueryResults::Solutions(mut solutions) = store.query("SELECT ?s WHERE {
```
Some parts of this library are available as standalone crates:
* [`oxrdf`](https://crates.io/crates/oxrdf), datastructures encoding RDF basic concepts (the `oxigraph::model` module).
* [`oxrdfio`](https://crates.io/crates/oxrdfio), a unified parser and serializer API for RDF formats. It itself relies on:
* [`oxrdf`](https://crates.io/crates/oxrdf), datastructures encoding RDF basic concepts (the [`oxigraph::model`](crate::model) module).
* [`oxrdfio`](https://crates.io/crates/oxrdfio), a unified parser and serializer API for RDF formats (the [`oxigraph::io`](crate::io) module). It itself relies on:
* [`oxttl`](https://crates.io/crates/oxttl), N-Triple, N-Quad, Turtle, TriG and N3 parsing and serialization.
* [`oxrdfxml`](https://crates.io/crates/oxrdfxml), RDF/XML parsing and serialization.
* [`spargebra`](https://crates.io/crates/spargebra), a SPARQL parser.
@ -57,7 +57,7 @@ Some parts of this library are available as standalone crates:
* [`sparopt`](https://crates.io/crates/sparesults), a SPARQL optimizer.
* [`oxsdatatypes`](https://crates.io/crates/oxsdatatypes), an implementation of some XML Schema datatypes.
To build the library, don't forget to clone the submodules using `git clone --recursive https://github.com/oxigraph/oxigraph.git` to clone the repository including submodules or `git submodule update --init` to add submodules to the already cloned repository.
To build the library locally, don't forget to clone the submodules using `git clone --recursive https://github.com/oxigraph/oxigraph.git` to clone the repository including submodules or `git submodule update --init` to add submodules to the already cloned repository.
## License

@ -1,6 +1,6 @@
[package]
name = "oxrdf"
version = "0.2.0-alpha.1-dev"
version = "0.2.0-alpha.1"
authors.workspace = true
license.workspace = true
readme = "README.md"
@ -22,7 +22,7 @@ rdf-star = []
rand = "0.8"
oxilangtag = "0.1"
oxiri = "0.2.3-alpha.1"
oxsdatatypes = { version = "0.2.0-alpha.1-dev", path="../oxsdatatypes", optional = true }
oxsdatatypes = { version = "0.2.0-alpha.1", path="../oxsdatatypes", optional = true }
[lints]
workspace = true

@ -15,6 +15,8 @@ Support for [RDF-star](https://w3c.github.io/rdf-star/cg-spec/2021-12-17.html) i
OxRDF is inspired by [RDF/JS](https://rdf.js.org/data-model-spec/) and [Apache Commons RDF](http://commons.apache.org/proper/commons-rdf/).
Use [`oxrdfio`](https://crates.io/crates/oxrdfio) if you need to read or write RDF files.
Usage example:
```rust

@ -1,6 +1,6 @@
[package]
name = "oxrdfio"
version = "0.1.0-alpha.1-dev"
version = "0.1.0-alpha.1"
authors.workspace = true
license.workspace = true
readme = "README.md"
@ -9,7 +9,7 @@ repository = "https://github.com/oxigraph/oxigraph/tree/master/lib/oxrdfxml"
homepage.workspace = true
documentation = "https://docs.rs/oxrdfio"
description = """
Parser for various RDF serializations
Parser and serializer for various RDF formats
"""
edition.workspace = true
rust-version.workspace = true
@ -20,9 +20,9 @@ async-tokio = ["dep:tokio", "oxrdfxml/async-tokio", "oxttl/async-tokio"]
rdf-star = ["oxrdf/rdf-star", "oxttl/rdf-star"]
[dependencies]
oxrdf = { version = "0.2.0-alpha.1-dev", path = "../oxrdf" }
oxrdfxml = { version = "0.1.0-alpha.1-dev", path = "../oxrdfxml" }
oxttl = { version = "0.1.0-alpha.1-dev", path = "../oxttl" }
oxrdf = { version = "0.2.0-alpha.1", path = "../oxrdf" }
oxrdfxml = { version = "0.1.0-alpha.1", path = "../oxrdfxml" }
oxttl = { version = "0.1.0-alpha.1", path = "../oxttl" }
tokio = { version = "1.29", optional = true, features = ["io-util"] }
[dev-dependencies]

@ -21,6 +21,8 @@ Support for [SPARQL-star](https://w3c.github.io/rdf-star/cg-spec/2021-12-17.html
It is designed as a low level parser compatible with both synchronous and asynchronous I/O (behind the `async-tokio` feature).
The entry points of this library are the two [`RdfParser`] and [`RdfSerializer`] structs.
Usage example converting a Turtle file to a N-Triples file:
```rust
use oxrdfio::{RdfFormat, RdfParser, RdfSerializer};

@ -37,9 +37,10 @@ use tokio::io::AsyncRead;
/// * [Turtle](https://www.w3.org/TR/turtle/) ([`RdfFormat::Turtle`])
///
/// Note the useful options:
/// - [`with_base_iri`](RdfParser::with_base_iri) to resolve the relative IRIs.
/// - [`rename_blank_nodes`](RdfParser::rename_blank_nodes) to rename the blank nodes to auto-generated numbers to avoid conflicts when merging RDF graphs together.
/// - [`without_named_graphs`](RdfParser::without_named_graphs) to parse a single graph.
/// - [`with_base_iri`](Self::with_base_iri) to resolve the relative IRIs.
/// - [`rename_blank_nodes`](Self::rename_blank_nodes) to rename the blank nodes to auto-generated numbers to avoid conflicts when merging RDF graphs together.
/// - [`without_named_graphs`](Self::without_named_graphs) to parse a single graph.
/// - [`unchecked`](Self::unchecked) to skip some validations if the file is already known to be valid.
///
/// ```
/// use oxrdfio::{RdfFormat, RdfParser};

@ -73,9 +73,13 @@ impl RdfSerializer {
/// Writes to a [`Write`] implementation.
///
/// <div class="warning">Do not forget to run the [`finish`](ToWriteQuadWriter::finish()) method to properly write the last bytes of the file.</div>
/// <div class="warning">
///
/// <div class="warning">This writer does unbuffered writes. You might want to use [`BufWriter`](io::BufWriter) to avoid that.</div>
/// Do not forget to run the [`finish`](ToWriteQuadWriter::finish()) method to properly write the last bytes of the file.</div>
///
/// <div class="warning">
///
/// This writer does unbuffered writes. You might want to use [`BufWriter`](io::BufWriter) to avoid that.</div>
///
/// ```
/// use oxrdfio::{RdfFormat, RdfSerializer};
@ -118,9 +122,13 @@ impl RdfSerializer {
/// Writes to a Tokio [`AsyncWrite`] implementation.
///
/// <div class="warning">Do not forget to run the [`finish`](ToTokioAsyncWriteQuadWriter::finish()) method to properly write the last bytes of the file.</div>
/// <div class="warning">
///
/// Do not forget to run the [`finish`](ToTokioAsyncWriteQuadWriter::finish()) method to properly write the last bytes of the file.</div>
///
/// <div class="warning">
///
/// <div class="warning">This writer does unbuffered writes. You might want to use [`BufWriter`](tokio::io::BufWriter) to avoid that.</div>
/// This writer does unbuffered writes. You might want to use [`BufWriter`](tokio::io::BufWriter) to avoid that.</div>
///
/// ```
/// use oxrdfio::{RdfFormat, RdfSerializer};
@ -179,9 +187,13 @@ impl From<RdfFormat> for RdfSerializer {
///
/// Can be built using [`RdfSerializer::serialize_to_write`].
///
/// <div class="warning">Do not forget to run the [`finish`](ToWriteQuadWriter::finish()) method to properly write the last bytes of the file.</div>
/// <div class="warning">
///
/// <div class="warning">This writer does unbuffered writes. You might want to use [`BufWriter`](io::BufWriter) to avoid that.</div>
/// Do not forget to run the [`finish`](ToWriteQuadWriter::finish()) method to properly write the last bytes of the file.</div>
///
/// <div class="warning">
///
/// This writer does unbuffered writes. You might want to use [`BufWriter`](io::BufWriter) to avoid that.</div>
///
/// ```
/// use oxrdfio::{RdfFormat, RdfSerializer};
@ -248,9 +260,13 @@ impl<W: Write> ToWriteQuadWriter<W> {
///
/// Can be built using [`RdfSerializer::serialize_to_write`].
///
/// <div class="warning">Do not forget to run the [`finish`](ToWriteQuadWriter::finish()) method to properly write the last bytes of the file.</div>
/// <div class="warning">
///
/// Do not forget to run the [`finish`](ToWriteQuadWriter::finish()) method to properly write the last bytes of the file.</div>
///
/// <div class="warning">
///
/// <div class="warning">This writer does unbuffered writes. You might want to use [`BufWriter`](io::BufWriter) to avoid that.</div>
/// This writer does unbuffered writes. You might want to use [`BufWriter`](io::BufWriter) to avoid that.</div>
///
/// ```
/// use oxrdfio::{RdfFormat, RdfSerializer};

@ -1,6 +1,6 @@
[package]
name = "oxrdfxml"
version = "0.1.0-alpha.1-dev"
version = "0.1.0-alpha.1"
authors.workspace = true
license.workspace = true
readme = "README.md"
@ -8,7 +8,7 @@ keywords = ["RDFXML", "XML", "RDF"]
repository = "https://github.com/oxigraph/oxigraph/tree/master/lib/oxrdfxml"
homepage.workspace = true
description = """
Parser for the RDF/XML language
Parser and serializer for the RDF/XML format
"""
documentation = "https://docs.rs/oxrdfxml"
edition.workspace = true
@ -19,7 +19,7 @@ default = []
async-tokio = ["dep:tokio", "quick-xml/async-tokio"]
[dependencies]
oxrdf = { version = "0.2.0-alpha.1-dev", path = "../oxrdf" }
oxrdf = { version = "0.2.0-alpha.1", path = "../oxrdf" }
oxilangtag = "0.1"
oxiri = "0.2.3-alpha.1"
quick-xml = ">=0.29, <0.32"

@ -9,6 +9,8 @@ OxRDF/XML
OxRdfXml is a parser and serializer for [RDF/XML](https://www.w3.org/TR/rdf-syntax-grammar/).
The entry points of this library are the two [`RdfXmlParser`] and [`RdfXmlSerializer`] structs.
Usage example counting the number of people in a RDF/XML file:
```rust
use oxrdf::{NamedNodeRef, vocab::rdf};

@ -1,6 +1,6 @@
[package]
name = "oxsdatatypes"
version = "0.2.0-alpha.1-dev"
version = "0.2.0-alpha.1"
authors.workspace = true
license.workspace = true
readme = "README.md"

@ -1,6 +1,6 @@
[package]
name = "oxttl"
version = "0.1.0-alpha.1-dev"
version = "0.1.0-alpha.1"
authors.workspace = true
license.workspace = true
readme = "README.md"
@ -8,7 +8,7 @@ keywords = ["N-Triples", "N-Quads", "Turtle", "TriG", "N3"]
repository = "https://github.com/oxigraph/oxigraph/tree/master/lib/oxttl"
homepage.workspace = true
description = """
Parser for languages related to RDF Turtle (N-Triples, N-Quads, Turtle, TriG and N3)
Parser and serializer for languages related to RDF Turtle (N-Triples, N-Quads, Turtle, TriG and N3)
"""
documentation = "https://docs.rs/oxttl"
edition.workspace = true
@ -21,7 +21,7 @@ async-tokio = ["dep:tokio"]
[dependencies]
memchr = "2.5"
oxrdf = { version = "0.2.0-alpha.1-dev", path = "../oxrdf" }
oxrdf = { version = "0.2.0-alpha.1", path = "../oxrdf" }
oxiri = "0.2.3-alpha.1"
oxilangtag = "0.1"
tokio = { version = "1.29", optional = true, features = ["io-util"] }

@ -1,4 +1,5 @@
//! A [N-Quads](https://www.w3.org/TR/n-quads/) streaming parser implemented by [`NQuadsParser`].
//! A [N-Quads](https://www.w3.org/TR/n-quads/) streaming parser implemented by [`NQuadsParser`]
//! and a serializer implemented by [`NQuadsSerializer`].
use crate::line_formats::NQuadsRecognizer;
#[cfg(feature = "async-tokio")]

@ -1,4 +1,5 @@
//! A [TriG](https://www.w3.org/TR/trig/) streaming parser implemented by [`TriGParser`].
//! A [TriG](https://www.w3.org/TR/trig/) streaming parser implemented by [`TriGParser`]
//! and a serializer implemented by [`TriGSerializer`].
use crate::terse::TriGRecognizer;
#[cfg(feature = "async-tokio")]

@ -1,4 +1,5 @@
//! A [Turtle](https://www.w3.org/TR/turtle/) streaming parser implemented by [`TurtleParser`].
//! A [Turtle](https://www.w3.org/TR/turtle/) streaming parser implemented by [`TurtleParser`]
//! and a serializer implemented by [`TurtleSerializer`].
use crate::terse::TriGRecognizer;
#[cfg(feature = "async-tokio")]

@ -1,6 +1,6 @@
[package]
name = "sparesults"
version = "0.2.0-alpha.1-dev"
version = "0.2.0-alpha.1"
authors.workspace = true
license.workspace = true
readme = "README.md"
@ -22,7 +22,7 @@ async-tokio = ["dep:tokio", "quick-xml/async-tokio", "json-event-parser/async-to
[dependencies]
json-event-parser = "0.2.0-alpha.2"
memchr = "2.5"
oxrdf = { version = "0.2.0-alpha.1-dev", path="../oxrdf" }
oxrdf = { version = "0.2.0-alpha.1", path="../oxrdf" }
quick-xml = ">=0.29, <0.32"
tokio = { version = "1.29", optional = true, features = ["io-util"] }

@ -15,8 +15,9 @@ Support for [SPARQL-star](https://w3c.github.io/rdf-star/cg-spec/2021-12-17.html
This crate is intended to be a building piece for SPARQL client and server implementations in Rust like [Oxigraph](https://oxigraph.org).
Usage example converting a JSON result file into a TSV result file:
The entry points of this library are the two [`QueryResultsParser`] and [`QueryResultsSerializer`] structs.
Usage example converting a JSON result file into a TSV result file:
```rust
use sparesults::{QueryResultsFormat, QueryResultsParser, FromReadQueryResultsReader, QueryResultsSerializer};
use std::io::Result;

@ -115,9 +115,13 @@ impl QueryResultsSerializer {
/// Returns a `SolutionsWriter` allowing writing query solutions into the given [`Write`] implementation.
///
/// <div class="warning">Do not forget to run the [`finish`](ToWriteSolutionsWriter::finish()) method to properly write the last bytes of the file.</div>
/// <div class="warning">
///
/// <div class="warning">This writer does unbuffered writes. You might want to use [`BufWriter`](io::BufWriter) to avoid that.</div>
/// Do not forget to run the [`finish`](ToWriteSolutionsWriter::finish()) method to properly write the last bytes of the file.</div>
///
/// <div class="warning">
///
/// This writer does unbuffered writes. You might want to use [`BufWriter`](io::BufWriter) to avoid that.</div>
///
/// Example in XML (the API is the same for JSON, CSV and TSV):
/// ```
@ -158,9 +162,13 @@ impl QueryResultsSerializer {
/// Returns a `SolutionsWriter` allowing writing query solutions into the given [`Write`] implementation.
///
/// <div class="warning">Do not forget to run the [`finish`](ToWriteSolutionsWriter::finish()) method to properly write the last bytes of the file.</div>
/// <div class="warning">
///
/// Do not forget to run the [`finish`](ToWriteSolutionsWriter::finish()) method to properly write the last bytes of the file.</div>
///
/// <div class="warning">
///
/// <div class="warning">This writer does unbuffered writes. You might want to use [`BufWriter`](io::BufWriter) to avoid that.</div>
/// This writer does unbuffered writes. You might want to use [`BufWriter`](io::BufWriter) to avoid that.</div>
///
/// Example in XML (the API is the same for JSON, CSV and TSV):
/// ```
@ -223,9 +231,13 @@ impl From<QueryResultsFormat> for QueryResultsSerializer {
///
/// Could be built using a [`QueryResultsSerializer`].
///
/// <div class="warning">Do not forget to run the [`finish`](ToWriteSolutionsWriter::finish()) method to properly write the last bytes of the file.</div>
/// <div class="warning">
///
/// <div class="warning">This writer does unbuffered writes. You might want to use [`BufWriter`](io::BufWriter) to avoid that.</div>
/// Do not forget to run the [`finish`](ToWriteSolutionsWriter::finish()) method to properly write the last bytes of the file.</div>
///
/// <div class="warning">
///
/// This writer does unbuffered writes. You might want to use [`BufWriter`](io::BufWriter) to avoid that.</div>
///
/// Example in TSV (the API is the same for JSON, XML and CSV):
/// ```
@ -299,9 +311,13 @@ impl<W: Write> ToWriteSolutionsWriter<W> {
/// Could be built using a [`QueryResultsSerializer`].
///
/// <div class="warning">Do not forget to run the [`finish`](ToTokioAsyncWriteSolutionsWriter::finish()) method to properly write the last bytes of the file.</div>
/// <div class="warning">
///
/// Do not forget to run the [`finish`](ToTokioAsyncWriteSolutionsWriter::finish()) method to properly write the last bytes of the file.</div>
///
/// <div class="warning">
///
/// <div class="warning">This writer does unbuffered writes. You might want to use [`BufWriter`](tokio::io::BufWriter) to avoid that.</div>
/// This writer does unbuffered writes. You might want to use [`BufWriter`](tokio::io::BufWriter) to avoid that.</div>
///
/// Example in TSV (the API is the same for JSON, CSV and XML):
/// ```

@ -1,6 +1,6 @@
[package]
name = "spargebra"
version = "0.3.0-alpha.1-dev"
version = "0.3.0-alpha.1"
authors.workspace = true
license.workspace = true
readme = "README.md"
@ -25,7 +25,7 @@ peg = "0.8"
rand = "0.8"
oxiri = "0.2.3-alpha.1"
oxilangtag = "0.1"
oxrdf = { version = "0.2.0-alpha.1-dev", path="../oxrdf" }
oxrdf = { version = "0.2.0-alpha.1", path="../oxrdf" }
[lints]
workspace = true

@ -1,6 +1,6 @@
[package]
name = "sparopt"
version = "0.1.0-alpha.1-dev"
version = "0.1.0-alpha.1"
authors.workspace = true
license.workspace = true
readme = "README.md"
@ -21,9 +21,9 @@ sep-0002 = ["spargebra/sep-0002"]
sep-0006 = ["spargebra/sep-0006"]
[dependencies]
oxrdf = { version = "0.2.0-alpha.1-dev", path="../oxrdf" }
oxrdf = { version = "0.2.0-alpha.1", path="../oxrdf" }
rand = "0.8"
spargebra = { version = "0.3.0-alpha.1-dev", path="../spargebra" }
spargebra = { version = "0.3.0-alpha.1", path="../spargebra" }
[lints]
workspace = true

@ -1,6 +1,6 @@
[package]
name = "sparql-smith"
version = "0.1.0-alpha.5-dev"
version = "0.1.0-alpha.5"
authors.workspace = true
license.workspace = true
readme = "README.md"

@ -1,5 +1,7 @@
//! Utilities to read and write RDF graphs and datasets using [OxRDF I/O](https://crates.io/crates/oxrdfio).
//!
//! The entry points of this module are the two [`RdfParser`] and [`RdfSerializer`] structs.
//!
//! Usage example converting a Turtle file to a N-Triples file:
//! ```
//! use oxigraph::io::{RdfFormat, RdfParser, RdfSerializer};

@ -55,7 +55,9 @@ impl GraphSerializer {
/// Allows writing triples.
/// Could be built using a [`GraphSerializer`].
///
/// <div class="warning">Do not forget to run the [`finish`](TripleWriter::finish()) method to properly write the last bytes of the file.</div>
/// <div class="warning">
///
/// Do not forget to run the [`finish`](TripleWriter::finish()) method to properly write the last bytes of the file.</div>
///
/// ```
/// use oxigraph::io::{GraphFormat, GraphSerializer};
@ -138,7 +140,9 @@ impl DatasetSerializer {
/// Allows writing triples.
/// Could be built using a [`DatasetSerializer`].
///
/// <div class="warning">Do not forget to run the [`finish`](QuadWriter::finish()) method to properly write the last bytes of the file.</div>
/// <div class="warning">
///
/// Do not forget to run the [`finish`](QuadWriter::finish()) method to properly write the last bytes of the file.</div>
///
/// ```
/// use oxigraph::io::{DatasetFormat, DatasetSerializer};

@ -1,5 +1,7 @@
//! API to access an on-disk [RDF dataset](https://www.w3.org/TR/rdf11-concepts/#dfn-rdf-dataset).
//!
//! The entry point of the module is the [`Store`] struct.
//!
//! Usage example:
//! ```
//! use oxigraph::store::Store;
@ -605,7 +607,9 @@ impl Store {
/// Adds atomically a set of quads to this store.
///
/// <div class="warning">This operation uses a memory heavy transaction internally, use the [`bulk_loader`](Store::bulk_loader) if you plan to add ten of millions of triples.</div>
/// <div class="warning">
///
/// This operation uses a memory heavy transaction internally, use the [`bulk_loader`](Store::bulk_loader) if you plan to add ten of millions of triples.</div>
pub fn extend(
&self,
quads: impl IntoIterator<Item = impl Into<Quad>>,
@ -918,7 +922,9 @@ impl Store {
/// After its creation, the backup is usable using [`Store::open`]
/// like a regular Oxigraph database and operates independently from the original database.
///
/// <div class="warning">Backups are only possible for on-disk databases created using [`Store::open`].</div>
/// <div class="warning">
///
/// Backups are only possible for on-disk databases created using [`Store::open`].</div>
/// Temporary in-memory databases created using [`Store::new`] are not compatible with RocksDB backup system.
///
/// <div class="warning">An error is raised if the `target_directory` already exists.</div>
@ -1497,13 +1503,15 @@ impl Iterator for GraphNameIter {
/// A bulk loader allowing to load at lot of data quickly into the store.
///
/// <div class="warning">The operations provided here are not atomic.</div>
/// <div class="warning">The operations provided here are not atomic.
/// If the operation fails in the middle, only a part of the data may be written to the store.
/// Results might get weird if you delete data during the loading process.
/// Results might get weird if you delete data during the loading process.</div>
///
/// <div class="warning">It is optimized for speed.</div>
/// Memory usage is configurable using [`BulkLoader::with_max_memory_size_in_megabytes`]
/// and the number of used threads with [`BulkLoader::with_num_threads`].
/// <div class="warning">
///
/// It is optimized for speed.</div>
/// Memory usage is configurable using [`with_max_memory_size_in_megabytes`](Self::with_max_memory_size_in_megabytes)
/// and the number of used threads with [`with_num_threads`](Self::with_num_threads).
/// By default the memory consumption target (excluding the system and RocksDB internal consumption)
/// is around 2GB per thread and 2 threads.
/// These targets are considered per loaded file.
@ -1598,7 +1606,9 @@ impl BulkLoader {
/// If the parsing fails in the middle of the file, only a part of it may be written to the store.
/// Results might get weird if you delete data during the loading process.</div>
///
/// <div class="warning">This method is optimized for speed. See [the struct](BulkLoader) documentation for more details.</div>
/// <div class="warning">
///
/// This method is optimized for speed. See [the struct](Self) documentation for more details.</div>
///
/// To get better speed on valid datasets, consider enabling [`RdfParser::unchecked`] option to skip some validations.
///
@ -1668,7 +1678,9 @@ impl BulkLoader {
/// If the parsing fails in the middle of the file, only a part of it may be written to the store.
/// Results might get weird if you delete data during the loading process.</div>
///
/// <div class="warning">This method is optimized for speed. See [the struct](BulkLoader) documentation for more details.</div>
/// <div class="warning">
///
/// This method is optimized for speed. See [the struct](Self) documentation for more details.</div>
///
/// Usage example:
/// ```
@ -1727,7 +1739,9 @@ impl BulkLoader {
/// If the parsing fails in the middle of the file, only a part of it may be written to the store.
/// Results might get weird if you delete data during the loading process.</div>
///
/// <div class="warning">This method is optimized for speed. See [the struct](BulkLoader) documentation for more details.</div>
/// <div class="warning">
///
/// This method is optimized for speed. See [the struct](Self) documentation for more details.</div>
///
/// Usage example:
/// ```
@ -1788,7 +1802,9 @@ impl BulkLoader {
/// If the process fails in the middle of the file, only a part of the data may be written to the store.
/// Results might get weird if you delete data during the loading process.</div>
///
/// <div class="warning">This method is optimized for speed. See [the struct](BulkLoader) documentation for more details.</div>
/// <div class="warning">
///
/// This method is optimized for speed. See [the struct](Self) documentation for more details.</div>
pub fn load_quads(
&self,
quads: impl IntoIterator<Item = impl Into<Quad>>,
@ -1802,7 +1818,9 @@ impl BulkLoader {
/// If the process fails in the middle of the file, only a part of the data may be written to the store.
/// Results might get weird if you delete data during the loading process.</div>
///
/// <div class="warning">This method is optimized for speed. See [the struct](BulkLoader) documentation for more details.</div>
/// <div class="warning">
///
/// This method is optimized for speed. See [the struct](Self) documentation for more details.</div>
pub fn load_ok_quads<EI, EO: From<StorageError> + From<EI>>(
&self,
quads: impl IntoIterator<Item = Result<impl Into<Quad>, EI>>,

@ -25,7 +25,7 @@ rocksdb-pkg-config = ["oxigraph/rocksdb-pkg-config"]
rustls = ["oxigraph/http-client-rustls-native"]
[dependencies]
oxigraph = { version = "0.4.0-alpha.1-dev", path="../lib" }
oxigraph = { version = "0.4.0-alpha.1", path="../lib" }
pyo3 = { version = "0.20.1", features = ["extension-module"] }
[lints]

@ -1,6 +1,19 @@
Migration Guide
===============
From 0.3 to 0.4
"""""""""""""""
* Python 3.7 and ``musllinux_1_1`` support have been removed.
* :py:class:`OSError` is now raised instead of :py:class:`IOError` on OS errors.
* The ``mime_type`` parameter have been renamed to ``format`` in I/O functions.
Using :py:class:`RdfFormat` is recommended to describe formats.
* Boolean SPARQL results are now encoded with the :py:class:`QueryBoolean` class and not a simple :py:class:`bool`.
* A `path` parameter has been added to all I/O method to read from a file.
The existing ``input`` parameter now consider :py:class:`str` values to be a serialization to parse.
For example, ``parse(path="foo.ttl")`` will parse the file ``foo.ttl`` whereas ``parse("foo", format=RdfFormat.N_TRIPLES)`` will parse a N-Triples file which content is ``foo``.
From 0.2 to 0.3
"""""""""""""""

Loading…
Cancel
Save