NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #1003 most downloaded on PyPI
RDFLib is a Python library for working with RDF, a simple yet powerful language for representing information.
Last release 7 months ago
13 Feb 2026
Release timing varies
gaps range from 9 days to 1.2 years
Some releases are documented
notes for 26 of 44 stable releases
1 version withdrawn
withdrawn after publishing
16 years old
47 releases · first in 2010
…a compatibility layer for pyparsing v3 to remove deprecation warnings.
This release introduces a new major feature: GraphDB integration via the Python GraphDB Client. Users can now manage GraphDB instances and perform administrative tasks directly from Python. As GraphDB also supports the RDF4J REST API, users may utilize the recently released RDF4J Client and Store with GraphDB instances. For more details, see the new RDFLib GraphDB documentation under the extras section of the RDFLib documentation.
This release also includes a number of fixes to Graph.cbd() and Turtle-related serializers. Thanks to @mgberg and @lisat-dstg, the affected code is now more standards-compliant.
At the request of users, the recently introduced CLI tool sq has been renamed to sparqlquery to avoid conflicts with existing well-known packages.
Other maintenance tasks include updating all CI actions to the latest versions and adding a compatibility layer for pyparsing v3 to remove deprecation warnings.
See the CHANGELOG.md for more details.
This release introduces a new major feature: GraphDB integration via the Python GraphDB Client. Users can now manage GraphDB instances and perform administrative tasks directly from Python. As GraphDB also supports the RDF4J REST API, users may utilize the recently released RDF4J Client and Store with GraphDB instances. For more details, see the new RDFLib GraphDB documentation under the extras section of the RDFLib documentation.
This release also includes a number of fixes to Graph.cbd() and Turtle-related serializers. Thanks to @mgberg and @lisat-dstg, the affected code is now more standards-compliant.
At the request of users, the recently introduced CLI tool sq has been renamed to sparqlquery to avoid conflicts with existing well-known packages.
Other maintenance tasks include updating all CI actions to the latest versions and adding a compatibility layer for pyparsing v3 to remove deprecation warnings.
Pull requests merged:
examples to show … by @nicholascar in #3393One column per quarter.
This release introduces a new major feature to RDFLib: RDF4J Store integration and RDF4J Client. Users can use this to connect to RDF4J database serve
This release introduces a new major feature to RDFLib: RDF4J Store integration and RDF4J Client. Users can use this to connect to RDF4J database servers through RDFLib's Graph and Dataset classes, as well as manage repositories and transactions using the RDF4J Client. A comprehensive user guide for the new RDF4J features is available under the extras section of the RDFLib documentation.
We've also added a new CLI tool, sq (the script is rdflib/tools/sparqlquery.py), for executing SPARQL queries against local files or remote SPARQL endpoints with custom serialization. This provides a convenient way to query RDF data straight from the command line.
Other enhancements include documentation improvements that fix crosslinking issues between modules, and new documentation content for RDFLib plugins, parsers, and serializers.
For RDFLib developers, this release introduces httpx as an optional dependency to support the new RDF4J functionality. The RDF4J test suite now also uses testcontainers on Linux environments running Python 3.9.2 or later.
See the CHANGELOG.md for more details.
This release introduces a new major feature to RDFLib: RDF4J Store integration and RDF4J Client. Users can use this to connect to RDF4J database servers through RDFLib's Graph and Dataset classes, as well as manage repositories and transactions using the RDF4J Client. A comprehensive user guide for the new RDF4J features is available under the extras section of the RDFLib documentation.
We've also added a new CLI tool, sq (the script is rdflib/tools/sparqlquery.py), for executing SPARQL queries against local files or remote SPARQL endpoints with custom serialization. This provides a convenient way to query RDF data straight from the command line.
Other enhancements include documentation improvements that fix crosslinking issues between modules, and new documentation content for RDFLib plugins, parsers, and serializers.
For RDFLib developers, this release introduces httpx as an optional dependency to support the new RDF4J functionality. The RDF4J test suite now also uses testcontainers on Linux environments running Python 3.9.2 or later.
Pull requests merged:
This release addresses a couple of bugs and improves the testing matrix by adding python 3.12, 3.13 and 3.14 to the test matrix.
This release addresses a couple of bugs and improves the testing matrix by adding python 3.12, 3.13 and 3.14 to the test matrix.
This is also the first RDFLib release to use MkDocs for documentation.
See the CHANGELOG.md for more details.
Full Changelog: https://github.com/RDFLib/rdflib/compare/7.3.0...7.4.0
This release addresses a couple of bugs and improves the testing matrix by adding python 3.12, 3.13 and 3.14 to the test matrix.
This is also the first RDFLib release to use MkDocs for documentation.
See the CHANGELOG.md for more details.
Full Changelog: 7.3.0...7.4.0
This release addresses a couple of bugs and improves the testing matrix by adding python 3.12, 3.13 and 3.14 to the test matrix.
This is also the first RDFLib release to use MkDocs for documentation.
Pull requests merged:
…and SPARQL operations. It also introduces new deprecation notices for certain Dataset methods and attributes, which will be removed in the next major…
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.
Dataset.__iadd__ supporttrigRecursiveSerializer would output undeclared prefixes for predicates that contained the base as a substringTerm.__new__See the CHANGELOG.md for more details.
Full Changelog: https://github.com/RDFLib/rdflib/compare/7.2.1...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.
Dataset.__iadd__ supporttrigRecursiveSerializer would output undeclared prefixes for predicates that contained the base as a substringTerm.__new__Pull requests merged:
__iadd__ support by @edmondchuc in #3268__new__ type by @edmondchuc in #3266Canonicalization is now optional in the longturtle serializer. When serializing with the longturtle format, set canon=True to enable canonicalization.
New features:
longturtle format, set canon=True to enable canonicalization.Fixes:
Literal.toPython date conversion for gYear/gYearMonthSee the CHANGELOG.md for more details.
A tiny clean up release.
Fixes:
A tidy-up release with no major updates over 7.1.3. This may be the last 7.x release as we move to a version 8 with breaking changes to Dataset and a…
A tidy-up release with no major updates over 7.1.3. This may be the last 7.x release as we move to a version 8 with breaking changes to Dataset and a few APIs.
Interesting PRs merged:
... and lots of boring dependency bump PRs merged!
A fix-up release that re-adds support for Python 3.8 after it was accidentally removed in Release 7.1.2.
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.
Also not carried over from 7.1.2 is the change from Poetry 1.x to 2.0.
Included are PRs such as Defined Namespace warnings fix, sort longturtle blank nodes, deterministic longturtle serialisation and Dataset documentation improvements.
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.
Also not carried over from 7.1.2 is the change from Poetry 1.x to 2.0.
Included are PRs such as Defined Namespace warnings fix, sort longturtle blank nodes, deterministic longturtle serialisation and Dataset documentation improvements.
For the full list of included PRs, see the preparatory PR: https://github.com/RDFLib/rdflib/pull/3036.
7.1.2 pre release prep
7.1.2 pre release prep (#3030)
A minor release that inadvertently removed support for Python 3.8. This release how now been deleted.
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.
This minor release removes the dependency on some only Python packages, in particular six which is a problem for some Linux distributions that ship RD
This minor release removes the dependency on some only Python packages, in particular
six which is a problem for some Linux distributions that ship RDFLib.
Other than that, there are a few minor PRs that improve testing and to do with making releases - no
new RDFLib core work.
Merged PRs:
2024-10-28 - Replace html5lib with html5rdf, make it an optional dependency
PR #2951
2024-10-23 - Prevent crash when comparing ill-typed numeric types.
PR #2949
2024-10-23 - Fix parser bug and add test
PR #2943
2024-10-23 - Fix import ordering in get_merged_prs.
PR #2947
2024-10-17 - post 7.1.0 release PR
PR #2934
2024-10-17 - 7.1.0 release
PR #2933
2024-10-24 - build(deps): bump poetry from 1.8.3 to 1.8.4 in /devtools
PR #2938
2024-10-24 - build(deps-dev): bump poetry from 1.8.3 to 1.8.4
PR #2941
2024-10-24 - build(deps): bump orjson from 3.10.7 to 3.10.10
PR #2950
2024-10-23 - build(deps-dev): bump ruff from 0.6.9 to 0.7.0
PR #2942
This minor release incorporates just over 100 substantive PRs - interesting things submitted by people - and around 140 auto-generated update PRs from
This minor release incorporates just over 100 substantive PRs - interesting things submitted by people - and around 140 auto-generated update PRs from dependabot and similar.
There are no major changes in this release over 7.0.0 and this release can be used in place of 7.0.0 without much worry about altered behaviour.
Since the previous release, we have updated the way auto-generated PRs are handled to ease the job of maintainers.
Due to the large numbers of PRs contained in this release, an abbreviated listing of them only is provided in the release notes in the Changelog file entry for this release.
This minor release incorporates just over 100 substantive PRs - interesting things submitted by people - and around 140 auto-generated update PRs from dependabot and similar.
There are no major changes in this release over 7.0.0 and this release can be used in place of 7.0.0 without much worry about altered behaviour.
Since the previous release, we have updated the way auto-generated PRs are handled to ease the job of maintainers.
Due to the large numbers of PRs contained in this release, an abbreviated listing of them only is provided here:
Merged human-made PRs:
Graph.value to match others
PR #2899FROM and FROM NAMED clauses)
PR #2794BytesIOWrapper
PR #2853check_untyped_defs for Mypy
PR #2580from __future__ import annotations
PR #2576#!...
PR #2574noqa statements
PR #2566test/test_graph
PR #2556LOAD ... INTO GRAPH handling
PR #2554queryGraph selection for query and update
PR #2546print() calls from SPARQL algebra code
PR #2553Auto-generated PRs:
15bad98 to ad48727 in /docker/unstable
PR #2915740d94a to a3e58f9 in /docker/unstable
PR #2875740d94a to a3e58f9 in /docker/latest
PR #287652f92c5 to 740d94a in /docker/latest
PR #285652f92c5 to 740d94a in /docker/unstable
PR #2855f11725a to 52f92c5 in /docker/latest
PR #28462fba8e7 to f11725a in /docker/latest
PR #2827eb53cb9 to 5c73034 in /docker/latest
PR #27255c73034 to 36d57d7 in /docker/unstable
PR #2742eb53cb9 to 5c73034 in /docker/unstable
PR #272643a49c9 to babc0d4 in /docker/latest
PR #2627babc0d4 to 32477c7 in /docker/unstable
PR #265343a49c9 to babc0d4 in /docker/unstable
PR #26269bd704d to edaf703 in /docker/latest
PR #26009bd704d to edaf703 in /docker/unstable
PR #2601c499230 to 9bd704d in /docker/latest
PR #2589c499230 to 9bd704d in /docker/unstable
PR #258158ae46e to 17d62d6 in /docker/unstable
PR #253136b544b to 58ae46e in /docker/latest
PR #252736b544b to 58ae46e in /docker/unstable
PR #2526This is a major release with relatively slight breaking changes, new features and bug fixes.
This is a major release with relatively slight breaking changes, new features and bug fixes.
The most notable breaking change relates to how RDFLib handles the
publicID parameter of the Graph.parse and Dataset.parse methods.
Most users should not be affected by this change.
Instructions on adapting existing code to the breaking changes can be found in the upgrade guide from Version 6 to Version 7 which should be available here.
It is likely that the next couple of RDFLib releases will all be major versions, mostly because there are some more shortcomings of RDFLib's public interface that should be addressed.
If you use RDFLib, please consider keeping an eye on discussions, issues and pull-requests labelled with "feedback wanted".
A big thanks to everyone who contributed to this release.
publicID as the name for the default graph. (#2406)When parsing data into a ConjunctiveGraph or Dataset, the triples in the
default graphs in the sources were loaded into a graph named publicID.
This behaviour has been changed, and now the triples from the default graph in
source RDF documents will be loaded into ConjunctiveGraph.default_context or
Dataset.default_context.
The publicID parameter to ConjunctiveGraph.parse and Dataset.parse
constructors will now only be used as the base URI for relative URI resolution.
Python 3.7 will be end-of-life on the 27th of June 2023 and the next release of RDFLib will be a new major version.
This changes the minimum supported version of Python to 3.8.1 as some of the dependencies we use are not too fond of python 3.8.0. This change also removes all accommodations for older python versions.
curie method to NamespaceManager (#2365)Added a curie method to NamespaceManager, which can be used to generate a
CURIE from a URI.
Other changes:
NamespaceManager.expand_curie to work with CURIES that have blank
prefixes (e.g. :something), which are valid according to CURIE Syntax
1.0.Fixes https://github.com/RDFLib/rdflib/issues/2348.
target_graph argument to Graph.cbd and use it for DESCRIBE queries (#2322)Add optional keyword only target_graph argument to rdflib.graph.Graph.cbd and use this new argument in evalDescribeQuery.
This makes it possible to compute a concise bounded description without creating a new graph to hold the result, and also without potentially having to copy it to another final graph.
Commit bd797ac.
When serializing RDF graphs, URIs with unknown prefixes were assigned a
namespace like ns1:. While the result would be smaller files, it does
result in output that is not as readable.
This change removes this automatic assignment of namespace prefixes.
This is somewhat of an aesthetic choice, eventually we should have more flexibility in this regard so that users can exercise more control over how URIs in unknown namespaces are handled.
With this change, users can still manually create namespace prefixes for URIs in unknown namespaces, but before it there was no way to avoid the undesired behaviour, so this seems like the better default.
Improved the output of the longturtle serializer.
Change SPARQL count aggregate to ignore optional that are unbound instead of raising an exception when they are encountered.
GROUP_CONCAT handling of empty separator (issue) (#2474)GROUP_CONCAT was handling an empty separator (i.e. "") incorrectly,
it would handle it as if the separator were not set, so essentially it was
treated as a single space (i.e. " ").
This change fixes it so that an empty separator with GROUP_CONCAT
results in a value with nothing between concatenated values.
Fixes https://github.com/RDFLib/rdflib/issues/2473
NORMALIZE_LITERALS to rdflib.__all__ (#2489)This gets Sphinx to generate documentation for it, and also clearly indicates that it can be used from outside the module.
rdflib.extras.infixowl (#2390)Fix the following issues in rdflib.extras.infixowl:
manchesterSyntax was wrong for some cases.BooleanClass was generating its string representation (i.e. BooleanClass.__repr__) was wrong for some cases.Other changes:
This code is based on code from:
__all__ (#2340)Disable
implicit_reexport
and eliminate all errors reported by mypy after this.
This helps ensure that import statements import from the right module and that
the __all__ variable is correct.
The URL for the service keyword had the http address for the dbpedia endpoint, which no longer works. Changing it to https as that works.
except: (#2350)Replace bare except: with except Exception, there are some cases where it
can be narrowed further, but this is already an improvement over the current
situation.
This is somewhat pursuant to eliminating flakeheaven, as it no longer supports the latest version of flake8 [ref]. But it also is just the right thing to do as bare exceptions can cause problems.
Previously, rdflib.plugins.sparql.algebra.translateAlgebra() maintained state via a file, with a fixed filename query.txt. With this change, use of that file is eliminated; state is now maintained in memory so that multiple concurrent translateAlgebra() calls, for example, should no longer interfere with each other.
The change is accomplished with no change to the client interface. Basically, the actual functionality has been moved into a class, which is instantiated and used as needed (once per call to algrebra.translateAlgebra()).
This change eliminates some situations where a mutable object (i.e., a dictionary) was used as the default value for functions in the rdflib.plugins.sparql.processor module and related code. It replaces these situations with typing.Optinal that defaults to None, and is then handled within the function. Luckily, some of the code that the SPARQL Processor relied on already had this style, meaning not a lot of changes had to be made.
This change also makes a small update to the logic in the SPARQL Processor's query function to simplify the if/else statement. This better mirrors the implementation in the UpdateProcessor.
These path types were formatted without parentheses even if they contained multiple elements, resulting in string representations that did not accurately represent the path.
This change fixes the formatting so that the string representations are enclosed in parentheses when necessary.
rdf:HTML literals (#2490)Previously, without html5lib installed, literals withrdf:HTML
datatypes were treated as
ill-typed,
even if they were not ill-typed.
With this change, if html5lib is not installed, literals with the
rdf:HTML datatype will not be treated as ill-typed, and will have
Null as their ill_typed attribute value, which means that it is
unknown whether they are ill-typed or not.
This change also fixes the mapping from rdf:HTML literal values to
lexical forms.
Other changes:
rdflib.NORMALIZE_LITERALS to ensure it behaves
correctly.Related issues:
Commit e0b3152, closes #2389 /docs.python.org/3.11/whatsnew/changelog.html#id128.
Change the handling of HTTP status code 308 to behave more like
urllib.request.HTTPRedirectHandler, most critically, the new 308 handling will
create a new urllib.request.Request object with the new URL, which will
prevent state from being carried over from the original request.
One case where this is important is when the domain name changes, for example,
when the original URL is http://www.w3.org/ns/adms.ttl and the redirect URL is
https://uri.semic.eu/w3c/ns/adms.ttl. With the previous behaviour, the redirect
would contain a Host header with the value www.w3.org instead of
uri.semic.eu because the Host header is placed in
Request.unredirected_hdrs and takes precedence over the Host header in
Request.headers.
Other changes:
Only handle HTTP status code 308 on Python versions before 3.11 as Python 3.11
will handle 308 by default [ref].
Move code which uses http://www.w3.org/ns/adms.ttl and
http://www.w3.org/ns/adms.rdf out of test_guess_format_for_parse into a
separate parameterized test, which instead uses the embedded http server.
This allows the test to fully control the Content-Type header in the
response instead of relying on the value that the server is sending.
This is needed because the server is sending Content-Type: text/plain for
the adms.ttl file, which is not a valid RDF format, and the test is
expecting Content-Type: text/turtle.
Fixes:
Use strict mode when parsing rdf:HTML literals. This ensures that when
lexical-to-value
mapping
(i.e. parsing) of a literal with rdf:HTML data type occurs, a value will
only be assigned if the lexical form is a valid HTML5 fragment.
Otherwise, i.e. for invalid fragments, no value will be associated with
the literal
[ref] and
the literal will be ill-typed.
Commit 8c9608b, closes #2469 /www.w3.org/2013/TriGTests/#trig-graph-bad-01.
The RDF 1.1 TriG grammar only allows the GRAPH keyword if it
is followed by a graph identifier
[ref].
This change enforces this rule so that the
http://www.w3.org/2013/TriGTests/#trig-graph-bad-01 test passes.
Commit afea615, closes #2468 /www.w3.org/2013/TriGTests/#trig-graph-bad-07.
Raise an error when nested graphs occur in TriG.
With this change, the http://www.w3.org/2013/TriGTests/#trig-graph-bad-07 test passes.
Fix various typing errors that are reported when running with dmypy,
the mypy daemon.
Also add a task for running dmypy to the Taskfile that can be selected
as the default mypy variant by setting the MYPY_VARIANT environment
variable to dmypy.
Graph.__contains__ type-hints to accept Path values (#2323)Change the type-hints for Graph.__contains__ to also accept Path
values as the parameter is passed to the Graph.triples function,
which accepts Path values.
The CITATION.cff file provides release metadata which is used by
Zenodo and other software and systems.
This file's content is best-effort, and pull requests with improvements are welcome and will affect future releases.
Add guidelines on how breaking changes should be approached.
The guidelines take a very pragmatic approach with known downsides, but this seems like the best compromise given the current situation.
For prior discussion on this point see:
Comment refers to a person that knows bob and the code would return a name,
but this would only work if the triple person foaf:name bob . is part of the dataset
As this is a very uncommon way to model a foaf:knows the code was
adjusted to match the description.
Suggest that contributors first make an issue to get in principle agreement for pull requests before making the pull request.
Enhancements can be controversial, and we may reject the enhancement sometimes, even if the code is good, as it may just not be deemed important enough to increase the maintenance burden of RDFLib.
Other changes:
The use of Unicode literals is an artefact of Python 2 and is incorrect in Python 3.
Doctests for docstrings using Unicode literals only pass because ALLOW_UNICODE is set, but this option should be disabled as RDFLib does not support Python 2 any more.
This partially resolves https://github.com/RDFLib/rdflib/issues/2378.
…to sdo in 6.2.0, this however constitutes a breaking change, as code that was using the schema prefix would no longer have the same behaviour. This ch…
This is a patch release that fixes some bugs, including regressions introduced in release 6.2.0 and 6.3.0.
ROUND, ENCODE_FOR_URI and SECONDS SPARQL functions (#2314)ROUND was not correctly rounding negative numbers towards positive infinity,
ENCODE_FOR_URI incorrectly treated / as safe, and SECONDS did not include
fractional seconds.
This change corrects these issues.
__hash__ and __eq__ back to rdflib.paths.Path (#2292)These methods were removed when @total_ordering was added, but
@total_ordering does not add them, so removing them essentially
removes functionality.
This change adds the methods back and adds tests to ensure they work correctly.
All path related tests are also moved into one file.
to_dict method to the JSON-LD Context class. (#2310)Context.to_dict is used in JSON-LD serialization, but it was not implemented.
This change adds the method.
wgs namespace binding back (#2294)https://github.com/RDFLib/rdflib/pull/1686 inadvertently removed the wgs prefix.
This change adds it back.
https://schema.org/ back to schema (#2312)The default prefix for https://schema.org/ registered with
rdflib.namespace.NamespaceManager was inadvertently changed to sdo in 6.2.0,
this however constitutes a breaking change, as code that was using the schema
prefix would no longer have the same behaviour. This change changes the prefix
back to schema.
The sdists generated by setuptools included the docs and examples
directories, and they are needed for building docs and running tests using the
sdist.
This change includes these directories in the sdist tarball.
A test:sdist task is also added to Taskfile.yml which uses the sdists to run
pytest and build docs.
The URI to IRI conversion was percentage-quoting characters that should not have been quoted, like equals in the query string. It was also not quoting things that should have been quoted, like the username and password components of a URI.
This change improves the conversion by only quoting characters that are not allowed in specific parts of the URI and quoting previously unquoted components. The safe characters for each segment are taken from RFC3986.
The new behavior is heavily inspired by
werkzeug.urls.iri_to_uri
though there are some differences.
dict (#2306)A variable was only being initialized for string-valued inputs, but if a dict
input was passed the variable would still be accessed, resulting in a
UnboundLocalError.
This change initializes the variable always, instead of only when string-valued input is used to construct a JSON-LD context.
get_target_namespace_elements (#2311)get_target_namespace_elements references the args global, which is not
defined if the function is called from outside the module. This commit fixes
that instead referencing the argument passed to the function.
The namespaces bound by default by rdflib.graph.Graph and
rdflib.namespace.NamespaceManager was reduced in version 6.2.0 of RDFLib,
however, this also would cause code that worked with 6.1.1 to break, so this
constituted a breaking change. This change restores the previous behaviour,
binding the same namespaces as was bound in 6.1.1.
To bind a reduced set of namespaces, the bind_namespaces parameter of
rdflib.graph.Graph or rdflib.namespace.NamespaceManager can be used.
webtest marker to tests that use the internet (#2295)This is being done so that it is easier for downstream packagers to run the test suite without requiring internet access.
To run only tests that does not use the internet, run pytest -m "not webtest".
The validation workflow validates that test run without internet access by
running the tests inside firejail --net=none.
This ensures contributors are credited. Also added .mailmap to fix early misattributed contributions.
Changed cdterms to dcterms, see https://github.com/RDFLib/rdflib/issues/2196 for more info.
This is a patch release that includes a singular user facing fix, which is the inclusion of the test directory in the sdist release artifact.
This is a patch release that includes a singular user facing fix, which is the
inclusion of the test directory in the sdist release artifact.
The following sections describe the changes included in this version.
packages in pyproject.toml (#2280)The default behaviour makes it more of a hassle to republish RDFLib to a separate package, something which I plan to do for testing purposes and possibly other reasons.
More changes may follow in a similar vein.
A perhaps minor regression from earlier versions is that the sdist does not include the test folder, which makes it harder for downstreams to use a single source of truth to build and test a reliable package. This restores the test folder for sdists.
The Kroki server is currently experiencing some issues which breaks our build, this change eliminates the use of Kroki in favour of directly using the generated SVG images which is checked into git alongside the PlantUML sources.
I also added a task to the Taskfile to re-generate the SVG images from the PlantUML sources by calling docker.
RDFLib will drop support for Python 3.7 when it becomes EOL on 2023-06-27, this will not be considered a breaking change, and RDFLib's major version n…
This is a minor release that includes bug fixes and features.
This section lists changes that have a potential impact on users of RDFLib, changes with no user impact are not included in this section.
Add chunk serializer that facilitates the encoding of a graph into multiple N-Triples encoded chunks. PR #1968.
Fixes passing NamespaceManager in ConjunctiveGraph's method get_context().
The get_context() method will now pass the NamespaceManager of ConjunctiveGraph to the namespace_manager attribute of the newly created context graph, instead of the ConjunctiveGraph object itself. This cleans up an old FIXME comment.
PR #2073.
InfixOWL fixes and cleanup. Closed issue #2030. PR #2024, and PR #2033.
rdflib.extras.infixowl.Restriction.__init__ will now raise a ValueError
if there is no restriction value instead of an AssertionError.rdflib.extras.infixowl.Restriction.restrictionKind which was essentially
not working at all.rdflib.extras.infixowl.Property.__repr__ uses
rdflib.namespace.OWL.rdflib.extras.infixowl.Infix.__ror__ and
rdflib.extras.infixowl.Infix.__or__ as they were broken.rdflib.extras.infixowl.termDeletionDecorator.rdflib.extras.infixowl.MalformedClassError which will replace
rdflib.extras.infixowl.MalformedClass (which is an exception) in the next
major version.Fixed some cross-referencing issues in RDFLib documentation. Closed issue #1878. PR #2036.
Fixed import of xml.sax.handler in rdflib.plugins.parsers.trix so that it
no longer tries to import it from xml.sax.saxutils.
PR #2041.
Removed a pre python 3.5 regex related workaround in the REPLACE SPARQL function. PR #2042.
Fixed some issues with SPARQL XML result parsing that caused problems with
lxml. Closed issue #2035,
issue #1847.
PR #2044.
TextIO
streams now work correctly with lxml installed and with XML documents that
are not utf-8 encoded.<results> that are not <result> are now ignored.<result> that are not <binding> are now ignored.rdflib.plugins.sparql.results.xmlresults.Added type hints to the following modules:
rdflib.store.
PR #2057.rdflib.graph.
PR #2080.rdflib.plugins.sparql.*.
PR #2094,
PR #2133,
PR #2265,
PR #2097,
PR #2268.rdflib.query.
PR #2265.rdflib.parser and rdflib.plugins.parsers.*.
PR #2232.rdflib.exceptions.
PR #2232rdflib.shared.jsonld.*.
PR #2232.rdflib.collection.
PR #2263.rdflib.util.
PR #2262.rdflib.path.
PR #2261.Removed pre python 3.7 compatibility code. PR #2066.
shutil module does not have the move
function.Improve file-URI and path handling in Graph.serialize and Result.serialize to
address problems with windows path handling in Result.serialize and to make
the behavior between Graph.serialize and Result.serialie more consistent.
Closed issue #2067.
PR #2065.
destination argument will now only be treated as
file URIs if urllib.parse.urlparse returns their schema as file.Narrow the type of context-identifiers/graph-names from rdflib.term.Node to
rdflib.term.IdentifiedNode as no supported abstract syntax allows for other
types of context-identifiers.
PR #2069.
Always parse HexTuple files as utf-8. PR #2070.
Fixed handling of Literal datatype to correctly differentiate between
blank string values and undefined values, also changed the datatype of
rdflib.term.Literal.datatype from Optional[str] to Optional[URIRef] now
that all non-URIRef str values will be converted to URIRef.
PR #2076.
Fixed the generation of VALUES block for federated queries. The values block was including non-variable values like BNodes which resulted in invalid queries. Closed issue #2079. PR #2084.
Only register the rdflib.plugins.stores.berkeleydb.BerkeleyDB as a store
plugin if the berkeleydb module is present.
Closed issue #1816.
PR #2096.
Fixed serialization of BNodes in TriG.
The TriG serializer was only considering BNode references inside a single
graph and not counting the BNodes subjects as references when considering if a
BNode should be serialized as unlabeled blank nodes (i.e. [ ]), and as a
result it was serializing BNodes as unlabeled if they were in fact referencing
BNodes in other graphs.
PR #2085.
Deprecated rdflib.path.evalPath in favor of rdflib.path.eval_path which is
PEP-8 compliant. PR #2046
Added charset=UTF-8 to the Content-Type header sent when doing an update
with SPARQLConnector. Closed issue
#2095. PR
#2112.
Removed the rdflib.plugins.sparql.parserutils.plist class as it served no
discernible purpose. PR #2143
Changed the TriG serializer to not generate prefixes for empty graph IDs. Closed issue #2154. PR #2160.
Fixed handling of relative context files in the JSON-LD parser. Closed issue #2164. PR #2165.
Improved failure handling in when computing QName for an unbound namespace. PR #2169.
Fixed a typo in the default bound namespace for DCTERMS.
PR #2173.
Add support for supplying a custom namespace manager to n3() methods.
PR #2174.
Fixed the query string parameters for SPARQLConnector when using POST method.
PR #2180.
Fixed extra keyword argument and header handling in SPARQLConnector that
resulted in headers from SPARQLConnector.update polluting headers from
SPARQLConnector.query vice versa.
PR #2183
Added version restrictions for dependencies. PR #2187
Switch to using importlib for getting the version of RDFLib instead of
hard-coding it in __version__.
PR #2187.
Removed non-runtime extras, for building documentation, running tests and other development operations the versions and dependencies are now managed with Poetry. PR #2187.
Fixed a bug that occurred when VALUES was used outside a GROUP BY clause.
PR #2188.
Fixed a bug that occurred when using SELECT * inside another SELECT *.
Closed issue #1722.
PR #2190.
Added SPARQL DESCRIBE query implementation. Closes issue #479. PR #2221.
Fixed a bug in rdflib.tools.defined_namespace_creator that occurred when
multiple rdfs:comment were present on one resource.
PR #2254.
Fixed rdflib.util._iri2uri() to not quote the netloc parameter.
PR #2255.
Fixed the HexTuple parser's handling of input sources to works for more input sources. PR #2255.
Fixed the creation of input source objects from IO stream sources. PR #2255.
Eliminated the use of the deprecated rdflib.path.evalPath function.
PR #2266
Added documentation for security considerations and available mitigations. Closed issue #1844. PR #2267.
rdflib.plugins.sparql
PR #2268rdflib.path.evalPath
PR #2266rdflib.collection
PR #2263rdflib.util
PR #2262rdflib.path
PR #2261SELECT * inside SELECT * bug
PR #2190service_query to _buildQueryStringForServiceCall instead of a Match
PR #2134main
PR #2101rdflib.query and related
PR #2097rdflib.plugins.sparql.{algebra,operators}
PR #2094exclude_lines for coverage
PR #2093unittest based tests to pytest
PR #2075Node to IdentifiedNode
PR #2069{Graph,Result}.serialize
PR #2065test/test_sparql/test_sparql_parser.py to pytest
PR #2063test/test_sparql/test_construct_bindings.py to pytest
PR #2062test/test_parsers/test_nquads.py to pytest
PR #2061test/test_namespace/test_namespace.py to pytest
PR #2060rdflib.store and rdflib.plugins.stores
PR #2057Removed the following functions that were marked as deprecated and scheduled for removal in version 6.0.0: Graph.load, Graph.seq, Graph.comment, Graph…
This is a minor release that includes bug fixes and features.
This section lists changes that have a potential impact on users of RDFLib, changes with no user impact are not included in this section.
HAVING clause with variable composition. Closed
issue #936 and issue
#935, PR
#1093.Graph.load, Graph.seq, Graph.comment,
Graph.label. PR #1527.functools.total_ordering to implement most comparison operations for
rdflib.paths.Path. Closed issue
#685, PR
#1528.rdflib.graph.ReadOnlyGraphAggregate.quads.
Closed issue #430, PR
#1590rdflib.plugins.stores.sparqlstore.SPARQLStore.update is called. Closed
issue #1032, PR
#1623.rdflib.plugins.sparql.processor.prepareUpdate. Closed issue
#272 and discussion
#1581, PR
#1624.rdflib.namespace.DefinedNamespaceMeta.__dir__. Closed issue
#1593, PR
#1626.TypeCheckError, SubjectTypeError, PredicateTypeError,
ObjectTypeError and ContextTypeError as these exceptions are not raised by
RDFLib and their existence will only confuse users which may expect them to be
used. Also remove corresponding check_context, check_subject,
check_predicate, check_object, check_statement, check_pattern that is
unused. PR #1640.Accept HTTP header so that it is correctly
populated for all formats. PR
#1643.nquads to recognized file extensions.
PR #1653.rdflib.plugins.sparql.operators.unregister_custom_function idempotent.
Closed issue #1492,
PR #1659."\\r". The time it
takes for these parsers to parse strings with escape sequences will be
increased, and the increase will be correlated with the amount of escape
sequences that occur in a string. For strings with many escape sequences the
parsing speed seems to be almost 4 times slower. Closed issue
#1655, PR
#1663.
rdflib.compat.decodeStringEscape as deprecated as this
function is not used anywhere in RDFLib anymore and the utility that it does
provide is not implemented correctly. It will be removed in RDFLib 7.0.0IdentifiedNode as a superclass of BNode and
URIRef. Closed issue #1526,
PR #1680.rdf:type in subject, object. Closed issue
#1649, PR
#1649.ConjunctiveGraph.get_graph.override argument to Store.bind which behaves similarly to
the override parameter for NamespaceManager.bind.override parameter to
NamespaceManager.bind by passing.DeprecationWarning related to plugin loading issue
#1631, PR
#1694.rdflib.graph.ContextNode and rdflib.graph.DatasetQuad type
aliases. These were not being widely used in RDFLib and were also not correct.
PR #1695.DefinedNamespace.as_jsonld_context. PR
#1706.rdflib.namespace.WGS for WGS84. Closed issue
#1709, PR
#1710.DefinedNamespace by caching attribute values. PR
#1718.sys.stderr has a isatty attribute. Closed
issue #1760, PR
#1761.rdflib.compat.etree_register_namespace. PR
#1768.rdflib.util.from_n3. Closed issue
#1769, PR
#1771.NamespaceManager.compute_qname by caching validity. PR
#1779.EXISTS inside BIND for SPARQL. This was
raising an exception during evaluation before but is now correctly handled.
Closed issue #1472, PR
#1794.rdflib.term.RDFLibGenid as a type as this caused issues
with querying. Closed issue
#1808, PR
#1821DefinedNamespace control attributes so that
inspect.signature works correctly on defined namespaces. PR
#1825.Memory, SimpleMemory and BerkelyDB stores.
Closed issue #1826, PR
#1843.NamespaceManager.expand_curie. Closed issue
#1868, PR
#1869.Literal.__sub__ and support for datetimes to both Literal.__add__
and Literal.__sub__. PR #1870.None/undefined handing in GROUP_CONCAT. Closed issue
#1467, PR
#1887.SERVICE directive. Closed issue
#1278, PR
#1894.http://rdlib.net/ to
https://rdflib.github.io and also change other uses of http://rdlib.net/
to https://rdflib.github.io. Closed issue
#1824, PR
#1901.generate to NamespaceManager.compute_qname from
NamespaceManager.compute_qname_strict so it raises an error in the same
case as the "non-strict" version. PR
#1934.trix and TriX as root element. PR
#1966.URIRef.fragment property.
PR #1991.rdflib.namespacerdflib.termrdflib.parserThis is a minor release that includes bug fixes and features.
This section lists changes that have a potential impact on users of RDFLib, changes with no user impact are not included in this section.
HAVING clause with variable composition. Closed
issue #936 and issue
#935, PR
#1093.Graph.load, Graph.seq, Graph.comment,
Graph.label. PR #1527.functools.total_ordering to implement most comparison operations for
rdflib.paths.Path. Closed issue
#685, PR
#1528.rdflib.graph.ReadOnlyGraphAggregate.quads.
Closed issue #430, PR
#1590rdflib.plugins.stores.sparqlstore.SPARQLStore.update is called. Closed
issue #1032, PR
#1623.rdflib.plugins.sparql.processor.prepareUpdate. Closed issue
#272 and discussion
#1581, PR
#1624.rdflib.namespace.DefinedNamespaceMeta.__dir__. Closed issue
#1593, PR
#1626.TypeCheckError, SubjectTypeError, PredicateTypeError,
ObjectTypeError and ContextTypeError as these exceptions are not raised by
RDFLib and their existence will only confuse users which may expect them to be
used. Also remove corresponding check_context, check_subject,
check_predicate, check_object, check_statement, check_pattern that is
unused. PR #1640.Accept HTTP header so that it is correctly
populated for all formats. PR
#1643.nquads to recognized file extensions.
PR #1653.rdflib.plugins.sparql.operators.unregister_custom_function idempotent.
Closed issue #1492,
PR #1659."\\r". The time it
takes for these parsers to parse strings with escape sequences will be
increased, and the increase will be correlated with the amount of escape
sequences that occur in a string. For strings with many escape sequences the
parsing speed seems to be almost 4 times slower. Closed issue
#1655, PR
#1663.
rdflib.compat.decodeStringEscape as deprecated as this
function is not used anywhere in RDFLib anymore and the utility that it does
provide is not implemented correctly. It will be removed in RDFLib 7.0.0IdentifiedNode as a superclass of BNode and
URIRef. Closed issue #1526,
PR #1680.rdf:type in subject, object. Closed issue
#1649, PR
#1649.ConjunctiveGraph.get_graph.override argument to Store.bind which behaves similarly to
the override parameter for NamespaceManager.bind.override parameter to
NamespaceManager.bind by passing.DeprecationWarning related to plugin loading issue
#1631, PR
#1694.rdflib.graph.ContextNode and rdflib.graph.DatasetQuad type
aliases. These were not being widely used in RDFLib and were also not correct.
PR #1695.DefinedNamespace.as_jsonld_context. PR
#1706.rdflib.namespace.WGS for WGS84. Closed issue
#1709, PR
#1710.DefinedNamespace by caching attribute values. PR
#1718.sys.stderr has a isatty attribute. Closed
issue #1760, PR
#1761.rdflib.compat.etree_register_namespace. PR
#1768.rdflib.util.from_n3. Closed issue
#1769, PR
#1771.NamespaceManager.compute_qname by caching validity. PR
#1779.EXISTS inside BIND for SPARQL. This was
raising an exception during evaluation before but is now correctly handled.
Closed issue #1472, PR
#1794.rdflib.term.RDFLibGenid as a type as this caused issues
with querying. Closed issue
#1808, PR
#1821DefinedNamespace control attributes so that
inspect.signature works correctly on defined namespaces. PR
#1825.Memory, SimpleMemory and BerkelyDB stores.
Closed issue #1826, PR
#1843.NamespaceManager.expand_curie. Closed issue
#1868, PR
#1869.Literal.__sub__ and support for datetimes to both Literal.__add__
and Literal.__sub__. PR #1870.None/undefined handing in GROUP_CONCAT. Closed issue
#1467, PR
#1887.SERVICE directive. Closed issue
#1278, PR
#1894.http://rdlib.net/ to
https://rdflib.github.io and also change other uses of http://rdlib.net/
to https://rdflib.github.io. Closed issue
#1824, PR
#1901.generate to NamespaceManager.compute_qname from
NamespaceManager.compute_qname_strict so it raises an error in the same
case as the "non-strict" version. PR
#1934.trix and TriX as root element. PR
#1966.URIRef.fragment property.
PR #1991.rdflib.namespacerdflib.termrdflib.parserStore.bind signature on TypeError
PR #2018rdflib/parser.py
PR #2016infixowl.py, remove exclusion from pyproject.toml
PR #1994Graph.serializef
PR #1984rdflib.paths docs
PR #1976pytest-subtest
PR #1973rdflib/plugins/sparql/
PR #1964None comparisons
PR #1963rdflib/graph.py
PR #1962test/jsonld/test_util.py to pytest
PR #1961test_graph_http.py to pytest
PR #1956GraphHelper.quad_set handling of Dataset
PR #1946x and x or y idiom in infixowl.py
PR #1943tempfile.mktemp
PR #1942test/data/defined_namespaces
PR #1936rdflib.utils.{get_tree,find_roots}
PR #1935EARL and RDFT namespaces to separate files
PR #1931test/data/suites/DAWG/data-r2
PR #1930rdflib/plugins/sparql
PR #1926test/data/suites/DAWG/rdflib
PR #1924test/data/suites/DAWG/data-r2-1.0
PR #1908DAWG/data-sparql11 to w3c/sparql11/data-sparql11
PR #1907test_*_w3c.py test files into test/test_w3c_spec/
PR #1904iri2uri
PR #1902s,http://rdlib.net,http://rdflib.net,g
PR #1901None/undefined handing in GROUP_CONCAT
PR #1887test/utils/
PR #1879docs/
PR #1875test/translate_algebra into test/data
PR #1864test/variants into test/data
PR #1862test/test_serializers/test_serializer.py to pytest
PR #1861...
PR #1855rdflib.graph and related
PR #1853bind_namespace values
PR #1845Memory, SimpleMemory and BerkelyDB stores.
PR #1843test_n3.py to pytest
PR #1811test_sparql/test_tsvresults.py to pytest
PR #1805test/test_util.py to pytest
PR #1795DefinedNamespaceMeta.__getitem__ is slow
PR #1718Graph behavior regarding context in constructor docstring
PR #1707property built-in as a decorator
PR #1703rdf:type in subject, object
PR #1684SUFFIX_FORMAT_MAP in plugins/parsers/jsonld.py
PR #1652(TypeCheck|SubjectType|PredicateType|ObjectType)Error and related
PR #1640test/triple_store.py so pytest picks it up
PR #1639Graph(store="SPARQLStore")
PR #1629version to docker-compose config for tests
PR #1625self.line typos in call to BadSyntax.
PR #1529Better testing and tidier code.
Better testing and tidier code.
This is a semi-major release that:
This release contains many, many hours of updates from Iwan Aucamp, so thank you Iwan!
Better testing and tidier code.
This is a semi-major release that:
This release contains many, many hours of updates from Iwan Aucamp, so thank you Iwan!
PRs merged since last release:
A slightly messed-up release of what is now 6.1.1. Do not use!
A slightly messed-up release of what is now 6.1.1. Do not use!
Minor release to support some downstream packages' namespace needs
Minor release to support some downstream packages' namespace needs
Minor release to add OWL.rational & OWL.real which are needed to allow the OWL-RL package to use only rdflib namespaces, not it's own versions.
A few other small things have been added, see the following merged PRs list:
Nothing published for this version
Minor release to fix a few small errors, in particular with JSON-LD parsing & serializing integration from rdflib-jsonld. Also, a few other niceties,
Minor release to fix a few small errors, in particular with JSON-LD parsing & serializing integration from rdflib-jsonld. Also, a few other niceties, such as allowing graph add(), remove() etc. to be chainable.
6.0.0 is a major stable release that drops support for Python 2 and Python 3 < 3.7. Type hinting is now present in much of the toolkit as a result.
6.0.0 is a major stable release that drops support for Python 2 and Python 3 < 3.7. Type hinting is now present in much of the toolkit as a result.
It includes the formerly independent JSON-LD parser/serializer, improvements to Namespaces that allow for IDE namespace
prompting, simplified use of g.serialize() (turtle default, no need to decode()) and many other updates to
documentation, store backends and so on.
Performance of the in-memory store has also improved since Python 3.6 dictionary improvements.
There are numerous supplementary improvements to the toolkit too, such as:
6.0.0 is a major stable release that drops support for Python 2 and Python 3 < 3.7. Type hinting is now present in much of the toolkit as a result.
It includes the formerly independent JSON-LD parser/serializer, improvements to Namespaces that allow for IDE namespace
prompting, simplified use of g.serialize() (turtle default, no need to decode()) and many other updates to
documentation, store backends and so on.
Performance of the in-memory store has also improved since Python 3.6 dictionary improvements.
There are numerous supplementary improvements to the toolkit too, such as:
All PRs merged since 5.0.0:
from_n3 from unescaping \xhh
PR #13435.0.0 is a major stable release and is the last release to support Python 2 & 3.4. 5.0.0 is mostly backwards- compatible with 4.2.2 and is intended fo
5.0.0 is a major stable release and is the last release to support Python 2 & 3.4. 5.0.0 is mostly backwards- compatible with 4.2.2 and is intended for long-term, bug fix only support.
5.0.0 comes two weeks after the 5.0.0RC1 and includes a small number of additional bug fixes. Note that rdflib-jsonld has released a version 0.5.0 to be compatible with rdflib 5.0.0.
There is a large list of changes since the 4.2.2 release, see the CHANGELOG for details.
See https://rdflib.dev for the proposed future release schedule.
5.0.0 is a major stable release and is the last release to support Python 2 & 3.4. 5.0.0 is mostly backwards- compatible with 4.2.2 and is intended for long-term, bug fix only support.
5.0.0 comes two weeks after the 5.0.0RC1 and includes a small number of additional bug fixes. Note that rdflib-jsonld has released a version 0.5.0 to be compatible with rdflib 5.0.0.
All PRs merged since 5.0.0RC1:
While all effort was taken to minimize breaking changes in this release, there are some.
After more than three years, RDFLib 5.0.0rc1 is finally released.
This is a rollup of all of the bugfixes merged, and features introduced to RDFLib since RDFLib 4.2.2 was released in Jan 2017.
While all effort was taken to minimize breaking changes in this release, there are some.
Please see the upgrade4to5 document in the docs directory for more information on some specific differences from 4.2.2 to 5.0.0.
All issues closed and PRs merged since 4.2.2:
__init__() got an unexpected keyword argument 'encoding'
ISSUE #639term.Literal.__add__
PR #451"1"^^xsd:boolean should not coerce to True
ISSUE #847pip install rdflib (as per README.md) gets OSError on Mint 18.1
ISSUE #704updating deprecated testing syntax #697
This is a bug-fix release, and the last release in the 4.X.X series.
optional
#631None row
#554
#592initN in update and query more consistent
#579
#600Added a Networkx connector #471, #507
This is a bug-fix release.
graphs method to the Dataset object
#504,
#495SPARQLUpdateStore
#486util.from_n3() parsing Literals with datatypes and Namespace support
#503,
#502Identifier.__hash__ stable wrt. multi processes
#501,
#500URLInputSource without content-type
#499,
#498algebra when run as a script
#497theme.conf removed
#491Variable.__repr__ returns a python representation string, not n3
#488rdf:about
#470,
#468AuditableStore improvements
#469,
#463graph.set([s,p,o]) so s and p aren't None
#467threading.RLock instances are context managers
#465def main(): functions from test coverage analysis
#472This is a new minor version of RDFLib including a handful of new features:
This is a new minor version of RDFLib including a handful of new features:
python -W all you will already see a warning on
import rdflib will show a warning (ImportWarning).
#453,
#454Fixed unicode/str bug in py3 for rdfpipe #375
This is a bug-fix release.
This will be the last RDFLib release to support python 2.5.
This is a bug-fix release.
This will be the last RDFLib release to support python 2.5.
The RDF/XML Parser was made stricter, now raises exceptions for illegal repeated node-elements. #363
The SPARQLUpdateStore now supports non-ascii unicode in update statements #356
Fixed a bug in the NTriple/NQuad parser wrt. to unicode escape sequences #352
HTML5Lib is no longer pinned to 0.95 #355
RDF/XML Serializer now uses parseType=Literal for well-formed XML literals
A bug in the manchester OWL syntax was fixed #355
Nothing published for this version
Nothing published for this version
…Node.eq` methods). This introduces some slight backwards incompatible changes, but was necessary, as the old version had inconsistent hash and equalit…
This release includes several major changes:
The new SPARQL 1.1 engine (rdflib-sparql) has been included in the core distribution. SPARQL 1.1 queries and updates should work out of the box.
SPARQL paths are exposed as operators on URIRefs, these can
then be be used with graph.triples and friends:
from rdflib import Graph, URIRef
from rdflib.namespace import FOAF, RDFS
g = Graph()
bob = URIRef("...")
cls = URIRef("...")
# List names of friends of Bob:
g.triples((bob, FOAF.knows/FOAF.name , None))
# All super-classes:
g.triples((cls, RDFS.subClassOf * '+', None))
graph.update method will apply SPARQL update statementsSeveral RDF 1.1 features are available:
DataSet classXMLLiteral and HTMLLiteralsBNode (de)skolemization is supported through BNode.skolemize,
URIRef.de_skolemize, Graph.skolemize and Graph.de_skolemizeHandled of Literal equality was split into lexical comparison
(for normal == operator) and value space (using new Node.eq
methods). This introduces some slight backwards incompatible
changes, but was necessary, as the old version had
inconsistent hash and equality methods that could lead the
literals not working correctly in dicts/sets.
The new way is more in line with how SPARQL 1.1 works.
For the full details, see:
https://github.com/RDFLib/rdflib/wiki/Literal-reworking
Iterating over QueryResults will generate ResultRow objects,
these allow access to variable bindings as attributes or as a
dict. I.e.
for row in g.query('select ... ') :
print row.age, row["name"]
"Slicing" of Graphs and Resources as syntactic sugar: (#271)
graph[bob : FOAF.knows/FOAF.name] -> generator over the names of Bobs friends
The SPARQLStore and SPARQLUpdateStore are now included
in the RDFLib core
The documentation has been given a major overhaul, and examples for most features have been added.
String operations on URIRefs return new URIRefs: (#258)
URIRef('http://example.org/')+'test' -> URIRef('http://example.org/test')
Parser/Serializer plugins are also found by mime-type, not just by plugin name: (#277)
Namespace is no longer a subclass of URIRef
URIRefs and Literal language tags are validated on construction, avoiding some "RDF-injection" issues (#266)
A new memory store needs much less memory when loading large graphs (#268)
Turtle/N3 serializer now supports the base keyword correctly (#248)
py2exe support was fixed (#257)
Several bugs in the TriG serializer were fixed
Several bugs in the NQuads parser were fixed
This release introduced new parsers for structured data in HTML. In particular formats: hturtle, rdfa, mdata and an auto-detecting html format were added. Thanks to Ivan Herman for this!
This release includes a lot of admin maintentance - correct dependencies for different python versions, etc. Several py3 bugs were also fixed.
This release drops python 2.4 compatibility - it was just getting too expensive for us to maintain. It should however be compatible with any cpython from 2.5 through 3.3.
node.md5_term is now deprecated, if you use it let us know.
Literal.datatype/language are now read-only properties (#226)
Serializing to file fails in py3 (#249)
TriX serializer places two xmlns attributes on same element (#250)
RDF/XML parser fails on when XML namespace is not explicitly declared (#247)
Resource class should "unbox" Resource instances on add (#215)
Turtle/N3 does not encode final quote of a string (#239)
float Literal precision lost when serializing graph to turtle or n3 (#237)
plain-literal representation of xsd:decimals fixed
allow read-only sleepycat stores
language tag parsing in N3/Turtle fixes to allow several subtags.
Almost identical to 3.2.2 A stupid bug snuck into 3.2.2, and querying graphs were broken.
This is mainly a maintenance release.
This release should be compatible with python 2.4 through to 3.
Changes:
This is mainly a maintenance release.
Changes:
New setuptools entry points for query processors and results
Literals constructed from other literals copy datatype/lang (#188)
Relative URIs are resolved incorrectly after redirects (#130)
Illegal prefixes in turtle output (#161)
Sleepcat store unstable prefixes (#201)
Consistent toPyton() for all node objects (#174)
Better random BNode ID in multi-thread environments (#185)
Major changes:
Thanks to Thomas Kluyver, rdflib now works under python3, the setup.py script automatically runs 2to3.
Unit tests were updated and cleaned up. Now all tests should pass.
Documentation was updated and cleaned up.
A new resource oriented API was added: http://code.google.com/p/rdflib/issues/detail?id=166
Fixed many minor issues:
http://code.google.com/p/rdflib/issues/detail?id=180 serialize(format="pretty-xml") fails on cyclic links
Fixed a range of minor issues:
http://code.google.com/p/rdflib/issues/detail?id=128
Literal.str does not behave like unicode
http://code.google.com/p/rdflib/issues/detail?id=141
(RDFa Parser) Does not handle application/xhtml+xml
http://code.google.com/p/rdflib/issues/detail?id=142
RDFa TC #117: Fragment identifiers stripped from BASE
http://code.google.com/p/rdflib/issues/detail?id=146
Malformed literals produced when rdfa contains newlines
http://code.google.com/p/rdflib/issues/detail?id=152
Namespaces beginning with _ are invalid
http://code.google.com/p/rdflib/issues/detail?id=156
Turtle Files with a UTF-8 BOM fail to parse
http://code.google.com/p/rdflib/issues/detail?id=154
ClosedNamespace.str returns URIRef not str
http://code.google.com/p/rdflib/issues/detail?id=150
IOMemory does not override open
http://code.google.com/p/rdflib/issues/detail?id=153
Timestamps with microseconds and "Z" timezone are not parsed
http://code.google.com/p/rdflib/issues/detail?id=118
DateTime literals with offsets fail to convert to Python
http://code.google.com/p/rdflib/issues/detail?id=157
Timestamps with timezone information are not parsed
http://code.google.com/p/rdflib/issues/detail?id=151
problem with unicode literals in rdflib.compare.graph_diff
http://code.google.com/p/rdflib/issues/detail?id=149
BerkeleyDB Store broken with create=False
http://code.google.com/p/rdflib/issues/detail?id=134
Would be useful if Graph.query could propagate kwargs to a
plugin processor
http://code.google.com/p/rdflib/issues/detail?id=133
Graph.connected exception when passed empty graph
http://code.google.com/p/rdflib/issues/detail?id=129
Not compatible with Python 2.4
http://code.google.com/p/rdflib/issues/detail?id=119
Support Python's set operations on Graph
http://code.google.com/p/rdflib/issues/detail?id=130
NT output encoding to utf-8 broken as it goes through
_xmlcharrefreplace
http://code.google.com/p/rdflib/issues/detail?id=121#c1
Store SPARQL Support
Working test suite with all tests passing.
Removed dependency on setuptools.
(Issue #43) Updated Package and Module Names to follow conventions outlined in http://www.python.org/dev/peps/pep-0008/
Removed SPARQL bits and non core plugins. They are mostly moving to http://code.google.com/p/rdfextras/ at least until they are stable.
Fixed datatype for Literal(True).
Fixed Literal to enforce constraint of having either a language or datatype but not both.
Fixed Literal's repr.
Fixed to Graph Add/Sub/Mul opterators.
Upgraded RDFa parser to pyRdfa.
Upgraded N3 parser to the one from CWM.
Fixed unicode encoding issue involving N3Parser.
N3 serializer improvements.
Fixed HTTP content-negotiation
Fixed Store.namespaces method (which caused a few issues depending on Store implementation being used.)
Fixed interoperability issue with plugin module.
Fixed use of Deprecated functionality.
Fixed Literal comparison case involving Literal's with datatypes of XSD.base64Binary.
Fixed case where XSD.date was matching before XSD.dateTime for datetime instances.
Fixed jython interoperability issue (issue #53).
Fixed Literal repr to handle apostrophes correctly (issue #28).
Fixed Literal's repr to be consistent with its __init__ (issue #33).
Improved Literal comparison / equality
Sparql cleanup.
getLiteralValue now returns the Literal object instead of the result of toPython(). Now that Literals override a good coverage of comparison operators, they should be passed around as first class objects in the SPARQL evaluation engine.
Added support for session bnodes re: sparql
Fixed prolog reduce/reduce conflict. Added Py_None IncRefs where they were being passed into Python method invocations (per drewp's patch)
Fixed sparql queries involving empty namespace prefix.
Fixed the selected variables sparql issue
Fixed <BASE> support in SPARQL queries.
Fixed involving multiple unions and queries are nested more than one level (bug in _getAllVariables causing failure when parent.top is None)
Fixed test_sparql_equals.py.
Fixed sparql json result comma errors issue.
Fixed test_sparql_json_results.py (SELECT * variables out of order)
Added a 4Suite-based SPARQL XML Writer implementation. If 4Suite is not installed, the fallback python saxutils is used instead
applied patch from http://rdflib.net/issues/2007/02/23/bugs_in_rdflib.sparql.queryresult/issue
The restriction on GRAPH patterns with variables has been relieved a bit to allow such usage when the variable is provided as an initial binding
Fix for OPTIONAL patterns. P1 OPT P2, where P1 and P2 shared variables which were bound to BNodes were not unifying on these BNode variable efficiently / correctly. The fix was to add bindings for 'stored' BNodes so they aren't confused for wildcards
Added support to n3 parser for retaining namespace bindings.
Fixed several RDFaParser bugs.
Added serializer specific argument support.
Fixed a few PrettyXMLSerializer issues and added a max_depth option.
Fixed some TurtleSerializer issues.
Fixed some N3Serializer issues.
Added support easy_install
added link to long_descriptin for easy_install -U rdflib==dev to work; added download_url back
added continuous-releases-using-subversion bit
Added rdflib_tools package Added rdfpipe Added initial EARLPluging
Improved test running... using nose... added tests
Exposed generated test cases for nose to find. added bit to configure 'setup.py nosetests' to run doc tests
added nose test bits
Added md5_term_hash method to terms.
Added commit_pending_transaction argument to Graph's close method.
Added DeprecationWarning to rdflib.constants
Added a NamespaceDict class for those who want to avoid the Namespace as subclass of URIRef issues
Added bind function
Fixed type of Namespace re: URIRef vs. unicode
Improved ValueError message
Changed value method's any argument to default to True
Changed __repr__ to always reflect that it's an rdf.Literal --
as this is the case even though we now have it acting like the
corresponding type in some casses
A DISTINCT was added to the SELECT clause to ensure duplicate triples are not returned (an RDF graph is a set of triples) - which can happen for certain join expressions.
Support for ConditionalAndExpressionList and RelationalExpressionList (|| and && operators in FILTER)
Fixed context column comparison. The hash integer was being compared with 'F' causing a warning:Warning: Truncated incorrect DOUBLE value: 'F'
applied patch in http://rdflib.net/issues/2006/12/13/typos_in_abstractsqlstore.py/issue
fix for http://rdflib.net/issues/2006/12/07/problems_with_graph.seq()_when_sequences_contain_more_than_9_items./issue
General code cleanup (removing redundant imports, changing relative imports to absolute imports etc)
Removed usage of deprecated bits.
Added a number of test cases.
Added DeprecationWarning for save method
refactoring of GraphPattern
ReadOnlyGraphAggregate uses Graph constructor properly to setup (optionally) a common store
Fixed bug with . (fullstop) in localname parts.
Changed Graph's value method to return None instead of raising an AssertionError.
Fixed conversion of (exiplicit) MySQL ports to integers.
Fixed MySQL store so it properly calculates __len__ of
individual Graphs
Aligned with how BerkeleyDB is generating events (remove events are expressed in terms of interned strings)
Added code to catch unpickling related exceptions
Added BerkeleyDB store implementation.
Merged TextIndex from michel-events branch.
Added TriXParser, N3Serializer and TurtleSerializer.
Added events to store interface: StoreCreated, TripleAdded and TripleRemoved.
Added Journal Reader and Writer.
Removed BerkeleyDB level journaling.
Added support for triple quoted Literal's.
Fixed some corner cases with Literal comparison.
Fixed PatternResolution for patterns that return contexts only.
Fixed NodePickler not to choke on unhashable objects.
Fixed Namespace's __getattr__ hack to ignore names starting
with __
Added SPARQL != operator.
Fixed query result __len__ (more efficient).
Fixed and improved RDFa parser.
redland patches from http://rdflib.net/pipermail/dev/2006-September/000069.html
various patches for the testsuite - http://rdflib.net/pipermail/dev/2006-September/000069.html
Added SPARQL query support.
Added XSD to/from Python datatype support to Literals.
Fixed ConjunctiveGraph so that it is a proper subclass of Graph.
Added Deprecation Warning when BackwardCompatGraph gets used.
Added RDFa parser.
Added Collection Class for working with RDF Collections.
Added method to Graph for testing connectedness
Fixed bug in N3 parser where identical BNodes were not being combined.
Fixed literal quoting in N3 serializer.
Fixed RDF/XML serializer to skip over N3 bits.
Changed Literal and URIRef instantiation to catch UnicodeDecodeErrors - which were being thrown when the default decoding method (ascii) was hitting certain characters.
Changed Graph's bind method to also override the binding in the case of an existing generated bindings.
Added FOPLRelationalModel - a set of utility classes that implement a minimal Relational Model of FOPL implemented as a SQL database (uses identifier/value interning and integer half-md5-hashes for space and index efficiency).
Changed MySQL store to use FOPLRelationalModel plus fixes and improvements.
Added more test cases.
Cleaned up source code to follow pep8 / pep257.
Added save method to BackwardCompatibleGraph so that example.py etc work again.
Applied patch from Drew Perttula to add local_time_zone argument to util's date_time method.
Fixed a relativize bug in the rdf/xml serializer.
Fixed NameError: global name 'URIRef' is not defined error in BerkeleyDB.py by adding missing import.
Applied patch for Seq to sort list by integer, added by Drew Hess.
Added a preserve_bnode_ids option to rdf/xml parser.
Applied assorted patches for tests (see http://tracker.asemantics.com/rdflib/ticket/8 )
Applied redland.diff (see http://tracker.asemantics.com/rdflib/ticket/9 )
Applied changes specified http://tracker.asemantics.com/rdflib/ticket/7
Added a set method to Graph.
Fixed RDF/XML serializer so that it does not choke on n3 bits (rather it'll just ignore them)
See http://rdflib.net/2.3.0/ for most up-to-date release notes
Added N3 support to Graph and Store.
Added Sean's n3p parser, and ntriples parser.
BerkeleyDB implementation has been revamped in the process of expanding it to support the new requirements n3 requirements. It also now persists a journal -- more to come.
detabified source files.
Literal and parsers now distinguish between datatype of None and datatype of "".
Store-agnostic 'fallback' implementation of REGEX matching (inefficient but provides the capability to stores that don't support it natively). Implemented as a 'wrapper' around any Store which replaces REGEX terms with None (before dispatching to the store) and whittles out results that don't match the given REGEX term expression(s).
Store-agnostic 'fallback' implementation of transactional rollbacks (also inefficient but provides the capability to stores that don't support it natively). Implemented as a wrapper that tracks a 'thread-safe' list of reversal operations (for every add, track the remove call that reverts the store, and vice versa). Upon store.rollback(), execute the reverse operations. However, this doesn't guarantee durability, since if the system fails before the rollbacks are all executed, the store will remain in an invalid state, but it provides Atomicity in the best case scenario.
Fixed BerkeleyDB backend to commit after an add and remove. This should help just a bit with those unclean shutdowns ;)
Fixed use of logging so that it does not mess with the root logger. Thank you, Arve, for pointing this one out.
Fixed Graph's value method to have default for subject in addition to predicate and object.
Fixed Fourthought backend to be consistent with interface. It now supports an empty constructor and an open method that takes a configuration string.
Applied patch from inkel to add encoding argument to all serialization related methods.
Fixed XMLSerializer bug regarding default namespace bindings.
Fixed namespace binding bug involving binding a second default namespace.
Applied patch from Gunnar AAstrand Grimnes to add context
support to __iadd__ on Graph. (Am considering the lack of
context support a bug. Any users currently using __iadd__, let
me know if this breaks any of your code.)
Added Fourthought backend contributed by Chimezie Ogbuji.
Fixed a RDF/XML parser bug relating to XMLLiteral and escaping.
Fixed setup.py so that install does not try to uninstall (rename_old) before installing; there's now an uninstall command if one needs to uninstall.
Fixed issue regarding Python2.3 compatibility.
Fixed minor issue with URIRef's absolute method.
Added optional base argument to URIRef.
Fixed bug where load and parse had inconsistent behavior.
Added a FileInputSource.
Added skeleton sparql parser and test framework.
Included pyparsing (pyparsing.sourceforge.net) for sparql parsing.
Added attribute support to namespaces.
Added Ivan's sparql-p implementation.
Literal is now picklable.
Added optional base argument to serialize methods about which to relativize.
Applied patch to remove some dependencies on Python 2.4 features.
Fixed BNode's n3 serialization bug (recently introduced).
Fixed a collections related bug.
Added patch from Sidnei da Silva that adds a sqlobject based backend.
Fixed bug in PrettyXMLSerializer (rdf prefix decl was missing sometimes)
Fixed bug in RDF/XML parser where empty collections where causing exceptions.
Fixed a number of bugs relating to 2.0 backward compatibility.
Fixed split_uri to handle URIs with _ in them properly.
Fixed bug in RDF/XML handler's absolutize that would cause some URIRefs to end in ##
Added check_context to Graph.
Added patch the improves IOMemory implementation.
Merged TripleStore and InformationStore into Graph.
Added plugin support (or at least cleaned up, made consistent the plugin support that existed).
Added value and seq methods to Graph.
Renamed prefix_mapping to bind.
Added namespaces method that is a generator over all prefix, namespace bindings.
Added notion of NamespaceManager.
Added couple new backends, IOMemory and ZODB.
Added pretty-xml serializer (inlines BNodes where possible, typed nodes, Collections).
Fixed bug in NTParser and n3 methods where not all characters where being escaped.
Changed label and comment methods to return default passed in when there is no label or comment. Moved methods to Store Class. Store no longer inherits from Schema.
Fixed bug involving a case with rdf:about='#'
Changed InMemoryBackend to update third index in the same style it does the first two.
Added publicID argument to Store's load method.
Added RDF and RDFS to top level rdflib package.
Removed unfinished functionality.
Fixed bug where another prefix other than rdf was getting defined for the rdf namespace (causing an assertion to fail).
Fixed bug in serializer where nodeIDs were not valid NCNames.
Added missing "from future import generators" statement to InformationStore.
Simplified RDF/XML serializer fixing a few bugs involving BNodes.
Added a reset method to RDF/XML parser.
Changed 'if foo' to "if foo is not None" in a few places in the RDF/XML parser.
Fully qualified imports in rdflib.syntax {parser, serializer}.
Context now goes through InformationStore (was bypassing it going directly to backend).
Improved performance of Identifier equality tests.
Added missing "from future import generators" statements needed to run on Python2.2.
Added alternative to shlib.move() if it isn't present.
Fixed bug that occurred when specifying a backend to InformationStore's constructor.
Fixed bug recently introduced into InformationStore's remove method.
Fixed a bug in the SleepyCatBackend multi threaded concurrency support. (Tested fairly extensively under the following conditions: multi threaded, multi process, and both).
NOTE: fix involved change to database format -- so 2.0.1 will not be able to open databases created with 2.0.0
Removed the use of the Concurrent wrapper around InMemoryBackend and modified InMemoryBackend to handle concurrent requests. (Motivated by Concurrent's poor performance on bigger TripleStores.)
Improved the speed of len(store) by making backends
responsible for implementing __len__.
Context objects now have a identifier property.
Fixed a few bugs in the SleepyCatBackend multi process concurrency support.
Removed rdflib.Resource
Changed remove to now take a triple pattern and removed remove_triples method.
Added __iadd__ method to Store in support of store +=
another_store.
Added a serialization dispatcher.
Added format arg to save method.
Store now remembers prefix/namespace bindings.
Backends are now more pluggable
...
Fixed bug in serializer where triples where only getting serialized the first time.
Added type checking for contexts.
Fixed bug that caused comparisons with a Literal to fail when the right hand side was not a string.
Added DB_INIT_CDB flag to SCBacked for supporting multiple reader/single writer access
Changed rdf:RDF to be optional to conform with latest spec.
Fixed handling of XMLLiterals
Removed bag_id support and added it to OLD_TERMS.
Added a double hash for keys in SCBacked.
Fixed _HTTPClient so that it no longer removes metadata about a context right after it adds it.
Added a KDTreeStore and RedlandStore backends.
Added a StoreTester.
Fixed bug in SCBackend where language and datatype information where being ignored.
Fixed bug in transitive_subjects.
Updated some of the test cases that where not up to date.
async_load now adds more http header and error information to the InformationStore.
Fixed bug in load methods where relative URLs where not being absolutized correctly on Windows.
Fixed serializer so that it throws an exception when trying to serialize a graph with a predicate that can not be split.
Added an exists method to the BackwardCompatibility mixin.
Added versions of remove, remove_triples and triples methods to the BackwardCompatility mixin for TripleStores that take an s, p, o as opposed to an (s, p, o).
Added support for parsing XMLLiterals.
Added support for proper charmod checking (only works in Python2.3).
Fixed remaining rdfcore test cases that where not passing.
Fixed windows bug in AbstractInformationStore's run method.
Added systemID, line #, and column # to error messages.
BNode prefix is now composed of ascii_letters instead of letters.
Added a bsddb backed InformationStore.
Added an asynchronous load method, methods for scheduling context updates, and a run method.
Introduction of InformationStore, a TripleStore with the addition of context support.
Resource __getitem__ now returns object (no longer returns a
Resource for the object).
Fixed bug in parser that was introduced in last release regaurding unqualified names.
Interface realigned with last stable release.
Serializer now uses more of the abbreviated forms where possible.
Parser optimized and cleaned up.
Added third index to InMemoryStore.
The load and parse methods now take a single argument.
Added a StringInputSource for to support parsing from strings.
Renamed rdflib.BTreeTripleStore.TripleStore to rdflib.BTreeTripleStore.BTreeTripleStore.
Minor reorganization of mix-in classes.
BNodes now created with a more unique identifier so BNodes from different sessions do not collide.
Added initial support for XML Literals (for now they are parsed into Literals).
Resource is no longer a special kind of URIRef.
Resource no longer looks at range to determine default return
type for __getitem__. Instead there is now a get(predicate, default)
method.
Fixed Literal's __eq__ method so that Literal('foo')=='foo' etc.
Fixed Resource's __setitem__ method so that it does not raise
a dictionary changed size while iterating exception.
Resource is now a special kind of URIRef
Resource's __getitem__ now looks at rdfs:range to determine
return type in default case.
Cleaned up interface and promoted it to SIR: Simple Interface for RDF.
Updated parser to use SAX2 interfaces instead of using expat directly.
Added BTreeTripleStore, a ZODB BTree TripleStore backend. And a default pre-mixed TripleStore that uses it.
Synced with latest (Editor's draft) RDF/XML spec.
Added datatype support.
Cleaned up interfaces for load/parse: removed generate_path from loadsave and renamed parse_URI to parse.
BNode can now be created with specified value.
Literal now has a language attribute.
Parser now creates Literals with language attribute set appropriately as determined by xml:lang attributes.
TODO: Serializer-Literals-language attribute
TODO: Change __eq__ so that Literal("foo")=="foo" etc
TripleStores now support "in" operator. For example: if (s, p, o) in store: print "Found ", s, p, o
Added APIs/object for working at level of a Resource. NOTE: This functionality is still experimental
Consecutive Collections now parse correctly.
Added support for rdf:parseType="Collection"
Added items generator for getting items in a Collection
Renamed rdflib.triple_store to rdflib.TripleStore to better follow python style conventions.
Added an Identifier Class
Moved each node into its own Python module.
Added rdflib.util with a first and uniq function.
Added a little more to example.py
Removed generate_uri since we have BNodes now.
Added support for proposed rdf:nodeID to both the parser and serializer.
Reimplemented serializer which now nests things where possible.
Added partial support for XML Literal parseTypes.
Fixed bug where bNodes where being created for nested property elements when they where not supposed to be.
Added lax mode that will convert rdf/xml files that contain bare IDs etc. Also, lax mode will only report parse errors instead of raising exceptions.
Added missing check for valid attribute names in the case of production 5.18 of latest WD spec.
Added missing constants for SUBPROPERTYOF, ISDEFINEDBY.
Added test case for running all of the rdf/xml test cases.
Reimplemented rdf/xml parser to conform to latest WD.
There is now a remove and a remove_triples (no more overloaded remove).
Layer 2 has been merged with layer 1 since there is no longer a need for them to be separate layers.
The generate_uri method has moved to LoadSave since triple stores do not have a notion of a uri. [Also, with proper bNode support on its way the need for a generate_uri might not be as high.]
Fixed bug in node's n3 function: URI -> URIRef.
Replaced string based exceptions with class based exceptions.
Added PyUnit TestCase for parser.py
Added N-Triples parser.
Added __len__ and __eq__ methods to store interface.
Initial release after being split from redfootlib.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →