Recent Releases of rdflib
rdflib - 2025-03-29 RELEASE 7.1.4
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:
- 2025-03-24 - remove old hacks against 2to3 PR #3095
- 2025-03-24 - Allow multi subjects & objects in graph funcs PR #3086
- 2025-03-24 - Reduce test warnings PR #3085
- 2025-03-22 - Downgrade log message about plugin PR #3063
- 2025-03-22 - remove old hacks against 2to3 PR #3076
- 2025-03-22 - Cope with Namespace annotations in Python 3.14 PR #3084
- 2025-01-18 - small docco update PR #3053
... and lots of boring dependency bump PRs merged!
- Python
Published by nicholascar 10 months ago
rdflib - 2025-01-18 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.
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.
- Python
Published by nicholascar 12 months ago
rdflib - 2024-10-29 RELEASE 7.1.1
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 getmergedprs. 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
- Python
Published by nicholascar about 1 year ago
rdflib - 2024-10-17 RELEASE 7.1.0
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.
- Python
Published by nicholascar about 1 year ago
rdflib - RDFlib 7.0.0
2023-08-02 RELEASE 7.0.0
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.
BREAKING CHANGE: don't use 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.
- Fixes https://github.com/RDFLib/rdflib/issues/2404
- Fixes https://github.com/RDFLib/rdflib/issues/2375
- Fixes https://github.com/RDFLib/rdflib/issues/436
- Fixes https://github.com/RDFLib/rdflib/issues/1804
BREAKING CHANGE: drop support for python 3.7 (#2436)
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.
feat: add curie method to NamespaceManager (#2365)
Added a curie method to NamespaceManager, which can be used to generate a
CURIE from a URI.
Other changes:
- Fixed
NamespaceManager.expand_curieto work with CURIES that have blank prefixes (e.g.:something), which are valid according to CURIE Syntax 1.0. - Added a test to confirm https://github.com/RDFLib/rdflib/issues/2077.
Fixes https://github.com/RDFLib/rdflib/issues/2348.
feat: add optional 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.
feat: Don't generate prefixes for unknown URIs (#2467)
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.
feat: Longturtle improvements (#2500)
Improved the output of the longturtle serializer.
fix: SPARQL count with optionals (#2448)
Change SPARQL count aggregate to ignore optional that are unbound instead of raising an exception when they are encountered.
fix: 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
fix: add 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.
fix: bugs with rdflib.extras.infixowl (#2390)
Fix the following issues in rdflib.extras.infixowl:
- getting and setting of max cardinality only considered identifiers and not other RDF terms.
- The return value of manchesterSyntax was wrong for some cases.
- The way that BooleanClass was generating its string representation (i.e. BooleanClass.__repr__) was wrong for some cases.
Other changes: - Added an example for using infixowl to create an ontology. - Updated infixowl tests. - Updated infixowl documentation.
This code is based on code from: - https://github.com/RDFLib/rdflib/pull/2307
fix: correct imports and __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.
fix: dbpedia URL to use https instead of http (#2444)
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.
fix: eliminate bare 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.
fix: eliminate file intermediary in translate algebra (#2267)
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()).
fix: eliminate some mutable default arguments in SPARQL code (#2301)
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.
fix: formatting of SequencePath and AlternativePath (#2504)
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.
fix: handling of 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:
- Add tests for
rdflib.NORMALIZE_LITERALSto ensure it behaves correctly.
Related issues:
fix: HTTP 308 Permanent Redirect status code handling (#2389)
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: - https://github.com/RDFLib/rdflib/issues/2382.
fix: lexical-to-value mapping of rdf:HTML literals (#2483)
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.
fix: TriG handling of GRAPH keyword without a graph ID (#2469)
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.
fix: TriG parser error handling for nested graphs (#2468)
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: typing errors from dmypy (#2451)
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.
fix: widen 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.
docs: Add CITATION.cff file (#2502)
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.
docs: add guidelines for breaking changes (#2402)
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: - https://github.com/RDFLib/rdflib/discussions/2395 - https://github.com/RDFLib/rdflib/pull/2108 - https://github.com/RDFLib/rdflib/discussions/1841
docs: fix comment that doesn't describe behavior (#2443)
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.
docs: recommend making an issue before making an enhancement (#2391)
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: - Updated the checklist in the pull request template to be more accurate to current practice. - Improved grammar and writing in the pull request template, contribution guide and developers guide.
docs: remove unicode string form in rdflib/term.py (#2384)
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.
- Python
Published by aucampia over 2 years ago
rdflib - RDFlib 6.3.2
2023-03-26 RELEASE 6.3.2
This is a patch release that fixes some bugs, including regressions introduced in release 6.2.0 and 6.3.0.
fix: 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.
fix: add __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.
- Closes https://github.com/RDFLib/rdflib/issues/2281.
- Closes https://github.com/RDFLib/rdflib/issues/2242.
fix: Add 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.
fix: add the wgs namespace binding back (#2294)
https://github.com/RDFLib/rdflib/pull/1686 inadvertently removed the wgs prefix.
This change adds it back.
fix: change the prefix for 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.
fix: include docs and examples in the sdist tarball (#2289)
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.
fix: IRI to URI conversion (#2304)
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.
fix: JSON-LD context construction from a 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.
fix: reference to global inside 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.
fix: restore the 6.1.1 default bound namespaces (#2313)
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.
test: add 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.
chore: Update CONTRIBUTORS from commit history (#2305)
This ensures contributors are credited. Also added .mailmap to fix early misattributed contributions.
docs: fix typo in NamespaceManager documentation (#2291)
Changed cdterms to dcterms, see https://github.com/RDFLib/rdflib/issues/2196 for more info.
- Python
Published by aucampia almost 3 years ago
rdflib - RDFlib 6.3.1
2023-03-18 RELEASE 6.3.1
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.
build: explicitly specify 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.
build: include test in sdist (#2282)
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.
docs: don't use kroki (#2284)
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.
- Python
Published by aucampia almost 3 years ago
rdflib - RDFlib 6.3.0
2023-03-16 RELEASE 6.3.0
This is a minor release that includes bug fixes and features.
Important Information
- 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 number will not be changed solely on the basis of Python 3.7 support being dropped.
User facing changes
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
NamespaceManagerinConjunctiveGraph's methodget_context(). Theget_context()method will now pass theNamespaceManagerofConjunctiveGraphto thenamespace_managerattribute of the newly created context graph, instead of theConjunctiveGraphobject itself. This cleans up an oldFIXMEcomment. PR #2073.
- Fixes passing
InfixOWL fixes and cleanup. Closed issue #2030. PR #2024, and PR #2033.
rdflib.extras.infixowl.Restriction.__init__will now raise aValueErrorif there is no restriction value instead of anAssertionError.- Fixed numerous issues with
rdflib.extras.infixowl.Restriction.restrictionKindwhich was essentially not working at all. - Fixed how
rdflib.extras.infixowl.Property.__repr__usesrdflib.namespace.OWL. - Removed
rdflib.extras.infixowl.Infix.__ror__andrdflib.extras.infixowl.Infix.__or__as they were broken. - Removed unused
rdflib.extras.infixowl.termDeletionDecorator. - Added
rdflib.extras.infixowl.MalformedClassErrorwhich will replacerdflib.extras.infixowl.MalformedClass(which is an exception) in the next major version. - Eliminated the use of mutable data structures in some argument defaults.
Fixed some cross-referencing issues in RDFLib documentation. Closed issue #1878. PR #2036.
Fixed import of
xml.sax.handlerinrdflib.plugins.parsers.trixso that it no longer tries to import it fromxml.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.- Result parsing from
TextIOstreams now work correctly withlxmlinstalled and with XML documents that are notutf-8encoded. - Elements inside
<results>that are not<result>are now ignored. - Elements inside
<result>that are not<binding>are now ignored. - Also added type hints to
rdflib.plugins.sparql.results.xmlresults.
- Result parsing from
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.parserandrdflib.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.
- Removed fallback in case the
shutilmodule does not have themovefunction.
- Removed fallback in case the
Improve file-URI and path handling in
Graph.serializeandResult.serializeto address problems with windows path handling inResult.serializeand to make the behavior betweenGraph.serializeandResult.serialiemore consistent. Closed issue #2067. PR #2065.- String values for the
destinationargument will now only be treated as file URIs ifurllib.parse.urlparsereturns their schema asfile. - Simplified file writing to avoid a temporary file.
- String values for the
Narrow the type of context-identifiers/graph-names from
rdflib.term.Nodetordflib.term.IdentifiedNodeas 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
Literaldatatypeto correctly differentiate between blank string values and undefined values, also changed the datatype ofrdflib.term.Literal.datatypefromOptional[str]toOptional[URIRef]now that all non-URIRefstrvalues will be converted toURIRef. 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.BerkeleyDBas a store plugin if theberkeleydbmodule 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.evalPathin favor ofrdflib.path.eval_pathwhich is PEP-8 compliant. PR #2046Added
charset=UTF-8to theContent-Typeheader sent when doing an update withSPARQLConnector. Closed [issue2095](https://github.com/RDFLib/rdflib/issues/2095). [PR
2112](https://github.com/RDFLib/rdflib/pull/2112).
Removed the
rdflib.plugins.sparql.parserutils.plistclass as it served no discernible purpose. PR #2143Changed 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
SPARQLConnectorwhen using POST method. PR #2180.Fixed extra keyword argument and header handling in
SPARQLConnectorthat resulted in headers fromSPARQLConnector.updatepolluting headers fromSPARQLConnector.queryvice versa. PR #2183Added version restrictions for dependencies. PR #2187
Switch to using
importlibfor 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
VALUESwas used outside aGROUP BYclause. PR #2188.Fixed a bug that occurred when using
SELECT *inside anotherSELECT *. Closed issue #1722. PR #2190.Added SPARQL DESCRIBE query implementation. Closes issue #479. PR #2221.
Fixed a bug in
rdflib.tools.defined_namespace_creatorthat occurred when multiplerdfs:commentwere present on one resource. PR #2254.Fixed
rdflib.util._iri2uri()to not quote thenetlocparameter. 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.evalPathfunction. PR #2266Added documentation for security considerations and available mitigations. Closed issue #1844. PR #2267.
PRs merged since last release
- fix: validation issues with examples PR #2269
- feat: more type hints for
rdflib.plugins.sparqlPR #2268 - fix: eliminate use of deprecated
rdflib.path.evalPathPR #2266 - more type-hinting for SPARQL plugin PR #2265
- feat: add diverse type hints PR #2264
- feat: add type hints to
rdflib.collectionPR #2263 - feat: add type hints to
rdflib.utilPR #2262 - feat: add type hints to
rdflib.pathPR #2261 - test: fix deprecation warnings PR #2260
- docs: update test reports PR #2259
- fix: small InputSource related issues PR #2255
- definednamespacecreator: concatenate several rdfs:comments PR #2254
- feat: add parser type hints PR #2232
- build: bump versions PR #2231
- Add SPARQL DESCRIBE query implementation PR #2221
- build: rename minimum constraints file to evade dependabot PR #2209
- Fix for
SELECT *insideSELECT *bug PR #2190 - Fixing bug applying VALUES outside of a GROUP BY PR #2188
- move to poetry for dependency management; consolidate more settings into pyproject.toml PR #2187
- build: update black to 22.12.0 PR #2186
- Issue2179 incorrect headers PR #2183
- Fix missing query string params in sparqlconnector when using POST method PR #2180
- [pre-commit.ci] pre-commit autoupdate PR #2178
- Add namespace_manager argument for n3 method on Paths PR #2174
- fix DCTERMS prefix typo PR #2173
- compute_qname handle case where name could be unbound PR #2169
- Issue 2164 PR #2165
- build: update black to 22.10.0 PR #2163
- ci: switch to python 3.11 release PR #2162
- fix: type errors resulting from new mypy PR #2161
- do not write prefix for empty graph id, fix #2154 PR #2160
- Remove redundant class PR #2143
- Pass
service_queryto_buildQueryStringForServiceCallinstead of aMatchPR #2134 - Add type hint to part in evalServiceQuery PR #2133
- Remove outdated comment PR #2129
- fix: type ignore compatibility with latest mypy PR #2127
- Remove redundant PR template PR #2126
- build: use 3.11.0-rc.2 PR #2119
- build: docker images for latest release and main branch PR #2116
- add charset encoding to SPARQLConnector.update() request. PR #2112
- Add test for issue #2011 PR #2107
- chore: rename default branch to
mainPR #2101 - Correct a typo in test_roundtrip.py PR #2100
- feat: add type hints to
rdflib.queryand related PR #2097 - fix: Don't register berkelydb as a store if it is not available on the system PR #2096
- feat: add type hints to
rdflib.plugins.sparql.{algebra,operators}PR #2094 - test: Fix
exclude_linesfor coverage PR #2093 - test: content-type handling with SPARQLStore + CONSTRUCT queries PR #2092
- ci: publish test reports for mypy and pytest PR #2091
- test: convert more test from unittest to pytest PR #2089
- ci: switch from 3.11.0-beta.4 to 3.11.0-rc.1 PR #2087
- fix: issue with trig reference counting across graphs PR #2085
- Generate VALUES block for federated queries with variables only PR #2084
- docs: Add a contributing guide PR #2082
- feat: Add type hints to rdflib.graph PR #2080
- fix: handling of Literal datatype PR #2076
- test: convert some
unittestbased tests topytestPR #2075 - test: honour lax cardinality from test manifests PR #2074
- Fix passing ConjunctiveGraph as namespace_manager PR #2073
- fix: always parse HexTuple files as utf-8 PR #2070
- fix: narrow the context identifier type from
NodetoIdentifiedNodePR #2069 - build: set a minimum version for flakeheaven PR #2068
- chore: remove pre Python 3.7 compatibility code for shutil PR #2066
- fix: issues with string destination handling in
{Graph,Result}.serializePR #2065 - build: fix Taskfile.yml for Windows PR #2064
- test: convert
test/test_sparql/test_sparql_parser.pyto pytest PR #2063 - test: convert
test/test_sparql/test_construct_bindings.pyto pytest PR #2062 - test: convert
test/test_parsers/test_nquads.pyto pytest PR #2061 - test: convert
test/test_namespace/test_namespace.pyto pytest PR #2060 - docs: add DOI for RDFLib PR #2058
- feat: add type hints for
rdflib.storeandrdflib.plugins.storesPR #2057 - Toplevel n80x PR #2046
- docs: add some additional badges PR #2045
- fix: SPARQL XML result parsing PR #2044
- chore: remove pre python 3.5 regex related workaround PR #2042
- fix: import xml.sax.handler from the right place PR #2041
- test: remove python 2.4 specific behaviour in test PR #2040
- build: remove drone config PR #2037
- docs: fix sphinx nitpicky issues PR #2036
- build: Gitpod integration and Google Cloud Shell Button PR #2034
- Infixowl cleanup iii PR #2033
- build: Taskfile improvements PR #2032
- docs: removed "Other changes" from CHANGELOG.md PR #2031
- Infixowl coverage ii PR #2024
- add chunk serializer & tests PR #1968
- Python
Published by aucampia almost 3 years ago
rdflib - RDFlib 6.2.0
This is a minor release that includes bug fixes and features.
User facing changes
This section lists changes that have a potential impact on users of RDFLib, changes with no user impact are not included in this section.
- SPARQL: Fixed handing of
HAVINGclause with variable composition. Closed issue #936 and issue #935, PR #1093. - JSON-LD parser: better support for content negotiation. Closed issue #1423, PR #1436.
- Removed the following functions that were marked as deprecated and scheduled
for removal in version 6.0.0:
Graph.load,Graph.seq,Graph.comment,Graph.label. PR #1527. - Use
functools.total_orderingto implement most comparison operations forrdflib.paths.Path. Closed issue #685, PR #1528. - Fixed error handling for invalid URIs. Closed issue #821, PR #1529.
- InfixOWL: Fixed handling of cardinality 0. Closed issue #1453 and issue #944, PR #1530.
- Added quad support to handling to
rdflib.graph.ReadOnlyGraphAggregate.quads. Closed issue #430, PR #1590 - Fixed base validation used when joining URIs. PR #1607.
- Add GEO defined namespace for GeoSPARQL. Closed issue #1371, PR #1622.
- Explicitly raise exception when
rdflib.plugins.stores.sparqlstore.SPARQLStore.updateis called. Closed issue #1032, PR #1623. - Added
rdflib.plugins.sparql.processor.prepareUpdate. Closed issue #272 and discussion #1581, PR #1624. - Added
rdflib.namespace.DefinedNamespaceMeta.__dir__. Closed issue #1593, PR #1626. - Removed
TypeCheckError,SubjectTypeError,PredicateTypeError,ObjectTypeErrorandContextTypeErroras these exceptions are not raised by RDFLib and their existence will only confuse users which may expect them to be used. Also remove correspondingcheck_context,check_subject,check_predicate,check_object,check_statement,check_patternthat is unused. PR #1640. - Improved the population of the
AcceptHTTP header so that it is correctly populated for all formats. PR #1643. - Fixed some issues with SPARQL Algebra handling/translation. PR #1645.
- Add
nquadsto recognized file extensions. PR #1653. - Fixed issues that prevented HexTuples roundtripping. PR #1656.
- Make
rdflib.plugins.sparql.operators.unregister_custom_functionidempotent. Closed issue #1492, PR #1659. - Fixed the handling of escape sequences in the N-Triples and N-Quads parsers.
These parsers will now correctly handle strings like
"\\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.- Also marked
rdflib.compat.decodeStringEscapeas 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.0
- Also marked
- Added an abstract class
IdentifiedNodeas a superclass ofBNodeandURIRef. Closed issue #1526, PR #1680. - Fixed turtle serialization of
rdf:typein subject, object. Closed issue #1649, PR #1649. - Fixed turtle serialization of PNames that contain brackets. Closed issue #1661, PR #1678.
- Added support for selecting which namespace prefixes to bind. Closed issue
#1679 and issue #1880, PR
#1686, PR
#1845 and PR
#2018.
- Also added
ConjunctiveGraph.get_graph. - Also added an
overrideargument toStore.bindwhich behaves similarly to theoverrideparameter forNamespaceManager.bind. - Also fixed handing of support of the
overrideparameter toNamespaceManager.bindby passing.
- Also added
- Eliminated a
DeprecationWarningrelated to plugin loading issue #1631, PR #1694. - Removed the
rdflib.graph.ContextNodeandrdflib.graph.DatasetQuadtype aliases. These were not being widely used in RDFLib and were also not correct. PR #1695. - Added
DefinedNamespace.as_jsonld_context. PR #1706. - Added
rdflib.namespace.WGSfor WGS84. Closed issue #1709, PR #1710. - Improved performance of
DefinedNamespaceby caching attribute values. PR #1718. - Only configure python logging if
sys.stderrhas aisattyattribute. Closed issue #1760, PR #1761. - Removed unused
rdflib.compat.etree_register_namespace. PR #1768. - Fixed numeric shortcut handling in
rdflib.util.from_n3. Closed issue #1769, PR #1771. - Add ability to detect and mark ill-typed literals. Closed issue #1757 and issue #848, PR #1773 and PR #2003.
- Optimized
NamespaceManager.compute_qnameby caching validity. PR #1779. - SPARQL: Fixed the handling of
EXISTSinsideBINDfor SPARQL. This was raising an exception during evaluation before but is now correctly handled. Closed issue #1472, PR #1794. - Propagate exceptions from SPARQL TSV result parser. Closed issue #1477, PR #1809
- Eliminate usage of
rdflib.term.RDFLibGenidas a type as this caused issues with querying. Closed issue #1808, PR #1821 - Fixed handing of
DefinedNamespacecontrol attributes so thatinspect.signatureworks correctly on defined namespaces. PR #1825. - Fixed namespace rebinding in
Memory,SimpleMemoryandBerkelyDBstores. Closed issue #1826, PR #1843. - Fixed issues with the N3 serializer. Closed issue
#1701 and issue
#1807, PR
#1858:
- The N3 serializer was incorrectly considers a subject as seralized if it is serialized in a quoted graph.
- The N3 serializer does not consider that the predicate of a triple can also be a graph.
- Added
NamespaceManager.expand_curie. Closed issue #1868, PR #1869. - Added
Literal.__sub__and support for datetimes to bothLiteral.__add__andLiteral.__sub__. PR #1870. - SPARQL: Fix
None/undefined handing inGROUP_CONCAT. Closed issue #1467, PR #1887. - SPARQL: Fixed result handling for
SERVICEdirective. Closed issue #1278, PR #1894. - Change the skolem default authority for RDFLib from
http://rdlib.net/tohttps://rdflib.github.ioand also change other uses ofhttp://rdlib.net/tohttps://rdflib.github.io. Closed issue #1824, PR #1901. - Fixes handling of non-ascii characters in IRIs. Closed issue #1429, PR #1902.
- Pass
generatetoNamespaceManager.compute_qnamefromNamespaceManager.compute_qname_strictso it raises an error in the same case as the "non-strict" version. PR #1934. - Log warnings when encountering ill-typed literals. PR #1944.
- Fixed error handling in TriX serializer. PR #1945.
- Fixed QName generation in XML serializer. PR #1951
- Remove unnecessary hex expansion for PN_LOCAL in SPARQL parser. Closed issue #1957, PR #1959.
- Changed the TriX parser to support both
trixandTriXas root element. PR #1966. - Fix SPARQL CSV result serialization of blank nodes. PR #1979.
- Added a
URIRef.fragmentproperty. PR #1991. - Remove superfluous newline from N-Triples output. Closed issue #1998, PR #1999.
- Added a bunch of type hints. The following modules have nearly complete type hints now:
rdflib.namespacerdflib.termrdflib.parser
- Python
Published by aucampia over 3 years ago
rdflib - RDFlib 6.1.1
Better testing and tidier code.
This is a semi-major release that:
- add support for Python 3.10
- updates the test suite to pytest (from nose)
- tidies up a lot of continuous integration
- gets more tests tested, not skipped
- implements lots of mypy tests
- updates several parsers and serializers
- supports the new HexTuples format!
- many bug fixes
This release contains many, many hours of updates from Iwan Aucamp, so thank you Iwan!
- Python
Published by nicholascar about 4 years ago
rdflib - RDFlib 6.0.2
Minor release to support some downstream packages' namespace needs
- Python
Published by nicholascar about 4 years ago
rdflib - RDFlib 6.0.0
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:
- inclusion of Docker files for easier CI/CD
- black config files for standardised code formatting
- improved testing with mock SPARQL stores, rather than a reliance on DBPedia etc
- Python
Published by nicholascar over 4 years ago
rdflib - RDFlib 5.0.0
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.
- Python
Published by nicholascar over 5 years ago
rdflib - RDFLib 4.2.2
This is a bug-fix release, and the last release in the 4.X.X series.
Bug fixes:
- SPARQL bugs fixed:
- Fix for filters in sub-queries #693
- Fixed bind, initBindings and filter problems #294 #555 #580 #586 #601 #615 #617 #619 #630 #653 #686 #688 #692
- Fixed unexpected None value in SPARQL-update #633 #634
- Fix sparql, group by and count of null values with
optional#631 - Fixed sparql sub-query and aggregation bugs #607 #610 #628 #694
- Fixed parsing Complex BGPs as triples #622 #623
- Fixed DISTINCT being ignored inside aggregate functions #404 #611 #678
- Fix unicode encoding errors in sparql processor #446 #599
- Fixed SPARQL select nothing no longer returning a
Nonerow #554 #592 - Fixed aggregate operators COUNT and SAMPLE to ignore unbound / NULL values #564 #563 #567 #568
- Fix sparql relative uris #523 #524
- SPARQL can now compare xsd:date type as well, fixes #532 #532 #533
- fix sparql path order on python3: "TypeError: unorderable types: SequencePath() < SequencePath()"" #492 #525
- SPARQL parser now robust to spurious semicolon #381 #528
- Let paths be comparable against all nodes even in py3 (preparedQuery error) #545 #552
- Made behavior of
initNinupdateandquerymore consistent #579 #600
- SparqlStore:
- Fixes and tests for AuditableStore #537 #557
- Trig bugs fixed:
- Fixed Nquads parser handling of triples in default graph #535 #536
- Fixed TypeError in Turtle serializer (unorderable types: DocumentFragment() > DocumentFragment()) #613 #648 #666 #676
- Fixed serialization and parsing of inf/nan #655 #658
- Fixed RDFa parser from failing on time elements with child nodes #576 #577
- Fix double reduction of \ escapes in from_n3 #546 #548
- Fixed handling of xsd:base64Binary #646 #674
- Fixed Collection.setitem broken #604 #605
- Fix ImportError when main already loaded #616
- Fixed broken top_level.txt file in distribution #571 #572 #573
Enhancements:
- Added support for Python 3.5+ #526
- More aliases for common formats (nt, turtle) #701
- Improved RDF1.1 ntriples support #695 #700
- Dependencies updated and improved compatibility with pyparsing, html5lib, SPARQLWrapper and elementtree #550 #589 #606 #641 #642 #650 #671 #675 #684 #696
- Improved prefix for SPARQL namespace in XML serialization #493 #588
- Performance improvements:
- SPARQLStore improvements
- SPARQL prepared query now carries the original (unparsed) parameters #565
- added .n3 methods for path objects #553
- Added support for xsd:gYear and xsd:gYearMonth #635 #636
- Allow duplicates in rdf:List #223 #690
- Improved slicing of Resource objects #529
Cleanups:
- cleanup: SPARQL Prologue and Query new style classes #566
- Reduce amount of warnings, especially closing opened file pointers #518 #651
- Improved ntriples parsing exceptions to actually tell you what's wrong #640 #643
- remove ancient and broken 2.3 support code. #680 #681
- Logger output improved #662
- properly cite RGDA1 #624
- Avoid class reference to imported function #574 #578
- Use find_packages for package discovery. #590
- Prepared ClosedNamespace (and _RDFNamespace) to inherit from Namespace (5.0.0) #551 #595
- Avoid verbose build logging #534
- (ultra petty) Remove an unused import #593
Testing improvements:
- updating deprecated testing syntax #697
- make test 375 more portable (use sys.executable rather than python) #664 #668
- Removed outdated, skipped test for #130 that depended on content from the internet #256
- enable all warnings during travis nosetests #517
- travis updates #659
- travis also builds release branches #598
Doc improvements:
- Update list of builtin serialisers in docstring #621
- Update reference to "Emulating container types" #575 #581 #583 #584
- docs: clarify the use of an identifier when persisting a triplestore #654
- DOC: unamed -> unnamed, typos #562
- Python
Published by joernhees almost 9 years ago
rdflib - RDFLib 4.2.1
This is a bug-fix release.
Minor enhancements:
- Added a Networkx connector #471, #507
- Added a graph_tool connector #473
- Added a
graphsmethod to the Dataset object #504, #495 - Batch commits for
SPARQLUpdateStore#486
Bug fixes:
- Fixed bnode collision bug #506, #496, #494
- fix
util.from_n3()parsing Literals with datatypes and Namespace support #503, #502 - make
Identifier.__hash__stable wrt. multi processes #501, #500 - fix handling
URLInputSourcewithout content-type #499, #498 - no relative import in
algebrawhen run as a script #497 - Duplicate option in armstrong
theme.confremoved #491 Variable.__repr__returns a python representation string, not n3 #488- fixed broken example #482
- trig output fixes #480
- set PYTHONPATH to make rdfpipe tests use the right rdflib version #477
- fix RDF/XML problem with unqualified use of
rdf:about#470, #468 AuditableStoreimprovements #469, #463- added asserts for
graph.set([s,p,o])sosandparen'tNone#467 threading.RLockinstances are context managers #465- SPARQLStore does not transform Literal('') into Literal('None') anymore #459, #457
- slight performance increase for graph.all_nodes() #458
Testing improvements:
- travis: migrate to docker container infrastructure #508
- test for narrow python builds (chars > 0xFFFF) (related to #453, #454 ) #456, #509
- dropped testing py3.2 #448
- Running a local fuseki server on travis and making it failsafe #476, #475, #474, #466, #460
- exclude
def main():functions from test coverage analysis #472
- Python
Published by joernhees over 10 years ago
rdflib - RDFLib 4.2.0
This is a new minor version of RDFLib including a handful of new features:
- Supporting N-Triples 1.1 syntax using UTF-8 encoding
#447,
#449,
#400
- Graph comparison now really works using RGDA1 (RDF Graph Digest Algorithm 1)
#441
#385
- More graceful degradation than simple crashing for unicode chars > 0xFFFF on
narrow python builds. Parsing such characters will now work, but issue a
UnicodeWarning. If you run python -W all you will already see a warning on
import rdflib will show a warning (ImportWarning).
#453,
#454
- URLInputSource now supports json-ld
#425
- SPARQLStore is now graph aware
#401,
#402
- SPARQLStore now uses SPARQLWrapper for updates
#397
- Certain logging output is immediately shown in interactive mode
#414
- Python 3.4 fully supported
#418
Minor enhancements & bugs fixed:
- Fixed double invocation of 2to3 #437
- PyRDFa parser missing brackets #434
- Correctly handle \uXXXX and \UXXXXXXXX escapes in n3 files #426
- Logging cleanups and keeping it on stderr #420 #414 #413
- n3: allow @base URI to have a trailing '#' #407 #379
- microdata: add file:// to base if it's a filename so rdflib can parse its own output #406 #403
- TSV Results parse skips empty bindings in result #390
- fixed accidental test run due to name #389
- Bad boolean list serialization to Turtle & fixed ambiguity between Literal(False) and None #387 #382
- Current version number & PyPI link in README.md #383
- Python
Published by joernhees almost 11 years ago