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.
- Closes #2151.
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.
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.
- Closes #2138.
fix: add the wgs
namespace binding back (#2294)
#1686 inadvertently removed the wgs
prefix.
This change adds it back.
- Closes #2196.
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.
- Closes #2120.
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.
- Closes #2303.
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.
- Closes #2072.
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.
- Closes #2103.
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
.
- Closes #2293.
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 #2196 for more info.