Skip to content

Tidy up of examples docs #3028

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 23 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
c3c12b2
remove ConjunctiveGraph example; add Dataset example; add JSON-LS ser…
nicholascar Jan 9, 2025
76a870c
7.1.3 prep (#3036)
edmondchuc Jan 16, 2025
4b0f580
7.1.3-pre-release
nicholascar Jan 18, 2025
006949a
small docco update (#3053)
nicholascar Jan 18, 2025
f4f3b73
7.1.3-post-release; some updated release info for devs (#3054)
nicholascar Jan 18, 2025
7d3666e
build(deps): bump orjson from 3.10.13 to 3.10.15 (#3055)
dependabot[bot] Jan 23, 2025
62c528d
build(deps-dev): bump ruff from 0.8.6 to 0.9.2 (#3047)
dependabot[bot] Jan 23, 2025
47165fc
build(deps): bump html5rdf from 1.2.0 to 1.2.1 in /docker/latest (#3045)
dependabot[bot] Feb 19, 2025
74afcb0
build(deps): bump html5rdf from 1.2 to 1.2.1 (#3048)
dependabot[bot] Feb 19, 2025
cfd4222
build(deps-dev): bump wheel from 0.44.0 to 0.45.1 (#3051)
dependabot[bot] Feb 19, 2025
89103ec
build(deps-dev): bump ruff 0.9.2 - 0.9.6 + readthedocs conf (#3072)
dependabot[bot] Mar 22, 2025
282ed56
build(deps): bump lxml from 5.3.0 to 5.3.1 (#3071)
dependabot[bot] Mar 22, 2025
62685d8
Cope with Namespace annotations in Python 3.14 (#3084)
nphilipp Mar 22, 2025
9af9a40
build(deps): bump dorny/test-reporter from 1 to 2 (#3081)
dependabot[bot] Mar 22, 2025
c1fc39e
build(deps-dev): bump pytest from 8.3.4 to 8.3.5 (#3079)
dependabot[bot] Mar 22, 2025
e4d28f1
build(deps): bump library/python in /docker/unstable (#3067)
dependabot[bot] Mar 22, 2025
69b7d6c
build(deps): bump library/python in /docker/latest (#3066)
dependabot[bot] Mar 22, 2025
b74c657
remove old hacks against 2to3 (#3076)
a-detiste Mar 22, 2025
c560028
Downgrade log message about plugin without override argument to debu…
yarikoptic Mar 22, 2025
7d1f4c7
[pre-commit.ci] pre-commit autoupdate (#3056)
pre-commit-ci[bot] Mar 22, 2025
8bbb30d
Reduce warnings (#3085)
nicholascar Mar 23, 2025
56438f4
Merge branch 'main' into tidy-ex-docs
nicholascar Mar 23, 2025
d15a808
Merge branch '8.x' into tidy-ex-docs
nicholascar Mar 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ jobs:
checks: write
statuses: write
steps:
- uses: dorny/test-reporter@v1
- uses: dorny/test-reporter@v2
with:
artifact: /(.*)-mypy-junit-xml$/
name: mypy report
path: "*.xml"
reporter: java-junit
fail-on-error: "false"
- uses: dorny/test-reporter@v1
- uses: dorny/test-reporter@v2
with:
artifact: /(.*)-pytest-junit-xml$/
name: pytest report
Expand Down
11 changes: 5 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
---
ci:
# https://pre-commit.ci/#configuration
autoupdate_schedule: quarterly
autoupdate_schedule: weekly
autofix_prs: false

# https://pre-commit.com/#adding-pre-commit-plugins-to-your-project
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# WARNING: Ruff version should be the same as in `pyproject.toml`
rev: v0.8.6
rev: v0.11.0
hooks:
- id: ruff
args: ["--fix"]
- repo: https://github.com/psf/black-pre-commit-mirror
# WARNING: Black version should be the same as in `pyproject.toml`
rev: "24.10.0"
rev: "24.4.2"
hooks:
- id: black
pass_filenames: false
require_serial: true
args: ["."]
- repo: https://github.com/python-poetry/poetry
rev: 2.0.0
rev: 2.1.1
hooks:
- id: poetry-check
- id: poetry-lock
# sadly `--no-update` does not work on pre-commit.ci

args: ["--lock"]
1 change: 1 addition & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ build:
- python -c "from rdflib import Graph; print(Graph)"

sphinx:
configuration: docs/conf.py
fail_on_warning: true
39 changes: 21 additions & 18 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
## 2025-01-10 RELEASE 7.1.2
## 2025-01-17 RELEASE 7.1.3

A fix-up release that re-adds support for Python 3.8 after it was accidentally
removed in Release 7.1.2.

This release cherrypicks many additions to 7.1.2 added to 7.1.1 but leaves out
typing changes that are not compatible
with Python 3.8.

A minor release that bumped up a few dev dependencies and achieved a few small but notable improvements, particularly with longturtle sorting:
Also not carried over from 7.1.2 is the change from Poetry 1.x to 2.0.

Feature PRs:
Included are PRs such as _Defined Namespace warnings fix_, _sort longturtle
blank nodes_, _deterministic longturtle serialisation_ and _Dataset documentation
improvements_.

* [PR #2963](https://github.com/RDFLib/rdflib/pull/2963) Big typing updates
* [PR #2964](https://github.com/RDFLib/rdflib/pull/2964) Defined Namesapce warnings fix
* [PR #2971](https://github.com/RDFLib/rdflib/pull/2971) convert uses of Optional and some Union usage to union operator |
* [PR #2989](https://github.com/RDFLib/rdflib/pull/2989) Fixed incorrect ASK behaviour for dataset with one element
* [PR #2997](https://github.com/RDFLib/rdflib/pull/2997) sort longturtle blank nodes
* [PR #3008](https://github.com/RDFLib/rdflib/pull/3008) deterministic longturtle serialisation using RDF canonicalization + n-triples sort
* [PR #3012](https://github.com/RDFLib/rdflib/pull/3012) Dataset documentation improvements
For the full list of included PRs, see the preparatory PR:
<https://github.com/RDFLib/rdflib/pull/3036>.

Dependency bumps:
## 2025-01-10 RELEASE 7.1.2

A minor release that inadvertently removed support for Python 3.8. This release
how now been deleted.

* ruff from 0.71 -> 0.8.6
* orjson 3.10.10 ->
* pytest-cov to 6.0.0
* coverage to 7.6.10
* pytest to 8.3.4
* poetry to 2.0.0
All the improved features initially made available in this release that were
compatible with Python 3.8 have been preserved in the 7.1.3 release. The main
additions to 7.1.2 not preserved in 7.1.3 are updated type hints.

## 2024-10-17 RELEASE 7.1.1

Expand Down Expand Up @@ -54,7 +58,6 @@ Merged PRs:
* 2024-10-23 - build(deps-dev): bump ruff from 0.6.9 to 0.7.0
[PR #2942](https://github.com/RDFLib/rdflib/pull/2942)


## 2024-10-17 RELEASE 7.1.0

This minor release incorporates just over 100 substantive PRs - interesting
Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ authors:
- family-names: "Stuart"
given-names: "Veyndan"
title: "RDFLib"
version: 7.1.2
date-released: 2025-01-10
version: 7.1.3
date-released: 2024-01-18
url: "https://github.com/RDFLib/rdflib"
doi: 10.5281/zenodo.6845245
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ RDFLib

RDFLib is a pure Python package for working with [RDF](http://www.w3.org/RDF/). RDFLib contains most things you need to work with RDF, including:

* parsers and serializers for RDF/XML, N3, NTriples, N-Quads, Turtle, TriX, Trig and JSON-LD
* parsers and serializers for RDF/XML, N3, NTriples, N-Quads, Turtle, TriX, Trig, JSON-LD and even HexTuples
* a Graph interface which can be backed by any one of a number of Store implementations
* store implementations for in-memory, persistent on disk (Berkeley DB) and remote SPARQL endpoints
* Store implementations for in-memory, persistent on disk (Berkeley DB) and remote SPARQL endpoints
* additional Stores can be supplied via plugins
* a SPARQL 1.1 implementation - supporting SPARQL 1.1 Queries and Update statements
* SPARQL function extension mechanisms

Expand All @@ -29,10 +30,8 @@ The RDFlib community maintains many RDF-related Python code repositories with di

* [rdflib](https://github.com/RDFLib/rdflib) - the RDFLib core
* [sparqlwrapper](https://github.com/RDFLib/sparqlwrapper) - a simple Python wrapper around a SPARQL service to remotely execute your queries
* [pyLODE](https://github.com/RDFLib/pyLODE) - An OWL ontology documentation tool using Python and templating, based on LODE.
* [pyrdfa3](https://github.com/RDFLib/pyrdfa3) - RDFa 1.1 distiller/parser library: can extract RDFa 1.1/1.0 from (X)HTML, SVG, or XML in general.
* [pymicrodata](https://github.com/RDFLib/pymicrodata) - A module to extract RDF from an HTML5 page annotated with microdata.
* [pySHACL](https://github.com/RDFLib/pySHACL) - A pure Python module which allows for the validation of RDF graphs against SHACL graphs.
* [pyLODE](https://github.com/RDFLib/pyLODE) - An OWL ontology documentation tool using Python and templating, based on LODE
* [pySHACL](https://github.com/RDFLib/pySHACL) - A pure Python module which allows for the validation of RDF graphs against SHACL graphs
* [OWL-RL](https://github.com/RDFLib/OWL-RL) - A simple implementation of the OWL2 RL Profile which expands the graph with all possible triples that OWL RL defines.

Please see the list for all packages/repositories here:
Expand All @@ -43,10 +42,13 @@ Help with maintenance of all of the RDFLib family of packages is always welcome

## Versions & Releases

* `main` branch in this repository is the unstable release
* `7.1.2` current stable release, small improvements on to 7.1.1
* `main` branch in this repository is the current unstable release
* `7.1.3` current stable release, small improvements to 7.1.1
* `7.1.2` previously deleted release
* `7.1.1` previous stable release
* see <https://github.com/RDFLib/rdflib/releases/tag/7.1.1>
* `7.0.0` previous stable release, supports Python 3.8.1+ only.
* see [Releases](https://github.com/RDFLib/rdflib/releases)
* `6.x.y` supports Python 3.7+ only. Many improvements over 5.0.0
* see <https://github.com/RDFLib/rdflib/releases/tag/6.3.2>
* `5.x.y` supports Python 2.7 and 3.4+ and is [mostly backwards compatible with 4.2.2](https://rdflib.readthedocs.io/en/stable/upgrade4to5.html).
Expand All @@ -69,8 +71,6 @@ Some features of RDFLib require optional dependencies which may be installed usi
Alternatively manually download the package from the Python Package
Index (PyPI) at https://pypi.python.org/pypi/rdflib

The current version of RDFLib is 7.1.2, see the ``CHANGELOG.md`` file for what's new in this release.

### Installation of the current main branch (for developers)

With *pip* you can also install rdflib from the git repository with one of the following options:
Expand Down
3 changes: 1 addition & 2 deletions devtools/requirements-poetry.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Fixing this here as readthedocs can't use the compiled requirements-poetry.txt
# due to conflicts.
poetry==2.0.0
poetry-plugin-export==1.9.0
poetry==1.8.5
2 changes: 1 addition & 1 deletion docker/latest/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM docker.io/library/python:3.13.1-slim@sha256:1127090f9fff0b8e7c3a1367855ef8a3299472d2c9ed122948a576c39addeaf1
FROM docker.io/library/python:3.13.2-slim@sha256:ae9f9ac89467077ed1efefb6d9042132d28134ba201b2820227d46c9effd3174

COPY docker/latest/requirements.txt /var/tmp/build/

Expand Down
2 changes: 1 addition & 1 deletion docker/latest/requirements.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is used for building a docker image of the latest rdflib release. It
# will be updated by dependabot when new releases are made.
rdflib==7.1.2
rdflib==7.1.3
html5rdf==1.2.1
12 changes: 7 additions & 5 deletions docker/latest/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# This file is autogenerated by pip-compile with Python 3.8
# by the following command:
#
# pip-compile docker/latest/requirements.in
#
html5rdf==1.2.1
# via -r docker/latest/requirements.in
pyparsing==3.2.0
# via -r requirements.in
isodate==0.7.2
# via rdflib
rdflib==7.1.2
# via -r docker/latest/requirements.in
pyparsing==3.0.9
# via rdflib
rdflib==7.1.3
# via -r requirements.in
2 changes: 1 addition & 1 deletion docker/unstable/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM docker.io/library/python:3.13.1-slim@sha256:1127090f9fff0b8e7c3a1367855ef8a3299472d2c9ed122948a576c39addeaf1
FROM docker.io/library/python:3.13.2-slim@sha256:ae9f9ac89467077ed1efefb6d9042132d28134ba201b2820227d46c9effd3174

# This file is generated from docker:unstable in Taskfile.yml
COPY var/requirements.txt /var/tmp/build/
Expand Down
14 changes: 11 additions & 3 deletions docs/apidocs/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,18 @@ examples Package

These examples all live in ``./examples`` in the source-distribution of RDFLib.

:mod:`~examples.conjunctive_graphs` Module
------------------------------------------
:mod:`~examples.datasets` Module
--------------------------------

.. automodule:: examples.datasets
:members:
:undoc-members:
:show-inheritance:

:mod:`~examples.jsonld_serialization` Module
--------------------------------------------

.. automodule:: examples.conjunctive_graphs
.. automodule:: examples.jsonld_serialization
:members:
:undoc-members:
:show-inheritance:
Expand Down
104 changes: 80 additions & 24 deletions docs/developers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,8 @@ flag them as expecting to fail.
Compatibility
-------------

RDFLib 8.x is likely to support only the Python versions in bugfix status at the time of its release, so perhaps 3.12+.

RDFlib 7.0.0 release and later only support Python 3.8.1 and newer.

RDFlib 6.0.0 release and later only support Python 3.7 and newer.
Expand All @@ -443,22 +445,46 @@ RDFLib 5.0.0 maintained compatibility with Python versions 2.7, 3.4, 3.5, 3.6, 3
Releasing
---------

These are the major steps for releasing new versions of RDFLib:

#. Create a pre-release PR

* that updates all the version numbers
* merge it with all tests passing

#. Do the PyPI release
#. Do the GitHub release
#. Create a post-release PR

* that updates all version numbers to next (alpha) release
* merge it with all tests passing

#. Let the world know


1. Create a pre-release PR
~~~~~~~~~~~~~~~~~~~~~~~~~~

Create a release-preparation pull request with the following changes:

* Updated version and date in ``CITATION.cff``.
* Updated copyright year in the ``LICENSE`` file.
* Updated copyright year in the ``docs/conf.py`` file.
* Updated main branch version and current version in the ``README.md`` file.
* Updated version in the ``pyproject.toml`` file.
* Updated ``__date__`` in the ``rdflib/__init__.py`` file.
* Accurate ``CHANGELOG.md`` entry for the release.
#. In ``pyproject.toml``, update the version number
#. In ``README.md``, update the *Versions & Releases* section
#. In ``rdflib/__init__.py``, update the ``__date__`` value
#. In ``docs/conf.py``, update copyright year
#. In ``CITATION.cff``, update the version and date
#. In ``LICENSE``, update the copyright year
#. In ``CHANGELOG.md``, write an entry for this release
#. You can use the tool ``admin/get_merged_prs.py`` to assist with compiling a log of PRs and commits since last release

2. Do the PyPI release
~~~~~~~~~~~~~~~~~~~~~~

Once the PR is merged, switch to the main branch, build the release and upload it to PyPI:
Once the pre-release PR is merged, switch to the main branch, build the release and upload it to PyPI:

.. code-block:: bash

# Clean up any previous builds
\rm -vf dist/*
rm -vf dist/*

# Build artifacts
poetry build
Expand Down Expand Up @@ -487,24 +513,54 @@ Once the PR is merged, switch to the main branch, build the release and upload i
## poetry publish -u __token__ -p pypi-<REDACTED>


Once this is done, create a release tag from `GitHub releases
<https://github.com/RDFLib/rdflib/releases/new>`_. For a release of version
6.3.1 the tag should be ``6.3.1`` (without a "v" prefix), and the release title
should be "RDFLib 6.3.1". The release notes for the latest version be added to
the release description. The artifacts built with ``poetry build`` should be
uploaded to the release as release artifacts.
3. Do the GitHub release
~~~~~~~~~~~~~~~~~~~~~~~~

The resulting release will be available at https://github.com/RDFLib/rdflib/releases/tag/6.3.1
Once the PyPI release is done, tag the main branch with the version number of the release. For a release of version
6.3.1 the tag should be ``6.3.1`` (without a "v" prefix):

.. code-block:: bash

git tag 6.3.1

Once this is done, announce the release at the following locations:

* Twitter: Just make a tweet from your own account linking to the latest release.
* RDFLib mailing list.
* RDFLib Gitter / matrix.org chat room.
Push this tag to GitHub:

.. code-block:: bash

git push --tags


Make a release from this tag at https://github.com/RDFLib/rdflib/releases/new

The release title should be "{DATE} RELEASE {VERSION}". See previous releases at https://github.com/RDFLib/rdflib/releases

The release notes should be just the same as the release info in ``CHANGELOG.md``, as authored in the first major step in this release process.

The resulting release will be available at https://github.com/RDFLib/rdflib/releases/tag/6.3.1

4. Create a post-release PR
~~~~~~~~~~~~~~~~~~~~~~~~~~~

Once this is all done, create another post-release pull request with the following changes:

* Set the just released version in ``docker/latest/requirements.in`` and run
``task docker:prepare`` to update the ``docker/latest/requirements.txt`` file.
* Set the version in the ``pyproject.toml`` file to the next minor release with
a ``a0`` suffix to indicate alpha 0.
#. In ``pyproject.toml``, update to the next minor release alpha

* so a 6.3.1 release would have 6.1.4a0 as the next release alpha

#. In ``docker/latest/requirements.in`` set the version to the just released version
#. Use ``task docker:prepare`` to update ``docker/latest/requirements.txt``



5. Let the world know
~~~~~~~~~~~~~~~~~~~~~

Announce the release at the following locations:

* RDFLib mailing list
* RDFLib Gitter / matrix.org chat room
* Twitter: Just make a tweet from your own account linking to the latest release
* related mailing lists
* Jena: [email protected]
* W3C (currently RDF-Star WG): [email protected]
Loading
Loading