pull/19/head
parent
7ea52aa5ae
commit
7860a17d7f
@ -0,0 +1,239 @@ |
||||
[package] |
||||
name = "ng-oxigraph" |
||||
version = "0.4.0-alpha.7-ng" |
||||
authors = ["Tpt <thomas@pellissier-tanon.fr>", "Niko PLP <niko@nextgraph.org>"] |
||||
license = "MIT OR Apache-2.0" |
||||
readme = "README.md" |
||||
keywords = ["RDF", "SPARQL", "graph-database", "database"] |
||||
categories = ["database-implementations"] |
||||
repository = "https://git.nextgraph.org/NextGraph/nextgraph-rs" |
||||
homepage = "https://nextgraph.org" |
||||
documentation = "https://docs.nextgraph.org/" |
||||
description = """ |
||||
a SPARQL database and RDF toolkit. fork for NextGraph |
||||
""" |
||||
edition = "2021" |
||||
rust-version = "1.70" |
||||
|
||||
[features] |
||||
js = ["getrandom/js", "oxsdatatypes/js", "js-sys"] |
||||
|
||||
|
||||
[dependencies] |
||||
digest = "0.10" |
||||
hex = "0.4" |
||||
json-event-parser = "0.2.0-alpha.2" |
||||
md-5 = "0.10" |
||||
oxilangtag = "0.1" |
||||
oxiri = "0.2.3" |
||||
oxrdf = { git = "https://git.nextgraph.org/NextGraph/oxigraph.git", branch="main", features = ["rdf-star", "oxsdatatypes"] } |
||||
oxrdfio = { git = "https://git.nextgraph.org/NextGraph/oxigraph.git", branch="main", features = ["rdf-star"] } |
||||
oxsdatatypes = { git = "https://git.nextgraph.org/NextGraph/oxigraph.git", branch="main" } |
||||
rand = "0.8" |
||||
regex = "1.7" |
||||
sha1 = "0.10" |
||||
sha2 = "0.10" |
||||
siphasher = ">=0.3, <2.0" |
||||
sparesults = { git = "https://git.nextgraph.org/NextGraph/oxigraph.git", branch="main", features = ["rdf-star"] } |
||||
spargebra = { git = "https://git.nextgraph.org/NextGraph/oxigraph.git", branch="main", features = ["rdf-star", "sep-0002", "sep-0006"] } |
||||
sparopt = { git = "https://git.nextgraph.org/NextGraph/oxigraph.git", branch="main", features = ["rdf-star", "sep-0002", "sep-0006"] } |
||||
thiserror = "1.0.50" |
||||
|
||||
[target.'cfg(not(target_family = "wasm"))'.dependencies] |
||||
libc = "0.2" |
||||
rocksdb = { git = "https://git.nextgraph.org/NextGraph/rust-rocksdb.git", branch = "master", features = [ ] } |
||||
|
||||
[target.'cfg(all(target_family = "wasm", target_os = "unknown"))'.dependencies] |
||||
getrandom = "0.2.8" |
||||
js-sys = { version = "0.3.60", optional = true } |
||||
|
||||
[target.'cfg(not(target_family = "wasm"))'.dev-dependencies] |
||||
codspeed-criterion-compat = "2.3.3" |
||||
zstd = ">=0.12, <0.14" |
||||
|
||||
[lints.rust] |
||||
absolute_paths_not_starting_with_crate = "warn" |
||||
elided_lifetimes_in_paths = "warn" |
||||
explicit_outlives_requirements = "warn" |
||||
let_underscore_drop = "warn" |
||||
macro_use_extern_crate = "warn" |
||||
# TODO missing_docs = "warn" |
||||
trivial_casts = "warn" |
||||
trivial_numeric_casts = "warn" |
||||
unsafe_code = "warn" |
||||
unused_import_braces = "warn" |
||||
unused_lifetimes = "warn" |
||||
unused_macro_rules = "warn" |
||||
unused_qualifications = "warn" |
||||
|
||||
[lints.clippy] |
||||
allow_attributes = "warn" |
||||
allow_attributes_without_reason = "warn" |
||||
as_underscore = "warn" |
||||
assertions_on_result_states = "warn" |
||||
bool_to_int_with_if = "warn" |
||||
borrow_as_ptr = "warn" |
||||
case_sensitive_file_extension_comparisons = "warn" |
||||
cast_lossless = "warn" |
||||
cast_possible_truncation = "warn" |
||||
cast_possible_wrap = "warn" |
||||
cast_precision_loss = "warn" |
||||
cast_ptr_alignment = "warn" |
||||
cast_sign_loss = "warn" |
||||
checked_conversions = "warn" |
||||
clone_on_ref_ptr = "warn" |
||||
cloned_instead_of_copied = "warn" |
||||
copy_iterator = "warn" |
||||
create_dir = "warn" |
||||
dbg_macro = "warn" |
||||
decimal_literal_representation = "warn" |
||||
default_trait_access = "warn" |
||||
default_union_representation = "warn" |
||||
deref_by_slicing = "warn" |
||||
disallowed_script_idents = "warn" |
||||
doc_link_with_quotes = "warn" |
||||
empty_drop = "warn" |
||||
empty_enum = "warn" |
||||
empty_structs_with_brackets = "warn" |
||||
enum_glob_use = "warn" |
||||
error_impl_error = "warn" |
||||
exit = "warn" |
||||
expect_used = "warn" |
||||
expl_impl_clone_on_copy = "warn" |
||||
explicit_deref_methods = "warn" |
||||
explicit_into_iter_loop = "warn" |
||||
explicit_iter_loop = "warn" |
||||
filetype_is_file = "warn" |
||||
filter_map_next = "warn" |
||||
flat_map_option = "warn" |
||||
fn_params_excessive_bools = "warn" |
||||
fn_to_numeric_cast_any = "warn" |
||||
format_push_string = "warn" |
||||
from_iter_instead_of_collect = "warn" |
||||
get_unwrap = "warn" |
||||
host_endian_bytes = "warn" |
||||
if_not_else = "warn" |
||||
if_then_some_else_none = "warn" |
||||
ignored_unit_patterns = "warn" |
||||
implicit_clone = "warn" |
||||
implicit_hasher = "warn" |
||||
inconsistent_struct_constructor = "warn" |
||||
index_refutable_slice = "warn" |
||||
inefficient_to_string = "warn" |
||||
infinite_loop = "warn" |
||||
inline_always = "warn" |
||||
inline_asm_x86_att_syntax = "warn" |
||||
inline_asm_x86_intel_syntax = "warn" |
||||
into_iter_without_iter = "warn" |
||||
invalid_upcast_comparisons = "warn" |
||||
items_after_statements = "warn" |
||||
iter_not_returning_iterator = "warn" |
||||
iter_without_into_iter = "warn" |
||||
large_digit_groups = "warn" |
||||
large_futures = "warn" |
||||
large_include_file = "warn" |
||||
large_stack_arrays = "warn" |
||||
large_types_passed_by_value = "warn" |
||||
let_underscore_must_use = "warn" |
||||
let_underscore_untyped = "warn" |
||||
linkedlist = "warn" |
||||
lossy_float_literal = "warn" |
||||
macro_use_imports = "warn" |
||||
manual_assert = "warn" |
||||
manual_instant_elapsed = "warn" |
||||
manual_let_else = "warn" |
||||
manual_ok_or = "warn" |
||||
manual_string_new = "warn" |
||||
many_single_char_names = "warn" |
||||
map_unwrap_or = "warn" |
||||
match_bool = "warn" |
||||
match_on_vec_items = "warn" |
||||
match_same_arms = "warn" |
||||
match_wild_err_arm = "warn" |
||||
match_wildcard_for_single_variants = "warn" |
||||
maybe_infinite_iter = "warn" |
||||
mem_forget = "warn" |
||||
mismatching_type_param_order = "warn" |
||||
missing_assert_message = "warn" |
||||
missing_asserts_for_indexing = "warn" |
||||
missing_fields_in_debug = "warn" |
||||
multiple_inherent_impl = "warn" |
||||
mut_mut = "warn" |
||||
mutex_atomic = "warn" |
||||
naive_bytecount = "warn" |
||||
needless_bitwise_bool = "warn" |
||||
needless_continue = "warn" |
||||
needless_for_each = "warn" |
||||
needless_pass_by_value = "warn" |
||||
needless_raw_string_hashes = "warn" |
||||
needless_raw_strings = "warn" |
||||
negative_feature_names = "warn" |
||||
no_effect_underscore_binding = "warn" |
||||
no_mangle_with_rust_abi = "warn" |
||||
non_ascii_literal = "warn" |
||||
panic = "warn" |
||||
panic_in_result_fn = "warn" |
||||
partial_pub_fields = "warn" |
||||
print_stderr = "warn" |
||||
print_stdout = "warn" |
||||
ptr_as_ptr = "warn" |
||||
ptr_cast_constness = "warn" |
||||
pub_without_shorthand = "warn" |
||||
range_minus_one = "warn" |
||||
range_plus_one = "warn" |
||||
rc_buffer = "warn" |
||||
rc_mutex = "warn" |
||||
redundant_closure_for_method_calls = "warn" |
||||
redundant_else = "warn" |
||||
redundant_feature_names = "warn" |
||||
redundant_type_annotations = "warn" |
||||
ref_binding_to_reference = "warn" |
||||
ref_option_ref = "warn" |
||||
ref_patterns = "warn" |
||||
rest_pat_in_fully_bound_structs = "warn" |
||||
return_self_not_must_use = "warn" |
||||
same_functions_in_if_condition = "warn" |
||||
same_name_method = "warn" |
||||
semicolon_inside_block = "warn" |
||||
shadow_same = "warn" |
||||
should_panic_without_expect = "warn" |
||||
single_match_else = "warn" |
||||
stable_sort_primitive = "warn" |
||||
str_to_string = "warn" |
||||
string_add = "warn" |
||||
string_add_assign = "warn" |
||||
string_lit_chars_any = "warn" |
||||
string_to_string = "warn" |
||||
struct_excessive_bools = "warn" |
||||
struct_field_names = "warn" |
||||
suspicious_xor_used_as_pow = "warn" |
||||
tests_outside_test_module = "warn" |
||||
todo = "warn" |
||||
transmute_ptr_to_ptr = "warn" |
||||
trivially_copy_pass_by_ref = "warn" |
||||
try_err = "warn" |
||||
unchecked_duration_subtraction = "warn" |
||||
undocumented_unsafe_blocks = "warn" |
||||
unicode_not_nfc = "warn" |
||||
unimplemented = "warn" |
||||
uninlined_format_args = "warn" |
||||
unnecessary_box_returns = "warn" |
||||
unnecessary_join = "warn" |
||||
unnecessary_safety_comment = "warn" |
||||
unnecessary_safety_doc = "warn" |
||||
unnecessary_self_imports = "warn" |
||||
unnecessary_wraps = "warn" |
||||
unneeded_field_pattern = "warn" |
||||
unnested_or_patterns = "warn" |
||||
unreadable_literal = "warn" |
||||
unsafe_derive_deserialize = "warn" |
||||
unseparated_literal_suffix = "warn" |
||||
unused_async = "warn" |
||||
unused_self = "warn" |
||||
unwrap_in_result = "warn" |
||||
use_debug = "warn" |
||||
used_underscore_binding = "warn" |
||||
verbose_bit_mask = "warn" |
||||
verbose_file_reads = "warn" |
||||
wildcard_dependencies = "warn" |
||||
zero_sized_map_values = "warn" |
@ -0,0 +1,25 @@ |
||||
# Oxigraph |
||||
|
||||
Oxigraph is a graph database library implementing the [SPARQL](https://www.w3.org/TR/sparql11-overview/) standard. |
||||
|
||||
The official upstream project is here: https://oxigraph.org/ |
||||
|
||||
https://github.com/oxigraph/oxigraph/ |
||||
|
||||
https://crates.io/crates/oxigraph |
||||
|
||||
This package (ng-oxigraph) is a fork used internally by NextGraph.org project. |
||||
|
||||
If you are interested to know more about NextGraph: https://nextgraph.org |
||||
|
||||
https://git.nextgraph.org/NextGraph/nextgraph-rs |
||||
|
||||
https://crates.io/crates/nextgraph |
||||
|
||||
## NextGraph |
||||
|
||||
> NextGraph brings about the convergence of P2P and Semantic Web technologies, towards a decentralized, secure and privacy-preserving cloud, based on CRDTs. |
||||
> |
||||
> This open source ecosystem provides solutions for end-users (a platform) and software developers (a framework), wishing to use or create **decentralized** apps featuring: **live collaboration** on rich-text documents, peer to peer communication with **end-to-end encryption**, offline-first, **local-first**, portable and interoperable data, total ownership of data and software, security and privacy. Centered on repositories containing **semantic data** (RDF), **rich text**, and structured data formats like **JSON**, synced between peers belonging to permissioned groups of users, it offers strong eventual consistency, thanks to the use of **CRDTs**. Documents can be linked together, signed, shared securely, queried using the **SPARQL** language and organized into sites and containers. |
||||
> |
||||
> More info here [https://nextgraph.org](https://nextgraph.org) |
@ -1,10 +1,10 @@ |
||||
#![cfg(test)] |
||||
#![allow(clippy::panic_in_result_fn)] |
||||
|
||||
use oxigraph::io::RdfFormat; |
||||
use oxigraph::model::vocab::{rdf, xsd}; |
||||
use oxigraph::model::*; |
||||
use oxigraph::store::Store; |
||||
use ng_oxigraph::io::RdfFormat; |
||||
use ng_oxigraph::model::vocab::{rdf, xsd}; |
||||
use ng_oxigraph::model::*; |
||||
use ng_oxigraph::store::Store; |
||||
#[cfg(all(not(target_family = "wasm")))] |
||||
use rand::random; |
||||
#[cfg(all(not(target_family = "wasm")))] |
@ -1,59 +0,0 @@ |
||||
[package] |
||||
name = "oxigraph" |
||||
version.workspace = true |
||||
authors.workspace = true |
||||
license.workspace = true |
||||
readme = "README.md" |
||||
keywords = ["RDF", "SPARQL", "graph-database", "database"] |
||||
categories = ["database-implementations"] |
||||
repository = "https://github.com/oxigraph/oxigraph/tree/main/lib/oxigraph" |
||||
homepage = "https://oxigraph.org/" |
||||
documentation = "https://docs.rs/oxigraph" |
||||
description = """ |
||||
a SPARQL database and RDF toolkit |
||||
""" |
||||
edition.workspace = true |
||||
rust-version.workspace = true |
||||
|
||||
[features] |
||||
js = ["getrandom/js", "oxsdatatypes/js", "js-sys"] |
||||
|
||||
|
||||
[dependencies] |
||||
digest.workspace = true |
||||
hex.workspace = true |
||||
json-event-parser.workspace = true |
||||
md-5.workspace = true |
||||
oxilangtag.workspace = true |
||||
oxiri.workspace = true |
||||
oxrdf = { workspace = true, features = ["rdf-star", "oxsdatatypes"] } |
||||
oxrdfio = { workspace = true, features = ["rdf-star"] } |
||||
oxsdatatypes.workspace = true |
||||
rand.workspace = true |
||||
regex.workspace = true |
||||
sha1.workspace = true |
||||
sha2.workspace = true |
||||
siphasher.workspace = true |
||||
sparesults = { workspace = true, features = ["rdf-star"] } |
||||
spargebra = { workspace = true, features = ["rdf-star", "sep-0002", "sep-0006"] } |
||||
sparopt = { workspace = true, features = ["rdf-star", "sep-0002", "sep-0006"] } |
||||
thiserror.workspace = true |
||||
|
||||
[target.'cfg(not(target_family = "wasm"))'.dependencies] |
||||
libc = "0.2" |
||||
rocksdb.workspace = true |
||||
|
||||
[target.'cfg(all(target_family = "wasm", target_os = "unknown"))'.dependencies] |
||||
getrandom.workspace = true |
||||
js-sys = { workspace = true, optional = true } |
||||
|
||||
[target.'cfg(not(target_family = "wasm"))'.dev-dependencies] |
||||
codspeed-criterion-compat.workspace = true |
||||
zstd.workspace = true |
||||
|
||||
[lints] |
||||
workspace = true |
||||
|
||||
[package.metadata.docs.rs] |
||||
rustdoc-args = ["--cfg", "docsrs"] |
||||
|
@ -1,82 +0,0 @@ |
||||
Oxigraph |
||||
======== |
||||
|
||||
[![Latest Version](https://img.shields.io/crates/v/oxigraph.svg)](https://crates.io/crates/oxigraph) |
||||
[![Released API docs](https://docs.rs/oxigraph/badge.svg)](https://docs.rs/oxigraph) |
||||
[![Crates.io downloads](https://img.shields.io/crates/d/oxigraph)](https://crates.io/crates/oxigraph) |
||||
[![actions status](https://github.com/oxigraph/oxigraph/workflows/build/badge.svg)](https://github.com/oxigraph/oxigraph/actions) |
||||
[![Gitter](https://badges.gitter.im/oxigraph/community.svg)](https://gitter.im/oxigraph/community) |
||||
|
||||
Oxigraph is a graph database library implementing the [SPARQL](https://www.w3.org/TR/sparql11-overview/) standard. |
||||
|
||||
Its goal is to provide a compliant, safe and fast on-disk graph database. |
||||
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 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: |
||||
* [SPARQL 1.1 Query](https://www.w3.org/TR/sparql11-query/), [SPARQL 1.1 Update](https://www.w3.org/TR/sparql11-update/), and [SPARQL 1.1 Federated Query](https://www.w3.org/TR/sparql11-federated-query/). |
||||
* [Turtle](https://www.w3.org/TR/turtle/), [TriG](https://www.w3.org/TR/trig/), [N-Triples](https://www.w3.org/TR/n-triples/), [N-Quads](https://www.w3.org/TR/n-quads/), and [RDF/XML](https://www.w3.org/TR/rdf-syntax-grammar/) RDF serialization formats for both data ingestion and retrieval. |
||||
* [SPARQL Query Results XML Format](https://www.w3.org/TR/rdf-sparql-XMLres/), [SPARQL 1.1 Query Results JSON Format](https://www.w3.org/TR/sparql11-results-json/) and [SPARQL 1.1 Query Results CSV and TSV Formats](https://www.w3.org/TR/sparql11-results-csv-tsv/). |
||||
|
||||
A preliminary benchmark [is provided](../bench/README.md). Oxigraph internal design [is described on the wiki](https://github.com/oxigraph/oxigraph/wiki/Architecture). |
||||
|
||||
The main entry point of Oxigraph is the [`Store`](store::Store) struct: |
||||
```rust |
||||
use oxigraph::store::Store; |
||||
use oxigraph::model::*; |
||||
use oxigraph::sparql::QueryResults; |
||||
|
||||
let store = Store::new().unwrap(); |
||||
|
||||
// insertion |
||||
let ex = NamedNode::new("http://example.com").unwrap(); |
||||
let quad = Quad::new(ex.clone(), ex.clone(), ex.clone(), GraphName::DefaultGraph); |
||||
store.insert(&quad).unwrap(); |
||||
|
||||
// quad filter |
||||
let results = store.quads_for_pattern(Some(ex.as_ref().into()), None, None, None).collect::<Result<Vec<Quad>,_>>().unwrap(); |
||||
assert_eq!(vec![quad], results); |
||||
|
||||
// SPARQL query |
||||
if let QueryResults::Solutions(mut solutions) = store.query("SELECT ?s WHERE { ?s ?p ?o }").unwrap() { |
||||
assert_eq!(solutions.next().unwrap().unwrap().get("s"), Some(&ex.into())); |
||||
} |
||||
``` |
||||
|
||||
It is based on these crates that can be used separately: |
||||
* [`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. |
||||
* [`sparesults`](https://crates.io/crates/sparesults), parsers and serializers for SPARQL result formats (the [`oxigraph::sparql::results`](crate::sparql::results) module). |
||||
* [`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 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. |
||||
|
||||
It is possible to disable the RocksDB storage backend to only use the in-memory fallback by disabling the `rocksdb` default feature: |
||||
```toml |
||||
oxigraph = { version = "*", default-features = false } |
||||
``` |
||||
This is the default behavior when compiling Oxigraph to WASM. |
||||
|
||||
## License |
||||
|
||||
This project is licensed under either of |
||||
|
||||
* Apache License, Version 2.0, ([LICENSE-APACHE](../LICENSE-APACHE) or |
||||
`<http://www.apache.org/licenses/LICENSE-2.0>`) |
||||
* MIT license ([LICENSE-MIT](../LICENSE-MIT) or |
||||
`<http://opensource.org/licenses/MIT>`) |
||||
|
||||
at your option. |
||||
|
||||
|
||||
### Contribution |
||||
|
||||
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Oxigraph by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. |
Loading…
Reference in new issue