| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
This change removes the redundant inheritance from `object` (i.e. `class
Foo(object): pass`) that is no longer needed in Python 3 and is a relic from
Python 2.
|
|
|
|
|
|
|
|
|
|
| |
`Context.to_dict` is used in JSON-LD serialization, but it was not implemented.
This change adds the method.
- Closes <https://github.com/RDFLib/rdflib/issues/2138>.
---------
Co-authored-by: Marc-Antoine Parent <maparent@acm.org>
|
|
|
|
|
|
|
|
|
|
| |
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 <https://github.com/RDFLib/rdflib/issues/2303>.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add type hints to:
- `rdflib/parser.py`
- `rdflib/plugins/parser/*.py`
- some JSON-LD utils
- `rdflib/exceptions.py`.
This is mainly because the work I'm doing to fix
<https://github.com/RDFLib/rdflib/issues/1844> is touching some of
this parser stuff and the type hints are useful to avoid mistakes.
No runtime changes are included in this PR.
|
|
|
| |
The the base URI passed to _prep_sources was being overwritten in anticipation of processing inner nestings, but this caused problems when processing multiple inputs. Changed the assignment to `base` to `new_base`.
|
|
|
|
| |
for more information, see https://pre-commit.ci
|
|
|
|
| |
for more information, see https://pre-commit.ci
|
|\ |
|
| |
| |
| |
| | |
This seems to be related to changes in typeshed and mypy.
|
| | |
|
|\ \
| |/ |
|
| |\
| | |
| | | |
Add some type annotations to JSON-LD code
|
| | |
| | |
| | |
| | | |
This patch contains no runtime changes.
|
| |/
| |
| |
| |
| |
| | |
Probably we should ingore generated namespaces in black or format them
on generation, or mark them for ignoring by formatter. Will look at that
later.
|
|\ \
| |/ |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
Error reading JSON-LD from text IO stream
|
|\ \
| |/ |
|
| |\
| | |
| | | |
RFC: Add PythonInputSource to create py-based graphs
|
| | |\ |
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
In order to manipulate a JSON-LD structure before creating
a graph (specifically to simplify rdf:Seq handling), it is
currently necessary to use `json.loads` followed by `dumps`
and then let `Graph().parse()` re-load. By detecting `dict`
instances and creating a `PythonInputSource`, a single call
to `loads` suffices.
|
| | |/
| |/|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
In rdflib:
- Fix rdflib.plugins.shared.jsonld.util.norm_url on Windows
On windows normpath and sep is not appropriate for URLs, use posixpath
so that the behaviour is consistent.
- Fix handling of file URIs in Graph.serialize on windows
Should use url2pathname(path) to get a path from the path segment of
URLs
In tests:
- Fix handling of file created by mkstemp
Should first call os.close on the OS-level handle before removing the
file.
- Fix how file URIs are created so they work properly on windows.
- Skip tests which are sensitive to unicode normalization and carriage
return as these do not pass on windows (about 5 tests).
|
|\ \ \
| |/ / |
|
| |/
| |
| |
| | |
In norm_url leave url alone if it already contains a scheme/protocol.
|
|/
|
|
|
|
| |
of HTTP responses. Use Links to resolve schema.org-style json-ld conneg redirections.
Fix the ability to run the `remote-url` arm of the JSON-LD test suite (got most of them working!)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes #1311
Add `mypy` to .drone.yml and fix type errors that come up.
Not type checking examples or tests.
Other changes:
- fix return value for `Graph.serialize` (refs #1394)
- remove default value for
`rdflib.plugins.sparql.algebra.translateAlgebra` (refs #1322)
- add .dockerignore to reduce context size and make docker quicker
to run.
- add .flake8 config to ignore line length as black is managing
formatting.
- add mypy to docker-compose, makefile and tox.ini
- fix the way csv2rdf is invoked to ensure that the right code gets
executed.
|
| |
|
|
|
|
|
| |
Also add type annotations to rdflib.compare to make it easier
to understand the code.
|
| |
|
|
|