Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

aucampia/20230706T0034 refresh literal tests #98

Open
wants to merge 113 commits into
base: main
Choose a base branch
from

Conversation

aucampia
Copy link
Owner

@aucampia aucampia commented Jul 6, 2023

dependabot bot and others added 30 commits March 13, 2023 17:14
…espace_creator (RDFLib#2254)

FIxed a bug in defined_namespace_creator so that when a resource in an ontology is commented on multiple times (with e.g. rdfs:comment), it creates only a single class variable in the resulting DefinedNamespace where the Python comment is the concatenation of the rdfs:comments.
docs: document available security measures

Several security measures can be used to mitigate risk when processing
potentially malicious input.

This change adds documentation about available security measures and
examples and tests that illustrate their usage.
Update the changelog and other parts to prepare for the 6.3.0 release.

This will be tagged to 6.3.0.
Bump version of RDFLib and update docker `requirements.{in,txt}`.
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.
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.
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.
Update everything to reflect release version 6.3.1.
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.
build(deps-dev): bump mypy from 1.0.1 to 1.1.1

Bumps [mypy](https://github.com/python/mypy) from 1.0.1 to 1.1.1.
- [Release notes](https://github.com/python/mypy/releases)
- [Commits](python/mypy@v1.0.1...v1.1.1)

updated-dependencies:
- dependency-name: mypy
  dependency-type: direct:development
  update-type: version-update:semver-minor

Also added type ignores for newly detected type errors.

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Iwan Aucamp <aucampia@gmail.com>
Changed `cdterms` to `dcterms`, see <RDFLib#2196> for more info.
…Lib#2296)

Bumps [types-setuptools](https://github.com/python/typeshed) from 67.6.0.4 to 67.6.0.5.
- [Release notes](https://github.com/python/typeshed/releases)
- [Commits](https://github.com/python/typeshed/commits)

---
updated-dependencies:
- dependency-name: types-setuptools
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps library/python from `d0e8398` to `1d2b710`.

---
updated-dependencies:
- dependency-name: library/python
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps library/python from `d0e8398` to `1d2b710`.

---
updated-dependencies:
- dependency-name: library/python
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…n python >=3.8 (RDFLib#2288)

The main aim of this change is to get to a newer version of Sphinx.

However, if just Sphinx is upgraded, poetry can't do version solving because of
the version of `importlib-metadata` that flake8 needs:

```console
$ poetry install
Updating dependencies
Resolving dependencies... (0.6s)

Because no versions of flakeheaven match >3.2.1,<4.0.0
 and flakeheaven (3.2.1) depends on flake8 (>=4.0.1,<5.0.0), flakeheaven (>=3.2.1,<4.0.0) requires flake8 (>=4.0.1,<5.0.0).
And because no versions of flake8 match >4.0.1,<5.0.0
 and flake8 (4.0.1) depends on importlib-metadata (<4.3), flakeheaven (>=3.2.1,<4.0.0) requires importlib-metadata (<4.3).
And because sphinx (5.3.0) depends on importlib-metadata (>=4.8)
 and no versions of sphinx match >5.3.0,<6.0.0, flakeheaven (>=3.2.1,<4.0.0) is incompatible with sphinx (>=5.3.0,<6.0.0).
So, because rdflib depends on both sphinx (^5.3.0) and flakeheaven (^3.2.1), version solving failed.
```

To make things work, flake8 and related is only installed for Python >=3.8,
where the built-in `importlib.metadata` is used instead of the
`importlib-metadata` package.

This means no more flake8 on python 3.7, but it is a reasonable trade-off to get
to a newer version of Sphinx, and Python 3.7 support will be dropped by
2023-06-27 anyway.

Other changes:
- Changed Read the Docs to use the Sphinx version from poetry instead of the
  custom version that was in `devtools/requirements-rtd.txt`.
- Added `typing-extensions` to the poetry `docs` dependency group as it is
  needed for docs to build correctly.
- Changed the tox `docs` environment to be closer to the Read the Docs
  environment.

Closes <RDFLib#2272>.
…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 <RDFLib#2281>.
- Closes <RDFLib#2242>.
<RDFLib#1686> inadvertently removed the `wgs` prefix.
This change adds it back.

- Closes <RDFLib#2196>.
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 <RDFLib#2293>.
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](https://datatracker.ietf.org/doc/html/rfc3986).

The new behavior is heavily inspired by
[`werkzeug.urls.iri_to_uri`](https://github.com/pallets/werkzeug/blob/92c6380248c7272ee668e1f8bbd80447027ccce2/src/werkzeug/urls.py#L926-L931)
though there are some differences.

- Closes <RDFLib#2120>.
This ensures contributors are credited. Also added .mailmap to fix early misattributed contributions.
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 <RDFLib#2303>.
SPARQL DESCRIBE was implemented in
<RDFLib#2221> so there should be no `xfail`
on it tests for it. This change removes one such `xfail` that was in place.
…FLib#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`.
`Context.to_dict` is used in JSON-LD serialization, but it was not implemented.
This change adds the method.

- Closes <RDFLib#2138>.

---------

Co-authored-by: Marc-Antoine Parent <maparent@acm.org>
…ib#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 <RDFLib#2072>.
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 <RDFLib#2103>.
…#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 <RDFLib#2151>.
dependabot bot and others added 29 commits June 2, 2023 20:57
Bumps library/python from `551c952` to `eaee5f7`.

---
updated-dependencies:
- dependency-name: library/python
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Test that the base directive and blank prefixes are handled correctly.
)

Bumps [typing-extensions](https://github.com/python/typing_extensions) from 4.6.2 to 4.6.3.
- [Changelog](https://github.com/python/typing_extensions/blob/main/CHANGELOG.md)
- [Commits](python/typing_extensions@4.6.2...4.6.3)

---
updated-dependencies:
- dependency-name: typing-extensions
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.2.6 to 7.2.7.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](nedbat/coveragepy@7.2.6...7.2.7)

---
updated-dependencies:
- dependency-name: coverage
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [poetry](https://github.com/python-poetry/poetry) from 1.5.0 to 1.5.1.
- [Release notes](https://github.com/python-poetry/poetry/releases)
- [Changelog](https://github.com/python-poetry/poetry/blob/master/CHANGELOG.md)
- [Commits](python-poetry/poetry@1.5.0...1.5.1)

---
updated-dependencies:
- dependency-name: poetry
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ph. (RDFLib#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 RDFLib#2404
- Fixes RDFLib#2375
- Fixes RDFLib#436
- Fixes RDFLib#1804
Bumps library/python from 3.11.3-slim to 3.11.4-slim.

---
updated-dependencies:
- dependency-name: library/python
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps library/python from 3.11.3-slim to 3.11.4-slim.

---
updated-dependencies:
- dependency-name: library/python
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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.
Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.3.1 to 7.3.2.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](pytest-dev/pytest@7.3.1...7.3.2)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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.
Change SPARQL count aggregate to ignore optional that are unbound
instead of raising an exception when they are encountered.

Co-authored-by: WhiteGobo <richardfechner@posteo.net>
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.
Bumps library/python from `1966141` to `53a67c0`.

---
updated-dependencies:
- dependency-name: library/python
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps library/python from `1966141` to `53a67c0`.

---
updated-dependencies:
- dependency-name: library/python
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [pyparsing](https://github.com/pyparsing/pyparsing) from 3.0.9 to 3.1.0.
- [Release notes](https://github.com/pyparsing/pyparsing/releases)
- [Changelog](https://github.com/pyparsing/pyparsing/blob/master/CHANGES)
- [Commits](pyparsing/pyparsing@pyparsing_3.0.9...3.1.0)

---
updated-dependencies:
- dependency-name: pyparsing
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [isort](https://github.com/pycqa/isort) from 5.11.5 to 5.12.0.
- [Release notes](https://github.com/pycqa/isort/releases)
- [Changelog](https://github.com/PyCQA/isort/blob/main/CHANGELOG.md)
- [Commits](PyCQA/isort@5.11.5...5.12.0)

---
updated-dependencies:
- dependency-name: isort
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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`.
Bumps [mypy](https://github.com/python/mypy) from 1.3.0 to 1.4.1.
- [Commits](python/mypy@v1.3.0...v1.4.1)

---
updated-dependencies:
- dependency-name: mypy
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…Lib#2463)

Bumps [types-setuptools](https://github.com/python/typeshed) from 67.8.0.0 to 68.0.0.0.
- [Commits](https://github.com/python/typeshed/commits)

---
updated-dependencies:
- dependency-name: types-setuptools
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.3.2 to 7.4.0.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](pytest-dev/pytest@7.3.2...7.4.0)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
)

Bumps [typing-extensions](https://github.com/python/typing_extensions) from 4.6.3 to 4.7.1.
- [Release notes](https://github.com/python/typing_extensions/releases)
- [Changelog](https://github.com/python/typing_extensions/blob/main/CHANGELOG.md)
- [Commits](python/typing_extensions@4.6.3...4.7.1)

---
updated-dependencies:
- dependency-name: typing-extensions
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [setuptools](https://github.com/pypa/setuptools) from 67.8.0 to 68.0.0.
- [Release notes](https://github.com/pypa/setuptools/releases)
- [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst)
- [Commits](pypa/setuptools@v67.8.0...v68.0.0)

---
updated-dependencies:
- dependency-name: setuptools
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 5.3.0 to 6.2.1.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/master/CHANGES)
- [Commits](sphinx-doc/sphinx@v5.3.0...v6.2.1)

---
updated-dependencies:
- dependency-name: sphinx
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
build(deps-dev): bump sphinx from 5.3.0 to 6.2.1
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.

---------

Co-authored-by: WhiteGobo <richardfechner@posteo.net>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Iwan Aucamp <aucampia@gmail.com>
Skip the following tests that rely on SPARQL 1.0 grammar
and are incompatible with the SPARQL 1.1 grammar:

- <http://www.w3.org/2001/sw/DataAccess/tests/data-r2/basic/manifest#term-6>
- <http://www.w3.org/2001/sw/DataAccess/tests/data-r2/basic/manifest#term-7>

---------

Co-authored-by: WhiteGobo <richardfechner@posteo.net>
Co-authored-by: Iwan Aucamp <aucampia@gmail.com>
The RDF 1.1 TriG grammar only allows the `GRAPH` keyword if it
is followed by a graph identifier
[[ref](https://www.w3.org/TR/trig/#grammar-production-block)].

This change enforces this rule so that the
<http://www.w3.org/2013/TriGTests/#trig-graph-bad-01> test passes.

---------

Co-authored-by: WhiteGobo <richardfechner@posteo.net>
Co-authored-by: Iwan Aucamp <aucampia@gmail.com>
This change moves tests out of classes and into top-level functions, and
merges some test functions that were testing the same thing.
@aucampia aucampia force-pushed the aucampia/20230706T0034-refresh-literal-tests branch from 08e4524 to 8db4fb0 Compare July 6, 2023 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet