summaryrefslogtreecommitdiff
path: root/rdflib/plugins/shared/jsonld/util.py
Commit message (Collapse)AuthorAgeFilesLines
* feat: add parser type hints (#2232)Iwan Aucamp2023-03-051-8/+29
| | | | | | | | | | | | | 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.
* [pre-commit.ci] auto fixes from pre-commit.com hookspre-commit-ci[bot]2022-04-151-6/+4
| | | | for more information, see https://pre-commit.ci
* [pre-commit.ci] auto fixes from pre-commit.com hookspre-commit-ci[bot]2022-03-161-1/+6
| | | | for more information, see https://pre-commit.ci
* deduplicate importNicholas Car2022-01-041-3/+1
|
* Merge branch 'master' into jsonld_connegNicholas Car2022-01-031-1/+1
|\
| * Black rdflib except for rdflib/namespace/_GEO.pyIwan Aucamp2022-01-021-1/+1
| | | | | | | | | | | | 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.
* | Merge remote-tracking branch 'origin/master' into jsonld_connegIwan Aucamp2021-12-281-3/+13
|\ \ | |/
| * style fixes onlynicholascar2021-12-161-0/+1
| |
| * per pro G Klyne, cleanup and additional testGraham Higgins2021-12-061-4/+2
| |
| * fix for issue 1484 raised and solved by Graham Klyne:Graham Higgins2021-12-031-3/+12
| | | | | | | | Error reading JSON-LD from text IO stream
* | Merge branch 'master' into jsonld_connegNicholas Car2021-12-011-4/+7
|\ \ | |/
| * Merge pull request #1463 from joshmoore/python-graphNicholas Car2021-12-011-1/+5
| |\ | | | | | | RFC: Add PythonInputSource to create py-based graphs
| | * Merge remote-tracking branch 'origin/master' into python-graphjmoore2021-11-261-0/+2
| | |\
| | * | Remove debugging printjmoore2021-11-161-4/+1
| | | |
| | * | RFC: Add PythonInputSource to create py-based graphsjmoore2021-11-151-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | Make the test pass on windowsIwan Aucamp2021-11-241-2/+2
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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).
* | | Merge branch 'master' into jsonld_connegNicholas Car2021-11-211-0/+2
|\ \ \ | |/ /
| * | Fix JSON-LD data import adds trailing slashes to IRIs (#1443)Martin van der Werff2021-10-281-0/+2
| |/ | | | | | | In norm_url leave url alone if it already contains a scheme/protocol.
* | Allow URLInputSource to get content-negotiation links from the Link headers ↵Ashley Sommer2021-10-121-8/+15
|/ | | | | | 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!)
* Fix mypy type errors and add mypy to .drone.ymlIwan Aucamp2021-09-101-4/+8
| | | | | | | | | | | | | | | | | | | | | 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.
* integrate jsonld code into rdflib coreAshley Sommer2021-07-071-0/+81