forked from publysher/rdflib-django
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update code, build infrastructe and fix compatibility with new rdflib
- Loading branch information
Showing
22 changed files
with
2,220 additions
and
539 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[run] | ||
branch = True | ||
omit = | ||
tests/* | ||
[report] | ||
exclude_lines = | ||
pragma: no cover | ||
raise NotImplementedError | ||
return NotImplemented |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: rdflib-django3 | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python: ['3.9', '3.10', '3.11', '3.12'] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
- name: Install poetry | ||
run: python -m pip install poetry | ||
- name: Install package | ||
run: poetry install --only main,test | ||
- name: Run tox | ||
run: poetry run tox -s | ||
- name: Convert coverage | ||
run: poetry run coverage xml | ||
- name: Upload Coverage to Codecov | ||
uses: codecov/codecov-action@v3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
.*project | ||
*.py[co] | ||
.vscode | ||
.venv | ||
|
||
# Packages | ||
*.egg | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# rdflib-django3 | ||
|
||
fork from rdflib-django with multi store architecture, python3 and recent rdflib | ||
compatibility. | ||
|
||
A store implementation for `rdflib` that uses Django as its backend. | ||
|
||
The current implementation is context-aware but not formula-aware. | ||
|
||
The implementation assumes that contexts are used for named graphs. | ||
|
||
# Quick start | ||
|
||
Install rdflib-django3 with your package manager: | ||
|
||
```sh | ||
pip install rdflib-django3 | ||
``` | ||
|
||
Add `rdflib_django` to your `INSTALLED_APPS`: | ||
|
||
```python | ||
|
||
INSTALLED_APPS = ( | ||
# other apps | ||
'rdflib_django'. | ||
) | ||
``` | ||
|
||
You can now use the following examples to obtain a graph. | ||
|
||
Getting a graph using rdflib's store API: | ||
|
||
```python | ||
|
||
from rdflib import Graph | ||
|
||
graph = Graph('Django', identifier="fooo") | ||
graph.open(create=True) | ||
``` | ||
|
||
This example will give you a graph identified by a blank node within the | ||
default store. | ||
|
||
Getting a conjunctive graph using rdflib's store API: | ||
|
||
```python | ||
|
||
from rdflib import ConjunctiveGraph | ||
graph = ConjunctiveGraph('Django') | ||
``` | ||
|
||
This example will give you a conjunctive graph in the default store. | ||
|
||
Getting a named graph using rdflib-django's API: | ||
|
||
```python | ||
|
||
from rdflib_django import utils | ||
graph = utils.get_named_graph('http://example.com') | ||
``` | ||
|
||
Getting the conjunctive graph using rdflib-django3's API: | ||
|
||
```python | ||
|
||
from rdflib_django import utils | ||
graph = utils.get_conjunctive_graph() | ||
``` | ||
|
||
## Management commands | ||
|
||
`rdflib-django3` includes two management commands to import and export | ||
RDF: | ||
|
||
```sh | ||
|
||
python manage.py import_rdf --context=http://example.com my_file.rdf | ||
python manage.py export_rdf --context=http://example.com | ||
``` | ||
|
||
## License | ||
|
||
`rdflib-django3` is licensed under the `MIT license`. | ||
|
||
## Links | ||
|
||
[rdflib](http://pypi.python.org/pypi/rdflib/) |
This file was deleted.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.