Skip to content

Commit 4e04cf0

Browse files
committed
Update documentation
1 parent fb4f817 commit 4e04cf0

File tree

2 files changed

+48
-3
lines changed

2 files changed

+48
-3
lines changed

README.md

+37-3
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,49 @@
22

33
Serve an RDF file as an [RDFLib](https://rdflib.readthedocs.io/) Graph through a SPARQL endpoint served as [fastapi](https://fastapi.tiangolo.com/) with [rdflib-endpoint](https://pypi.org/project/rdflib-endpoint/) ([github](https://github.com/vemonet/rdflib-endpoint)).
44

5+
## Install
6+
7+
```sh
8+
$ task install
9+
```
10+
11+
or
12+
13+
```sh
14+
$ poetry install
15+
```
16+
517
## Run Locally
618

19+
```sh
20+
$ GRAPH_FILE=graph.ttl task serve:dev
21+
# or
22+
$ GRAPH_FILE=graph.ttl task serve:uvicorn
723
```
24+
25+
or
26+
27+
```sh
28+
$ GRAPH_FILE=graph.ttl poetry run fastapi dev sparql_file.py
29+
# or
830
$ GRAPH_FILE=graph.ttl poetry run uvicorn sparql_file:app --host 0.0.0.0 --port 8080
931
```
1032

11-
## Run With Podman/Docker
33+
## Run With Podman/Docker (local build)
1234

13-
```
35+
```sh
1436
$ task build
15-
$ podman run -d --rm -v /path/to/graph_file.ttl:/data/graph.ttl:z -p 8080:8080 ghcr.io/aksw/sparql-file:main
37+
$ podman run -d --rm -v /path/to/graph_file.ttl:/data/graph.ttl:z -p 8080:8080 localhost/sparql-file:latest
38+
```
39+
40+
## Run With Podman/Docker (ghcr.io registry build)
41+
42+
```sh
43+
$ GRAPH_FILE=graph.ttl task serve:container
44+
```
45+
46+
or
47+
48+
```sh
49+
$ podman run -d --rm -e GRAPH_FILE="/data/graph.ttl" -v /path/to/graph_file.ttl:/data/graph.ttl:z -p 8080:8080 ghcr.io/aksw/sparql-file:main
1650
```

Taskfile.yaml

+11
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,24 @@ tasks:
99
serve:
1010
desc: Start a development server
1111
aliases: [run]
12+
cmds:
13+
- task: serve:dev
14+
15+
serve:dev:
16+
desc: Start a development server
1217
cmds:
1318
- poetry run fastapi dev sparql_file.py
1419

1520
serve:uvicorn:
21+
desc: Run with uvicorn
1622
cmds:
1723
- poetry run uvicorn sparql_file:app --host 0.0.0.0 --port 8080
1824

25+
serve:container:
26+
desc: Run the container with podman
27+
cmds:
28+
- podman run -d --rm -v {{.GRAPH_FILE}}:/data/graph.ttl:z -p 8080:8080 ghcr.io/aksw/sparql-file:main
29+
1930
build:
2031
desc: Build the container image
2132
cmds:

0 commit comments

Comments
 (0)