diff --git a/CHANGELOG.md b/CHANGELOG.md index 047828f0e7..f6addadc9e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,55 @@ +## 2025-10-24 RELEASE 7.3.0 + +This release delivers several important fixes and enhancements to RDFLib’s Dataset implementation, resolving long-standing issues and improving consistency across serialization and SPARQL operations. It also introduces new deprecation notices for certain Dataset methods and attributes, which will be removed in the next major release. In addition, this version includes a range of improvements to SPARQL result parsing, typing, and literal handling. + +### Features + +- Added `Dataset.__iadd__` support +- Dataset's default serialize format is now `trig` +- Datasets can now add graphs backed by different stores + +### Fixes and Improvements + +- Fixed an issue where the `RecursiveSerializer` would output undeclared prefixes for predicates that contained the base as a substring +- Prevented prefix generation for predicates corresponding to the base namespace +- SPARQL Update now correctly inserts into the default graph +- Dataset.parse now returns Self +- N-Quads serialization no longer includes the RDFLib internal default graph identifier +- Static type checkers can now infer the type of `Term.__new__` +- Removed automatic date conversion for gYear and gYearMonth literals +- Optional clauses in SPARQL queries can now bind variables +- Fixed reevaluation logic in SPARQL Update between update loops + +### Maintenance + +- Added deprecation notices to certain Dataset methods and attributes + - Use Dataset.graphs instead of Dataset.contexts method + - Use Dataset.default_graph instead of Dataset.default_context + - Deprecate Dataset.identifier entirely. +- Updated type hints for Graph.open() with SPARQLUpdateStore configuration +- SPARQL Result Parsing Improvements + - Simplified and modernized the SPARQL result parsing system: + - These changes maintain backward compatibility while making the SPARQL API more flexible and extensible. + +Pull requests merged: + +- feat: add Dataset `__iadd__` support by @edmondchuc in [#3268](https://api.github.com/repos/RDFLib/rdflib/pulls/3268) +- fix: RecursiveSerializer- outputs undeclared prefix for predicates that contains the base as a substring by @edmondchuc in [#3267](https://api.github.com/repos/RDFLib/rdflib/pulls/3267) +- fix: allow static type checkers to infer term's `__new__` type by @edmondchuc in [#3266](https://api.github.com/repos/RDFLib/rdflib/pulls/3266) +- fix: SPARQL Update inserts into the default graph by @edmondchuc in [#3265](https://api.github.com/repos/RDFLib/rdflib/pulls/3265) +- chore: add deprecation notice to Dataset methods and attributes by @edmondchuc in [#3264](https://api.github.com/repos/RDFLib/rdflib/pulls/3264) +- fix: Dataset.parse now returns Self by @edmondchuc in [#3263](https://api.github.com/repos/RDFLib/rdflib/pulls/3263) +- fix: dataset nquads serialization including RDFLib internal default graph identifier by @edmondchuc in [#3262](https://api.github.com/repos/RDFLib/rdflib/pulls/3262) +- patch for reevaluation in sparql modify between update loops. with test by @WhiteGobo in [#3261](https://api.github.com/repos/RDFLib/rdflib/pulls/3261) +- feat: change dataset's default serialize format to trig by @edmondchuc in [#3260](https://api.github.com/repos/RDFLib/rdflib/pulls/3260) +- feat: allow adding graphs backed by different stores to the same dataset by @edmondchuc in [#3259](https://api.github.com/repos/RDFLib/rdflib/pulls/3259) +- fix(v7): remove Literal.toPython date conversion for gYear/gYearMonth (#3115) by @edmondchuc in [#3258](https://api.github.com/repos/RDFLib/rdflib/pulls/3258) +- sparqls optionals clause can now bind variables. with test. issue 2957 by @WhiteGobo in [#3247](https://api.github.com/repos/RDFLib/rdflib/pulls/3247) +- fix: skip prefix generation for predicates corresponding to base namespace by @edmondchuc in [#3244](https://api.github.com/repos/RDFLib/rdflib/pulls/3244) +- Run the example queries agains the local fuseki by @white-gecko in [#3240](https://api.github.com/repos/RDFLib/rdflib/pulls/3240) +- Adjust the type hint for Graph open to reflect a SPARQLUpdateStore configuration by @white-gecko in [#3239](https://api.github.com/repos/RDFLib/rdflib/pulls/3239) +- SPARQL result parsing by @white-gecko in [#2796](https://api.github.com/repos/RDFLib/rdflib/pulls/2796) + ## 2025-09-19 RELEASE 7.2.1 A tiny clean up release. diff --git a/CITATION.cff b/CITATION.cff index ef4772952a..c111335f86 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -69,7 +69,7 @@ authors: - family-names: "Stuart" given-names: "Veyndan" title: "RDFLib" -version: 7.2.1 -date-released: 2025-09-19 +version: 7.3.0 +date-released: 2025-10-24 url: "https://github.com/RDFLib/rdflib" doi: 10.5281/zenodo.6845245 diff --git a/README.md b/README.md index 8ddb4eb72f..369b36a53a 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,7 @@ Help with maintenance of all of the RDFLib family of packages is always welcome ## Versions & Releases * `main` branch in this repository is the current unstable release - version 8 alpha +* `7.3.0` many fixes and usability improvements, particularly for the Dataset class. See changelog for details * `7.2.1` tiny clean up release, relaxes Python version requirement * `7.2.0` general fixes and usability improvements, see changelog for details * `7.1.4` tidy-up release, possibly last 7.x release diff --git a/admin/README.md b/admin/README.md index f09c39a748..c511b9bcec 100644 --- a/admin/README.md +++ b/admin/README.md @@ -3,3 +3,11 @@ Tools to assist with RDFlib releases, like extracting all merged PRs from GitHub since last release and printing them into MArkdown lists. To make a release of RDFLib, see the [Developer's Guide](https://rdflib.readthedocs.io/en/latest/developers.html). + +## PR Changelog Summary + +An alternative to the `get_merged_prs.py` script is to use the GitHub CL to get the list of PRs and pipe it into the `pr_markdown.py` script. The following command retrieves the list of PRs merged since the last release (`2025-09-19`) from a particular branch (`7.x`). + +```bash +gh api '/search/issues?q=repo:rdflib/rdflib+is:pr+is:merged+base:7.x+merged:>2025-09-19&per_page=100' | jq '{total_count, incomplete_results, items: [.items[] | {number, title, pull_request_merged_at: .pull_request.merged_at, pull_request_url: .pull_request.url, username: .user.login}]}' | poetry run python admin/pr_markdown.py +``` diff --git a/admin/pr_markdown.py b/admin/pr_markdown.py new file mode 100644 index 0000000000..f9548c5ce5 --- /dev/null +++ b/admin/pr_markdown.py @@ -0,0 +1,28 @@ +import json +import sys +from dataclasses import dataclass + + +@dataclass +class PR: + number: int + title: str + pull_request_merged_at: str + pull_request_url: str + username: str + + def __repr__(self): + return f"{self.title} by @{self.username} in [#{self.number}]({self.pull_request_url})" + + +try: + json_data = json.load(sys.stdin) + prs = [PR(**pr) for pr in json_data["items"]] + for pr in prs: + print(f"- {pr}") +except json.JSONDecodeError as e: + print(f"Error parsing JSON: {e}") + sys.exit(1) +except Exception as e: + print(f"Error: {e}") + sys.exit(1) diff --git a/pyproject.toml b/pyproject.toml index ff1665908b..d280e1faf2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "rdflib" -version = "7.3.0-a0" +version = "7.3.0" description = """RDFLib is a Python library for working with RDF, \ a simple yet powerful language for representing information.""" authors = ["Daniel 'eikeon' Krech "] diff --git a/rdflib/__init__.py b/rdflib/__init__.py index af6dfeefe8..5e37ec92f3 100644 --- a/rdflib/__init__.py +++ b/rdflib/__init__.py @@ -52,7 +52,7 @@ __docformat__ = "restructuredtext en" __version__: str = _DISTRIBUTION_METADATA["Version"] -__date__ = "2025-09-19" +__date__ = "2025-10-24" __all__ = [ "URIRef",