Skip to content

Commit 87ed8d1

Browse files
authored
replace PR 3109; improve plugins modules docs; change header colour to blue grey; add 7to8 stub (#3145)
1 parent 3b2c6f3 commit 87ed8d1

File tree

11 files changed

+25
-40
lines changed

11 files changed

+25
-40
lines changed

docs/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
![RDFLib logo](_static/RDFlib.png)
2+
13
# RDFLib
24

35
RDFLib is a pure Python package for working with [RDF](http://www.w3.org/RDF/). It contains:

docs/upgrade7to8.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Upgrading from version 7 to 8
2+
3+
!!! warning "In Development"
4+
This page is in development and will only be completed with the release of RDFLib v8.
5+
6+
## Python version
7+
8+
RDFLib 7 requires Python 3.9 or later.
9+

examples/custom_eval.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,7 @@
66
asking for `rdf:type` triples.
77
88
Here the custom eval function is added manually, normally you would use
9-
setuptools and entry_points to do it:
10-
i.e. in your setup.py::
11-
12-
```python
13-
entry_points = {
14-
'rdf.plugins.sparqleval': [
15-
'myfunc = mypackage:MyFunction',
16-
],
17-
}
18-
```
9+
entry points to do it. See the [Plugins Usage Documentation](/plugins/).
1910
"""
2011

2112
from pathlib import Path

mkdocs.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ nav:
2929

3030
- Changes:
3131
- Changelog: changelog.md
32+
- Upgrading v7 to 8: upgrade7to8.md
3233
- Upgrading v6 to 7: upgrade6to7.md
3334
- Upgrading v5 to 6: upgrade5to6.md
3435
- Upgrading v4 to 5: upgrade4to5.md
@@ -43,6 +44,7 @@ nav:
4344
- Container: apidocs/rdflib.container.md
4445
- Collection: apidocs/rdflib.collection.md
4546
- Paths: apidocs/rdflib.paths.md
47+
- Plugin: apidocs/rdflib.plugin.md
4648
- Util: apidocs/rdflib.util.md
4749
- Plugins:
4850
- Parsers: apidocs/rdflib.plugins.parsers.md
@@ -68,7 +70,7 @@ theme:
6870
# Choose color: https://squidfunk.github.io/mkdocs-material/setup/changing-the-colors/#primary-color
6971
palette:
7072
- media: "(prefers-color-scheme: light)"
71-
primary: indigo
73+
primary: blue grey
7274
scheme: default
7375
toggle:
7476
icon: material/weather-night

rdflib/plugin.py

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,9 @@
1-
"""Plugin support for rdf.
2-
3-
There are a number of plugin points for rdf: parser, serializer,
1+
"""There are a number of plugin points for rdf: parser, serializer,
42
store, query processor, and query result. Plugins can be registered
5-
either through setuptools entry_points or by calling
3+
either automatically through entry points or by calling
64
rdf.plugin.register directly.
75
8-
If you have a package that uses a setuptools based `setup.py` you can add the
9-
following to your setup:
10-
11-
```python
12-
entry_points = {
13-
'rdf.plugins.parser': [
14-
'nt = rdf.plugins.parsers.ntriples:NTParser',
15-
],
16-
'rdf.plugins.serializer': [
17-
'nt = rdf.plugins.serializers.NTSerializer:NTSerializer',
18-
],
19-
}
20-
```
21-
22-
See the [setuptools dynamic discovery of services and plugins](http://peak.telecommunity.com/DevCenter/setuptools#dynamic-discovery-of-services-and-plugins)
23-
for moreinformation.
6+
For more details, see the [Plugins Usage Documentation](/plugins/).
247
"""
258

269
from __future__ import annotations

rdflib/plugins/__init__.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
"""
2-
Default plugins for rdflib.
3-
4-
This is a namespace package and contains the default plugins for
5-
rdflib.
2+
Default plugins for RDFLib.
63
4+
This is a namespace package and contains the default plugins for RDFLib.
75
"""

rdflib/plugins/parsers/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
"""
2-
1+
"""Modules for parsing serialized RDF such as Turtle, JSON-LD etc.
32
"""
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
"""Modules for serializing RDFLib graphs into XML, HexTuples, N3, Turtle etc.
2+
"""

rdflib/plugins/shared/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Modules shared by serializers & parsers. Currently only JSON-LD code."""

rdflib/plugins/sparql/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
"""SPARQL implementation for RDFLib
2-
3-
!!! example "New in version 4.0"
42
"""
53

64
from importlib.metadata import entry_points

0 commit comments

Comments
 (0)