Merge branch 'master' into v0.3

pull/173/head
Tpt 3 years ago
commit e6ab6b99ed
  1. 1
      .github/FUNDING.yml
  2. 42
      .github/workflows/build.yml
  3. 2
      .github/workflows/doc.yml
  4. 25
      .github/workflows/release.yml
  5. 12
      CHANGELOG.md
  6. 2820
      Cargo.lock
  7. 2
      README.md
  8. 2
      lib/Cargo.toml
  9. 4
      lib/src/lib.rs
  10. 18
      python/Cargo.toml
  11. 31
      python/pyproject.toml
  12. 2
      server/Cargo.toml
  13. 10
      server/src/main.rs
  14. 2
      wikibase/Cargo.toml
  15. 19
      wikibase/src/main.rs

@ -0,0 +1 @@
github: [Tpt]

@ -15,16 +15,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: rustup update
- run: rustup component add rustfmt
- run: rustup update && rustup component add rustfmt
- run: cargo fmt -- --check
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: rustup update
- run: rustup component add clippy
- run: rustup update && rustup component add clippy
- run: cargo clippy --all-targets --all-features
test:
@ -71,7 +69,7 @@ jobs:
with:
python-version: 3.8
- run: python -m venv python/venv
- run: source python/venv/bin/activate && pip install --upgrade pip 'maturin>=0.9.2,<0.10' sphinx
- run: source python/venv/bin/activate && pip install --upgrade 'maturin>=0.11,<0.12' sphinx
- run: source venv/bin/activate && maturin develop
working-directory: ./python
- run: source ../venv/bin/activate && python -m unittest
@ -81,17 +79,39 @@ jobs:
- run: source ../venv/bin/activate && sphinx-build -M html . build
working-directory: ./python/docs
python_wheel:
runs-on: ${{ matrix.os }}
python_wheel_linux:
runs-on: ubuntu-latest
needs: python
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.6
- run: pip install 'maturin>=0.11,<0.12'
- run: maturin build
working-directory: ./python
python_wheel_mac:
runs-on: macos-latest
needs: python
steps:
- uses: actions/checkout@v2
- run: rustup update && rustup target add aarch64-apple-darwin
- uses: actions/setup-python@v2
with:
python-version: 3.6
- run: pip install 'maturin>=0.11,<0.12'
- run: maturin build --universal2
working-directory: ./python
python_wheel_windows:
runs-on: windows-latest
needs: python
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.6
- run: pip install 'maturin>=0.9.2,<0.10'
- run: pip install 'maturin>=0.11,<0.12'
- run: maturin build
working-directory: ./python

@ -15,7 +15,7 @@ jobs:
with:
python-version: 3.8
- run: python -m venv python/venv
- run: source python/venv/bin/activate && pip install --upgrade pip 'maturin>=0.9.2,<0.10' sphinx
- run: source python/venv/bin/activate && pip install --upgrade 'maturin>=0.11,<0.12' sphinx
- run: source venv/bin/activate && maturin develop
working-directory: ./python
- run: source ../venv/bin/activate && sphinx-build -M doctest . build

@ -85,20 +85,29 @@ jobs:
steps:
- uses: actions/checkout@v2
- run: sed -i 's/path="..\/lib", //g' python/Cargo.toml
- run: docker run --rm -v $(pwd):/io konstin2/maturin:v0.9.4 publish -u __token__ -p ${{ secrets.PYPI_PASSWORD }}
- run: docker run --rm -v $(pwd):/io konstin2/maturin:v0.11.1 publish -u __token__ -p ${{ secrets.PYPI_PASSWORD }}
working-directory: ./python
publish_pypi_mac_windows:
runs-on: ${{ matrix.os }}
publish_pypi_mac:
runs-on: macos-latest
needs: publish_lib_crate
strategy:
matrix:
os: [ macos-latest, windows-latest ]
steps:
- uses: actions/checkout@v2
- run: rustup update && rustup target add aarch64-apple-darwin
- uses: actions/setup-python@v2
with:
python-version: 3.6
- run: pip install 'maturin>=0.9.2,<0.10'
- run: pip install 'maturin>=0.11,<0.12'
- run: maturin publish --universal2 --no-sdist -u __token__ -p ${{ secrets.PYPI_PASSWORD }}
working-directory: ./python
publish_pypi_windows:
runs-on: windows-latest
needs: publish_lib_crate
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.6
- run: pip install 'maturin>=0.11,<0.12'
- run: maturin publish --no-sdist -u __token__ -p ${{ secrets.PYPI_PASSWORD }}
working-directory: ./python
publish_npm:
@ -128,7 +137,7 @@ jobs:
with:
python-version: 3.8
- run: python -m venv python/venv
- run: source python/venv/bin/activate && pip install --upgrade pip 'maturin>=0.9.2,<0.10' sphinx
- run: source python/venv/bin/activate && pip install --upgrade 'maturin>=0.11,<0.12' sphinx
- run: source venv/bin/activate && maturin develop
working-directory: ./python
- run: source ../venv/bin/activate && sphinx-build -M doctest . build

@ -1,3 +1,15 @@
## [0.2.5] - 2021-07-11
## Added
- [SPARQL 1.1 Query Results JSON Format](http://www.w3.org/TR/sparql11-results-json/) parser.
- Python wheels for macOS are now universal2 binaries.
### Changed
- The `Cargo.lock` file is now provided with releases to avoid compilation failures because of changes in dependencies.
- Uses clap instead of argh for the server arguments parsing.
- Upgrades PyO3 to v0.14.
## [0.2.4] - 2021-04-28
### Changed

2820
Cargo.lock generated

File diff suppressed because it is too large Load Diff

@ -14,7 +14,7 @@ Its goal is to provide a compliant, safe, and fast graph database based on the [
It is written in Rust.
It also provides a set of utility functions for reading, writing, and processing RDF files.
Oxigraph is in heavy development and SPARQL query evaluation has not been optimized yet.
Oxigraph is in heavy development and SPARQL query evaluation has not been optimized yet. The development roadmap is using [GitHub milestones](https://github.com/oxigraph/oxigraph/milestones?direction=desc&sort=completeness&state=open).
It is split into multiple parts:
* [The database written as a Rust library](https://crates.io/crates/oxigraph). Its source code is in the `lib` directory.

@ -37,7 +37,7 @@ rio_xml = "0.6"
hex = "0.4"
nom = "7"
siphasher = "0.3"
lasso = "0.6"
lasso = {version="0.6", features=["multi-threaded", "inline-more"]}
lazy_static = "1"
sophia_api = { version = "0.7", optional = true }
json-event-parser = "0.1"

@ -123,6 +123,7 @@
clippy::range_minus_one,
clippy::range_plus_one,
//TODO clippy::rc_mutex,
clippy::enum_variant_names,
//TODO clippy::redundant_closure_for_method_calls,
clippy::redundant_else,
clippy::redundant_pub_crate,
@ -165,7 +166,8 @@
clippy::verbose_bit_mask,
clippy::verbose_file_reads,
clippy::wildcard_dependencies,
clippy::zero_sized_map_values
clippy::zero_sized_map_values,
clippy::wrong_self_convention,
)]
#![doc(test(attr(deny(warnings))))]

@ -19,21 +19,3 @@ doctest = false
oxigraph = {version = "0.3.0-dev", path="../lib", features = ["http_client"]}
pyo3 = {version = "0.15", features = ["extension-module", "abi3-py36"]}
native-tls = {version = "0.2", features = ["vendored"]}
[package.metadata.maturin]
classifier = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Rust",
"Topic :: Database :: Database Engines/Servers",
"Topic :: Software Development :: Libraries :: Python Modules",
]
project-url = { Documentation = "https://oxigraph.org/pyoxigraph/", Source = "https://github.com/oxigraph/oxigraph/tree/master/python", Tracker = "https://github.com/oxigraph/oxigraph/issues" }
requires-python = ">=3.6"

@ -1,3 +1,30 @@
[build-system]
requires = ["maturin>=0.9.2,<0.10"]
build-backend = "maturin"
requires = ["maturin>=0.11,<0.12"]
build-backend = "maturin"
[project]
# Most of the metadata are in Cargo.toml and injected by maturin
name = "pyoxigraph"
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Rust",
"Topic :: Database :: Database Engines/Servers",
"Topic :: Software Development :: Libraries :: Python Modules",
]
requires-python = ">=3.6"
[project.urls]
Changelog = "https://github.com/oxigraph/oxigraph/blob/master/CHANGELOG.md"
Documentation = "https://oxigraph.org/pyoxigraph/"
Homepage = "https://oxigraph.org/pyoxigraph/"
Source = "https://github.com/oxigraph/oxigraph/tree/master/python"
Tracker = "https://github.com/oxigraph/oxigraph/issues"

@ -7,7 +7,7 @@ readme = "README.md"
repository = "https://github.com/oxigraph/oxigraph/tree/master/server"
homepage = "https://oxigraph.org/server/"
description = """
SPARQL server based on Oxigraph
Oxigraph SPARQL HTTP server
"""
edition = "2021"

@ -9,7 +9,7 @@
unused_qualifications
)]
use clap::{App, AppSettings, Arg, SubCommand};
use clap::{crate_version, App, AppSettings, Arg, SubCommand};
use oxhttp::model::{Body, HeaderName, HeaderValue, Request, Response, Status};
use oxhttp::Server;
use oxigraph::io::{DatasetFormat, DatasetSerializer, GraphFormat, GraphSerializer};
@ -34,11 +34,12 @@ const LOGO: &str = include_str!("../logo.svg");
pub fn main() -> std::io::Result<()> {
let matches = App::new("Oxigraph SPARQL server")
.version(crate_version!())
.arg(
Arg::with_name("location")
.short("l")
.long("location")
.help("directory in which persist the data")
.help("Directory in which persist the data")
.takes_value(true),
)
.setting(AppSettings::SubcommandRequiredElseHelp)
@ -49,7 +50,8 @@ pub fn main() -> std::io::Result<()> {
Arg::with_name("bind")
.short("b")
.long("bind")
.help("Sets a custom config file")
.help("Host and port to listen to")
.default_value("localhost:7878")
.takes_value(true),
),
)
@ -92,7 +94,7 @@ pub fn main() -> std::io::Result<()> {
store.optimize()
}
("serve", Some(submatches)) => {
let bind = submatches.value_of("bind").unwrap_or("localhost:7878");
let bind = submatches.value_of("bind").unwrap();
let mut server = Server::new(move |request| handle_request(request, store.clone()));
server.set_global_timeout(HTTP_TIMEOUT);
server

@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0"
readme = "README.md"
repository = "https://github.com/oxigraph/oxigraph/tree/master/wikibase"
description = """
SPARQL server based on Oxigraph for Wikibase instances
Oxigraph SPARQL server for Wikibase
"""
edition = "2021"

@ -14,7 +14,7 @@ use async_std::future::Future;
use async_std::net::{TcpListener, TcpStream};
use async_std::prelude::*;
use async_std::task::spawn;
use clap::{App, Arg};
use clap::{crate_version, App, Arg};
use http_types::content::ContentType;
use http_types::{
bail_status, format_err_status, headers, Error, Method, Mime, Request, Response, Result,
@ -36,54 +36,57 @@ const SERVER: &str = concat!("Oxigraph/", env!("CARGO_PKG_VERSION"));
#[async_std::main]
pub async fn main() -> Result<()> {
let matches = App::new("Oxigraph SPARQL server for Wikibase")
.version(crate_version!())
.arg(
Arg::with_name("bind")
.short("b")
.long("bind")
.help("Sets a custom config file")
.default_value("localhost:7878")
.takes_value(true),
)
.arg(
Arg::with_name("file")
.short("f")
.long("file")
.help("directory in which persist the data")
.help("Directory in which persist the data")
.takes_value(true),
)
.arg(
Arg::with_name("mediawiki_api")
.long("mediawiki_api")
.help("base URL of the MediaWiki API like https://www.wikidata.org/w/api.php")
.help("Base URL of the MediaWiki API like https://www.wikidata.org/w/api.php")
.takes_value(true)
.required(true),
)
.arg(
Arg::with_name("mediawiki_base_url")
.long("mediawiki_base_url")
.help("base URL of MediaWiki like https://www.wikidata.org/wiki/")
.help("Base URL of MediaWiki like https://www.wikidata.org/wiki/")
.takes_value(true)
.required(true),
)
.arg(
Arg::with_name("namespaces")
.long("namespaces")
.help("namespaces ids to load like '0,120'")
.help("Namespaces ids to load like '0,120'")
.default_value("")
.takes_value(true),
)
.arg(
Arg::with_name("slot")
.long("slot")
.help("slot to load like 'mediainfo'. Could not be use with namespaces")
.help("Slot to load like 'mediainfo'. Could not be use with namespaces")
.takes_value(true),
)
.get_matches();
let bind = matches.value_of("bind").unwrap_or("localhost:7878");
let bind = matches.value_of("bind").unwrap();
let file = matches.value_of("file");
let mediawiki_api = matches.value_of("mediawiki_api").unwrap();
let mediawiki_base_url = matches.value_of("mediawiki_base_url").unwrap();
let namespaces = matches
.value_of("namespaces")
.unwrap_or("")
.unwrap()
.split(',')
.flat_map(|t| {
let t = t.trim();

Loading…
Cancel
Save