oxigraph 0.4.10__py3-none-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,311 @@
1
+ Metadata-Version: 2.4
2
+ Name: oxigraph
3
+ Version: 0.4.10
4
+ Classifier: Development Status :: 3 - Alpha
5
+ Classifier: Intended Audience :: Developers
6
+ Classifier: License :: OSI Approved :: Apache Software License
7
+ Classifier: License :: OSI Approved :: MIT License
8
+ Classifier: Programming Language :: Rust
9
+ Summary: Oxigraph CLI tool and SPARQL HTTP server
10
+ Keywords: RDF,SPARQL,graph-database,database
11
+ Home-Page: https://oxigraph.org/cli/
12
+ Author: Tpt <thomas@pellissier-tanon.fr>
13
+ Author-email: Tpt <thomas@pellissier-tanon.fr>
14
+ License: MIT OR Apache-2.0
15
+ Description-Content-Type: text/markdown
16
+ Project-URL: Changelog, https://github.com/oxigraph/oxigraph/blob/main/CHANGELOG.md
17
+ Project-URL: Documentation, https://oxigraph.org/
18
+ Project-URL: Homepage, https://oxigraph.org/
19
+ Project-URL: Source, https://github.com/oxigraph/oxigraph/tree/main/cli
20
+ Project-URL: Tracker, https://github.com/oxigraph/oxigraph/issues
21
+
22
+ Oxigraph CLI
23
+ ============
24
+
25
+ [![Latest Version](https://img.shields.io/crates/v/oxigraph-cli.svg)](https://crates.io/crates/oxigraph-cli)
26
+ [![Crates.io downloads](https://img.shields.io/crates/d/oxigraph-cli)](https://crates.io/crates/oxigraph-cli)
27
+ [![Conda](https://img.shields.io/conda/vn/conda-forge/oxigraph-server)](https://anaconda.org/conda-forge/oxigraph-server)
28
+ [![actions status](https://github.com/oxigraph/oxigraph/workflows/build/badge.svg)](https://github.com/oxigraph/oxigraph/actions)
29
+ [![Gitter](https://badges.gitter.im/oxigraph/community.svg)](https://gitter.im/oxigraph/community)
30
+
31
+ Oxigraph CLI is a graph database implementing the [SPARQL](https://www.w3.org/TR/sparql11-overview/) standard.
32
+ It is packaged as a command-line tool allowing to manipulate RDF files, query them using SPARQL...
33
+ It also allows spawning an HTTP server on top of the database.
34
+
35
+ Oxigraph is in heavy development, and SPARQL query evaluation has not been optimized yet.
36
+
37
+ Oxigraph provides different installation methods for Oxigraph CLI:
38
+ * [`cargo install`](#installation) (multiplatform)
39
+ * [A Docker image](#using-a-docker-image)
40
+ * [A Homebrew formula](#homebrew)
41
+ * [A conda-forge package](https://anaconda.org/conda-forge/oxigraph-server)
42
+ * [Pre-built binaries](https://github.com/oxigraph/oxigraph/releases/latest)
43
+
44
+ It is also usable as [a Rust library](https://crates.io/crates/oxigraph) and as [a Python library](https://pyoxigraph.readthedocs.io/).
45
+
46
+ Oxigraph implements the following specifications:
47
+ * [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/).
48
+ * [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.
49
+ * [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/).
50
+ * [SPARQL 1.1 Protocol](https://www.w3.org/TR/sparql11-protocol/#query-operation) and [SPARQL 1.1 Graph Store HTTP Protocol](https://www.w3.org/TR/sparql11-http-rdf-update/).
51
+
52
+ A preliminary benchmark [is provided](../bench/README.md).
53
+
54
+ Note that Oxigraph CLI was previously named Oxigraph Server before version 0.4. Older versions are available under [this name](https://crates.io/crates/oxigraph_server).
55
+
56
+ [![Packaging status](https://repology.org/badge/vertical-allrepos/oxigraph.svg)](https://repology.org/project/oxigraph/versions)
57
+
58
+ ## Installation
59
+
60
+ You need to have [a recent stable version of Rust and Cargo installed](https://www.rust-lang.org/tools/install).
61
+
62
+ To download, build and install the latest released version run `cargo install oxigraph-cli`.
63
+ There is no need to clone the git repository.
64
+
65
+ To compile the command-line tool from source, clone this git repository including its submodules (`git clone --recursive https://github.com/oxigraph/oxigraph.git`), and execute `cargo build --release` in the `cli` directory to compile the full binary after having downloaded its dependencies.
66
+ It will create a fat binary in `target/release/oxigraph`.
67
+
68
+ Some build options (cargo features) are available:
69
+ - `rocksdb-pkg-config`: links against an already compiled rocksdb shared library found using [pkg-config](https://crates.io/crates/pkg-config).
70
+ - `native-tls`: Enables Oxigraph HTTP client for query federation using the host OS TLS stack (enabled by default).
71
+ - `rustls-native` Enables Oxigraph HTTP client for query federation using [Rustls](https://crates.io/crates/rustls) and the native certificates.
72
+ - `rustls-webpki` Enables Oxigraph HTTP client for query federation using [Rustls](https://crates.io/crates/rustls) and the [Common CA Database](https://www.ccadb.org/) certificates.
73
+
74
+
75
+ ## Usage
76
+
77
+ Run `oxigraph serve --location my_data_storage_directory` to start the server where `my_data_storage_directory` is the directory where you want Oxigraph data to be stored. It listens by default on `localhost:7878`.
78
+
79
+ The server provides an HTML UI, based on [YASGUI](https://yasgui.triply.cc), with a form to execute SPARQL requests.
80
+
81
+ It provides the following REST actions:
82
+ * `/query` allows evaluating SPARQL queries against the server repository following the [SPARQL 1.1 Protocol](https://www.w3.org/TR/sparql11-protocol/#query-operation).
83
+ For example:
84
+ ```bash
85
+ curl -X POST -H 'Content-Type:application/sparql-query' \
86
+ --data 'SELECT * WHERE { ?s ?p ?o } LIMIT 10' http://localhost:7878/query
87
+ ```
88
+ This action supports content negotiation and could return [Turtle](https://www.w3.org/TR/turtle/), [N-Triples](https://www.w3.org/TR/n-triples/), [RDF/XML](https://www.w3.org/TR/rdf-syntax-grammar/), [SPARQL Query Results XML Format](https://www.w3.org/TR/rdf-sparql-XMLres/) and [SPARQL Query Results JSON Format](https://www.w3.org/TR/sparql11-results-json/).
89
+ * `/update` allows to execute SPARQL updates against the server repository following the [SPARQL 1.1 Protocol](https://www.w3.org/TR/sparql11-protocol/#update-operation).
90
+ For example:
91
+ ```sh
92
+ curl -X POST -H 'Content-Type: application/sparql-update' \
93
+ --data 'DELETE WHERE { <http://example.com/s> ?p ?o }' http://localhost:7878/update
94
+ ```
95
+ * `/store` allows to retrieve and change the server content using the [SPARQL 1.1 Graph Store HTTP Protocol](https://www.w3.org/TR/sparql11-http-rdf-update/).
96
+ For example:
97
+ ```sh
98
+ curl -f -X POST -H 'Content-Type:application/n-triples' \
99
+ -T MY_FILE.nt "http://localhost:7878/store?graph=http://example.com/g"
100
+ ```
101
+ will add the N-Triples file `MY_FILE.nt` to the server dataset inside of the `http://example.com/g` named graph.
102
+ [Turtle](https://www.w3.org/TR/turtle/), [N-Triples](https://www.w3.org/TR/n-triples/) and [RDF/XML](https://www.w3.org/TR/rdf-syntax-grammar/) are supported.
103
+ It is also possible to `POST`, `PUT` and `GET` the complete RDF dataset on the server using RDF dataset formats ([TriG](https://www.w3.org/TR/trig/) and [N-Quads](https://www.w3.org/TR/n-quads/)) against the `/store` endpoint.
104
+ For example:
105
+ ```sh
106
+ curl -f -X POST -H 'Content-Type:application/n-quads' \
107
+ -T MY_FILE.nq http://localhost:7878/store
108
+ ```
109
+ will add the N-Quads file `MY_FILE.nq` to the server dataset.
110
+
111
+ Use `oxigraph --help` to see the possible options when starting the server.
112
+
113
+ It is also possible to load RDF data offline using bulk loading:
114
+ `oxigraph load --location my_data_storage_directory --file my_file.nq`
115
+
116
+ ## Using a Docker image
117
+
118
+ ### Display the help menu
119
+ ```sh
120
+ docker run --rm ghcr.io/oxigraph/oxigraph --help
121
+ ```
122
+
123
+ ### Run the Webserver
124
+ Expose the server on port `7878` of the host machine, and save data on the local `./data` folder
125
+ ```sh
126
+ docker run --rm -v $PWD/data:/data -p 7878:7878 ghcr.io/oxigraph/oxigraph serve --location /data --bind 0.0.0.0:7878
127
+ ```
128
+
129
+ You can then access it from your machine on port `7878`:
130
+
131
+ ```sh
132
+ # Open the GUI in a browser
133
+ firefox http://localhost:7878
134
+
135
+ # Post some data
136
+ curl http://localhost:7878/store?default -H 'Content-Type: text/turtle' -T ./data.ttl
137
+
138
+ # Make a query
139
+ curl -X POST -H 'Accept: application/sparql-results+json' -H 'Content-Type: application/sparql-query' --data 'SELECT * WHERE { ?s ?p ?o } LIMIT 10' http://localhost:7878/query
140
+
141
+ # Make an UPDATE
142
+ curl -X POST -H 'Content-Type: application/sparql-update' --data 'DELETE WHERE { <http://example.com/s> ?p ?o }' http://localhost:7878/update
143
+ ```
144
+
145
+ ### Run the Web server with basic authentication
146
+
147
+ It can be useful to make Oxigraph SPARQL endpoint available publicly, with a layer of authentication on `/update` to be able to add data.
148
+
149
+ You can do so by using a nginx basic authentication in an additional docker container with `docker-compose`. First create a `nginx.conf` file:
150
+
151
+ ```nginx
152
+ daemon off;
153
+ events {
154
+ worker_connections 1024;
155
+ }
156
+ http {
157
+ server {
158
+ server_name localhost;
159
+ listen 7878;
160
+ rewrite ^/(.*) /$1 break;
161
+ proxy_ignore_client_abort on;
162
+ proxy_set_header X-Real-IP $remote_addr;
163
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
164
+ proxy_set_header Host $http_host;
165
+ proxy_set_header Access-Control-Allow-Origin "*";
166
+ location ~ ^(/|/query)$ {
167
+ proxy_pass http://oxigraph:7878;
168
+ proxy_pass_request_headers on;
169
+ }
170
+ location ~ ^(/update|/store)$ {
171
+ auth_basic "Oxigraph Administrator's Area";
172
+ auth_basic_user_file /etc/nginx/.htpasswd;
173
+ proxy_pass http://oxigraph:7878;
174
+ proxy_pass_request_headers on;
175
+ }
176
+ }
177
+ }
178
+ ```
179
+
180
+ Then a `docker-compose.yml` in the same folder, you can change the default user and password in the `environment` section:
181
+
182
+ ```yaml
183
+ version: "3"
184
+ services:
185
+ oxigraph:
186
+ image: ghcr.io/oxigraph/oxigraph:latest
187
+ ## To build from local source code:
188
+ # build:
189
+ # context: .
190
+ # dockerfile: server/Dockerfile
191
+ volumes:
192
+ - ./data:/data
193
+
194
+ nginx-auth:
195
+ image: nginx:1.21.4
196
+ environment:
197
+ - OXIGRAPH_USER=oxigraph
198
+ - OXIGRAPH_PASSWORD=oxigraphy
199
+ volumes:
200
+ - ./nginx.conf:/etc/nginx/nginx.conf
201
+ ## For multiple users: uncomment this line to mount a pre-generated .htpasswd
202
+ # - ./.htpasswd:/etc/nginx/.htpasswd
203
+ ports:
204
+ - "7878:7878"
205
+ entrypoint: "bash -c 'echo -n $OXIGRAPH_USER: >> /etc/nginx/.htpasswd && echo $OXIGRAPH_PASSWORD | openssl passwd -stdin -apr1 >> /etc/nginx/.htpasswd && /docker-entrypoint.sh nginx'"
206
+ ```
207
+
208
+ Once the `docker-compose.yaml` and `nginx.conf` are ready, start the Oxigraph server and nginx proxy for authentication on http://localhost:7878:
209
+
210
+ ```sh
211
+ docker-compose up
212
+ ```
213
+
214
+ Then it is possible to update the graph using basic authentication mechanisms. For example with `curl`: change `$OXIGRAPH_USER` and `$OXIGRAPH_PASSWORD`, or set them as environment variables, then run this command to insert a simple triple:
215
+
216
+ ```sh
217
+ curl -X POST -u $OXIGRAPH_USER:$OXIGRAPH_PASSWORD -H 'Content-Type: application/sparql-update' --data 'INSERT DATA { <http://example.com/s> <http://example.com/p> <http://example.com/o> }' http://localhost:7878/update
218
+ ```
219
+
220
+ In case you want to have multiple users, you can comment the `entrypoint:` line in the `docker-compose.yml` file, uncomment the `.htpasswd` volume, then generate each user in the `.htpasswd` file with this command:
221
+
222
+ ```sh
223
+ htpasswd -Bbn $OXIGRAPH_USER $OXIGRAPH_PASSWORD >> .htpasswd
224
+ ```
225
+
226
+ ### Build the image
227
+
228
+ You could easily build your own Docker image by cloning this repository with its submodules, and going to the root folder:
229
+
230
+ ```sh
231
+ git clone --recursive https://github.com/oxigraph/oxigraph.git
232
+ cd oxigraph
233
+ ```
234
+
235
+ Then run this command to build the image locally:
236
+
237
+ ````sh
238
+ docker build -t ghcr.io/oxigraph/oxigraph -f server/Dockerfile .
239
+ ````
240
+
241
+ ## Homebrew
242
+
243
+ Oxigraph maintains a [Homebrew](https://brew.sh) formula in [a custom tap](https://github.com/oxigraph/homebrew-oxigraph).
244
+
245
+ To install Oxigraph server using Homebrew do:
246
+ ```sh
247
+ brew tap oxigraph/oxigraph
248
+ brew install oxigraph
249
+ ```
250
+ It installs the `oxigraph` binary. [See the usage documentation to know how to use it](#usage).
251
+
252
+
253
+ ## Systemd
254
+
255
+ It is possible to run Oxigraph in the background using systemd.
256
+
257
+ For that, you can use the following `oxigraph.service` file (it might be inserted into `/etc/systemd/system/` or `$HOME/.config/systemd/user`):
258
+ ```ini
259
+ [Unit]
260
+ Description=Oxigraph database server
261
+ After=network-online.target
262
+ Wants=network-online.target
263
+
264
+ [Service]
265
+ Type=notify
266
+ ExecStart=/PATH/TO/oxigraph serve --location /PATH/TO/OXIGRAPH/DATA
267
+
268
+ [Install]
269
+ WantedBy=multi-user.target
270
+ ```
271
+
272
+ ## Man pages and autocompletion
273
+
274
+ Autocompletion for various shells are generated on build in the `target/{debug,release}/build/oxigraph-cli-<hash>/out/complete` directory.
275
+ Similarly, man pages are generated in the `target/{debug,release}/build/oxigraph-cli-<hash>/out/man` directory.
276
+
277
+ ## Migration guide
278
+
279
+ ### From 0.2 to 0.3
280
+ * The cli API has been completely rewritten. To start the server run `oxigraph serve --location MY_STORAGE` instead of `oxigraph --file MY_STORAGE`.
281
+ * Fast data bulk loading is now supported using `oxigraph load --location MY_STORAGE --file MY_FILE`. The file format is guessed from the extension (`.nt`, `.ttl`, `.nq`, ...).
282
+ * [RDF-star](https://w3c.github.io/rdf-star/cg-spec/2021-12-17.html) is now implemented.
283
+ * All operations are now transactional using the "repeatable read" isolation level:
284
+ the store only exposes changes that have been "committed" (i.e. no partial writes)
285
+ and the exposed state does not change for the complete duration of a read operation (e.g. a SPARQL query) or a read/write operation (e.g. a SPARQL update).
286
+
287
+
288
+ ## Help
289
+
290
+ Feel free to use [GitHub discussions](https://github.com/oxigraph/oxigraph/discussions) or [the Gitter chat](https://gitter.im/oxigraph/community) to ask questions or talk about Oxigraph.
291
+ [Bug reports](https://github.com/oxigraph/oxigraph/issues) are also very welcome.
292
+
293
+ If you need advanced support or are willing to pay to get some extra features, feel free to reach out to [Tpt](https://github.com/Tpt).
294
+
295
+
296
+ ## License
297
+
298
+ This project is licensed under either of
299
+
300
+ * Apache License, Version 2.0, ([LICENSE-APACHE](../LICENSE-APACHE) or
301
+ http://www.apache.org/licenses/LICENSE-2.0)
302
+ * MIT license ([LICENSE-MIT](../LICENSE-MIT) or
303
+ http://opensource.org/licenses/MIT)
304
+
305
+ at your option.
306
+
307
+
308
+ ### Contribution
309
+
310
+ 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.
311
+
@@ -0,0 +1,4 @@
1
+ oxigraph-0.4.10.data/scripts/oxigraph.exe,sha256=fysvZzQUugNpQFlVkqsPDBqY35Da0mDiPVktsU--4U0,13140480
2
+ oxigraph-0.4.10.dist-info/METADATA,sha256=UFFU9p4gTUGkCNHQ3zVMdocpfVvyhuN6hvowaB6adnI,15018
3
+ oxigraph-0.4.10.dist-info/WHEEL,sha256=ezZ0UavAgFc3zAwcynOaW_2bkD5G8wEuJDlcNOURk-k,93
4
+ oxigraph-0.4.10.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: maturin (1.8.6)
3
+ Root-Is-Purelib: false
4
+ Tag: py3-none-win_amd64