diff options
author | Nicholas Car <nicholas.car@surroundaustralia.com> | 2021-07-20 23:05:49 +1000 |
---|---|---|
committer | Nicholas Car <nicholas.car@surroundaustralia.com> | 2021-07-20 23:05:49 +1000 |
commit | 7ebfd306543d8cc0a8b48700870e6fba3d7d256d (patch) | |
tree | e1d18e8398db1ed09f8db7d5de46c46f462c5893 | |
parent | 57470c5bc37a91ca64ae28b564df7b54be4bd8fa (diff) | |
download | rdflib-7ebfd306543d8cc0a8b48700870e6fba3d7d256d.tar.gz |
admin scripts & release 6.0.0 bump
-rw-r--r-- | CHANGELOG.md | 265 | ||||
-rw-r--r-- | CONTRIBUTORS | 18 | ||||
-rw-r--r-- | LICENSE | 4 | ||||
-rw-r--r-- | README.md | 55 | ||||
-rw-r--r-- | admin/README.md | 4 | ||||
-rw-r--r-- | admin/get_merged_prs.py | 27 | ||||
-rw-r--r-- | admin/print_prs.py | 10 | ||||
-rw-r--r-- | rdflib/__init__.py | 4 | ||||
-rw-r--r-- | rdflib/plugins/sparql/algebra.py | 2 | ||||
-rw-r--r-- | rdflib/plugins/sparql/operators.py | 18 | ||||
-rw-r--r-- | rdflib/plugins/stores/sparqlstore.py | 34 |
11 files changed, 387 insertions, 54 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 678db1a4..efa91858 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,268 @@ +2021/07/20 RELEASE 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 + +_**All PRs merged since 5.0.0:**_ + +* Fixes 1190 - pin major version of pyparsing + [PR #1366](https://github.com/RDFLib/rdflib/pull/1366) +* Add __init__ for shared jsonld module + [PR #1365](https://github.com/RDFLib/rdflib/pull/1365) +* Update README with chat info + [PR #1363](https://github.com/RDFLib/rdflib/pull/1363) +* add xsd dayTimeDuration and yearMonthDuration + [PR #1364](https://github.com/RDFLib/rdflib/pull/1364) +* Updated film.py + [PR #1359](https://github.com/RDFLib/rdflib/pull/1359) +* Migration from ClosedNamespace to DeclaredNamespace + [PR #1074](https://github.com/RDFLib/rdflib/pull/1074) +* Add @expectedFailure unit tests for #1294 and type annotations for compare.py + [PR #1346](https://github.com/RDFLib/rdflib/pull/1346) +* JSON-LD Integration + [PR #1354](https://github.com/RDFLib/rdflib/pull/1354) +* ENH: Make ClosedNamespace extend Namespace + [PR #1213](https://github.com/RDFLib/rdflib/pull/1213) +* Add unit test for #919 and more type hints for sparqlconnector and sparqlstore + [PR #1348](https://github.com/RDFLib/rdflib/pull/1348) +* fix #876 Updated term.py to add xsd:normalizedString and xsd:token support for Literals + [PR #1102](https://github.com/RDFLib/rdflib/pull/1102) +* Dev stack update + [PR #1355](https://github.com/RDFLib/rdflib/pull/1355) +* Add make coverage instructions to README + [PR #1353](https://github.com/RDFLib/rdflib/pull/1353) +* Improve running tests locally + [PR #1352](https://github.com/RDFLib/rdflib/pull/1352) +* support day, month and year function for date + [PR #1154](https://github.com/RDFLib/rdflib/pull/1154) +* Prevent `from_n3` from unescaping `\xhh` + [PR #1343](https://github.com/RDFLib/rdflib/pull/1343) +* Complete clean up of docs for 6.0.0 + [PR #1296](https://github.com/RDFLib/rdflib/pull/1296) +* pathname2url removal + [PR #1288](https://github.com/RDFLib/rdflib/pull/1288) +* Replace Sleepycat with BerkeleyDB + [PR #1347](https://github.com/RDFLib/rdflib/pull/1347) +* Replace use of DBPedia with the new SimpleHTTPMock + [PR #1345](https://github.com/RDFLib/rdflib/pull/1345) +* Update graph operator overloading for subclasses + [PR #1349](https://github.com/RDFLib/rdflib/pull/1349) +* Speedup Literal.__hash__ and Literal.__eq__ by accessing directly _da… + [PR #1321](https://github.com/RDFLib/rdflib/pull/1321) +* Implemented function translateAlgebra. This functions takes a SPARQL … + [PR #1322](https://github.com/RDFLib/rdflib/pull/1322) +* attempt at adding coveralls support to drone runs + [PR #1337](https://github.com/RDFLib/rdflib/pull/1337) +* Fix SPARQL update parsing to handle arbitrary amounts of triples in inserts + [PR #1340](https://github.com/RDFLib/rdflib/pull/1340) +* Add pathlib.PurePath support for Graph.serialize and Graph.parse + [PR #1309](https://github.com/RDFLib/rdflib/pull/1309) +* dataset examples file + [PR #1289](https://github.com/RDFLib/rdflib/pull/1289) +* Add handling for 308 (Permanent Redirect) + [PR #1342](https://github.com/RDFLib/rdflib/pull/1342) +* Speedup of __add_triple_context + [PR #1320](https://github.com/RDFLib/rdflib/pull/1320) +* Fix prov ns + [PR #1318](https://github.com/RDFLib/rdflib/pull/1318) +* Speedup __ctx_to_str. + [PR #1319](https://github.com/RDFLib/rdflib/pull/1319) +* Speedup decodeUnicodeEscape by avoiding useless string replace. + [PR #1324](https://github.com/RDFLib/rdflib/pull/1324) +* Fix errors reported by mypy + [PR #1330](https://github.com/RDFLib/rdflib/pull/1330) +* Require setuptools, rdflib/plugins/sparql/__init__.py and rdflib/plugin.py import pkg_resources + [PR #1339](https://github.com/RDFLib/rdflib/pull/1339) +* Fix tox config + [PR #1313](https://github.com/RDFLib/rdflib/pull/1313) +* Fix formatting of xsd:decimal + [PR #1335](https://github.com/RDFLib/rdflib/pull/1335) +* Add tests for issue #1299 + [PR #1328](https://github.com/RDFLib/rdflib/pull/1328) +* Add special handling for gYear and gYearMonth + [PR #1315](https://github.com/RDFLib/rdflib/pull/1315) +* Replace incomplete example in intro_to_sparql.rst + [PR #1331](https://github.com/RDFLib/rdflib/pull/1331) +* Added unit test for issue #977. + [PR #1112](https://github.com/RDFLib/rdflib/pull/1112) +* Don't sort variables in TXTResultSerializer + [PR #1310](https://github.com/RDFLib/rdflib/pull/1310) +* handle encoding of base64Binary Literals + [PR #1258](https://github.com/RDFLib/rdflib/pull/1258) +* Add tests for Graph.transitive_{subjects,objects} + [PR #1307](https://github.com/RDFLib/rdflib/pull/1307) +* Changed to support passing fully qualified queries through the graph … + [PR #1253](https://github.com/RDFLib/rdflib/pull/1253) +* Upgrade to GitHub-native Dependabot + [PR #1298](https://github.com/RDFLib/rdflib/pull/1298) +* Fix transitive_objects/subjects docstrings and signatures + [PR #1305](https://github.com/RDFLib/rdflib/pull/1305) +* Fix typo in ClosedNamespace doc string + [PR #1293](https://github.com/RDFLib/rdflib/pull/1293) +* Allow parentheses in uri + [PR #1280](https://github.com/RDFLib/rdflib/pull/1280) +* Add notes about how to install from git + [PR #1286](https://github.com/RDFLib/rdflib/pull/1286) +* Feature/forward version to 6.0.0-alpha + [PR #1285](https://github.com/RDFLib/rdflib/pull/1285) +* speedup notation3/turtle parser + [PR #1272](https://github.com/RDFLib/rdflib/pull/1272) +* Correct behaviour of compute_qname for URNs + [PR #1274](https://github.com/RDFLib/rdflib/pull/1274) +* Speedup __add_triple_context. + [PR #1271](https://github.com/RDFLib/rdflib/pull/1271) +* Feature/coverage configuration + [PR #1267](https://github.com/RDFLib/rdflib/pull/1267) +* optimize sparql.Bindings + [PR #1192](https://github.com/RDFLib/rdflib/pull/1192) +* issue_771_add_key_error_if_spaces + [PR #1070](https://github.com/RDFLib/rdflib/pull/1070) +* Typo fix + [PR #1254](https://github.com/RDFLib/rdflib/pull/1254) +* Adding Namespace.__contains__() + [PR #1237](https://github.com/RDFLib/rdflib/pull/1237) +* Add a Drone config file. + [PR #1247](https://github.com/RDFLib/rdflib/pull/1247) +* Add sentence on names not valid as Python IDs. + [PR #1234](https://github.com/RDFLib/rdflib/pull/1234) +* Add trig mimetype + [PR #1238](https://github.com/RDFLib/rdflib/pull/1238) +* Move flake8 config + [PR #1239](https://github.com/RDFLib/rdflib/pull/1239) +* Update SPARQL tests since the DBpedia was updated + [PR #1240](https://github.com/RDFLib/rdflib/pull/1240) +* fix foaf ClosedNamespace + [PR #1220](https://github.com/RDFLib/rdflib/pull/1220) +* add GeoSPARQL ClosedNamespace + [PR #1221](https://github.com/RDFLib/rdflib/pull/1221) +* docs: fix simple typo, yeild -> yield + [PR #1223](https://github.com/RDFLib/rdflib/pull/1223) +* do not use current time in sparql TIMEZONE + [PR #1193](https://github.com/RDFLib/rdflib/pull/1193) +* Reset graph on exit from context + [PR #1206](https://github.com/RDFLib/rdflib/pull/1206) +* Fix usage of default-graph for POST and introduce POST_FORM + [PR #1185](https://github.com/RDFLib/rdflib/pull/1185) +* Changes to graph.serialize() + [PR #1183](https://github.com/RDFLib/rdflib/pull/1183) +* rd2dot Escape HTML in node label and URI text + [PR #1209](https://github.com/RDFLib/rdflib/pull/1209) +* tests: retry on network error (CI) + [PR #1203](https://github.com/RDFLib/rdflib/pull/1203) +* Add documentation and type hints for rdflib.query.Result and rdflib.graph.Graph + [PR #1211](https://github.com/RDFLib/rdflib/pull/1211) +* fix typo + [PR #1218](https://github.com/RDFLib/rdflib/pull/1218) +* Add architecture ppc64le to travis build + [PR #1212](https://github.com/RDFLib/rdflib/pull/1212) +* small cleanups + [PR #1191](https://github.com/RDFLib/rdflib/pull/1191) +* Remove the usage of assert in the SPARQLConnector + [PR #1186](https://github.com/RDFLib/rdflib/pull/1186) +* Remove requests + [PR #1175](https://github.com/RDFLib/rdflib/pull/1175) +* Support parsing paths specified with pathlib + [PR #1180](https://github.com/RDFLib/rdflib/pull/1180) +* URI Validation Performance Improvements + [PR #1177](https://github.com/RDFLib/rdflib/pull/1177) +* Fix serialize with multiple disks on windows + [PR #1172](https://github.com/RDFLib/rdflib/pull/1172) +* Fix for issue #629 - Arithmetic Operations of DateTime in SPARQL + [PR #1061](https://github.com/RDFLib/rdflib/pull/1061) +* Fixes #1043. + [PR #1054](https://github.com/RDFLib/rdflib/pull/1054) +* N3 parser: do not create formulas if the Turtle mode is activated + [PR #1142](https://github.com/RDFLib/rdflib/pull/1142) +* Move to using graph.parse() rather than deprecated graph.load() + [PR #1167](https://github.com/RDFLib/rdflib/pull/1167) +* Small improvement to serialize docs + [PR #1162](https://github.com/RDFLib/rdflib/pull/1162) +* Issue 1160 missing url fragment + [PR #1163](https://github.com/RDFLib/rdflib/pull/1163) +* remove import side-effects + [PR #1156](https://github.com/RDFLib/rdflib/pull/1156) +* Docs update + [PR #1161](https://github.com/RDFLib/rdflib/pull/1161) +* replace cgi by html, fixes issue #1110 + [PR #1152](https://github.com/RDFLib/rdflib/pull/1152) +* Deprecate some more Graph API surface + [PR #1151](https://github.com/RDFLib/rdflib/pull/1151) +* Add deprecation warning on graph.load() + [PR #1150](https://github.com/RDFLib/rdflib/pull/1150) +* Remove all remnants of Python2 compatibility + [PR #1149](https://github.com/RDFLib/rdflib/pull/1149) +* make csv2rdf work in py3 + [PR #1117](https://github.com/RDFLib/rdflib/pull/1117) +* Add a __dir__ attribute to a closed namespace + [PR #1134](https://github.com/RDFLib/rdflib/pull/1134) +* improved Graph().parse() + [PR #1140](https://github.com/RDFLib/rdflib/pull/1140) +* Discussion around new dict-based store implementation + [PR #1133](https://github.com/RDFLib/rdflib/pull/1133) +* fix 913 + [PR #1139](https://github.com/RDFLib/rdflib/pull/1139) +* Make parsers CharacterStream aware + [PR #1145](https://github.com/RDFLib/rdflib/pull/1145) +* More Black formatting changes + [PR #1146](https://github.com/RDFLib/rdflib/pull/1146) +* Fix comment + [PR #1130](https://github.com/RDFLib/rdflib/pull/1130) +* Updating namespace.py to solve issue #801 + [PR #1044](https://github.com/RDFLib/rdflib/pull/1044) +* Fix namespaces for SOSA and SSN. Fix #1126. + [PR #1128](https://github.com/RDFLib/rdflib/pull/1128) +* Create pull request template + [PR #1114](https://github.com/RDFLib/rdflib/pull/1114) +* BNode context dicts for NT and N-Quads parsers + [PR #1108](https://github.com/RDFLib/rdflib/pull/1108) +* Allow distinct blank node contexts from one NTriples parser to the next (#980) + [PR #1107](https://github.com/RDFLib/rdflib/pull/1107) +* Autodetect parse() format + [PR #1046](https://github.com/RDFLib/rdflib/pull/1046) +* fix #910: Updated evaluate.py so that union includes results of both branches, even when identical. + [PR #1057](https://github.com/RDFLib/rdflib/pull/1057) +* Removal of six & styling + [PR #1051](https://github.com/RDFLib/rdflib/pull/1051) +* Add SERVICE clause to documentation + [PR #1041](https://github.com/RDFLib/rdflib/pull/1041) +* add test with ubuntu 20.04 + [PR #1038](https://github.com/RDFLib/rdflib/pull/1038) +* Improved logo + [PR #1037](https://github.com/RDFLib/rdflib/pull/1037) +* Add requests to the tests_requirements + [PR #1036](https://github.com/RDFLib/rdflib/pull/1036) +* Set update endpoint similar to query endpoint for sparqlstore if only one is given + [PR #1033](https://github.com/RDFLib/rdflib/pull/1033) +* fix shebang typo + [PR #1034](https://github.com/RDFLib/rdflib/pull/1034) +* Add the content type 'application/sparql-update' when preparing a SPARQL update request + [PR #1022](https://github.com/RDFLib/rdflib/pull/1022) +* Fix typo in README.md + [PR #1030](https://github.com/RDFLib/rdflib/pull/1030) +* add Python 3.8 + [PR #1023](https://github.com/RDFLib/rdflib/pull/1023) +* Fix n3 parser exponent syntax of floats with leading dot. + [PR #1012](https://github.com/RDFLib/rdflib/pull/1012) +* DOC: Use sphinxcontrib-apidoc and various cleanups + [PR #1010](https://github.com/RDFLib/rdflib/pull/1010) +* FIX: Change is comparison to == for tuple + [PR #1009](https://github.com/RDFLib/rdflib/pull/1009) +* Update copyright year in docs conf.py + [PR #1006](https://github.com/RDFLib/rdflib/pull/1006) + + 2020/04/18 RELEASE 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- diff --git a/CONTRIBUTORS b/CONTRIBUTORS index d24f564c..8dc2dff3 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -1,33 +1,51 @@ +# See https://github.com/RDFLib/rdflib/graphs/contributors + Aaron Swartz Andrew Eland Andrew Kuchling Ashley Sommer Arve Knudsen +Benjamin Cogrel +Boris Pelakh Chimezie Ogbuji +Chris Markiewicz +Dan Scott Daniel Krech David H Jones +Donny Winston Drew Perttula +Edmond Chuc Elias Torres +Florian Ludwig Gerhard Weis Graham Higgins Graham Klyne Gunnar AAstrand Grimnes +Harold Solbrig Ivan Herman +Iwan Aucamp +Jamie McCusker Jeroen van der Ham +Jerven Bolleman Joern Hees Kendall Clark Leandro López Lucio Torre +Mark Watts Michel Pelletier Natanael Arndt Nacho Barrientos Arias Nicholas J. Car Niklas Lindström +Pierre-Antoine Champin Phil Dawes Phillip Pearson Ron Alford +Remi Chateauneu Sidnei da Silva Simon McVittie Stefan Niederhauser +Tom Gillespie Thomas Kluyver +Urs Holzer William Waites @@ -1,6 +1,6 @@ -LICENSE AGREEMENT FOR RDFLIB +LICENSE AGREEMENT FOR RDFLIB ------------------------------------------------ -Copyright (c) 2002-2020, RDFLib Team +Copyright (c) 2002-2021, RDFLib Team See CONTRIBUTORS and http://github.com/RDFLib/rdflib All rights reserved. @@ -10,10 +10,11 @@ RDFLib RDFLib is a pure Python package for working with [RDF](http://www.w3.org/RDF/). RDFLib contains most things you need to work with RDF, including: -* parsers and serializers for RDF/XML, N3, NTriples, N-Quads, Turtle, TriX, Trig and JSON-LD (via a plugin). +* parsers and serializers for RDF/XML, N3, NTriples, N-Quads, Turtle, TriX, Trig and JSON-LD * a Graph interface which can be backed by any one of a number of Store implementations -* store implementations for in-memory storage and persistent storage on top of the Berkeley DB +* store implementations for in-memory, persistent on disk (Berkeley DB) and remote SPARQL endpoints * a SPARQL 1.1 implementation - supporting SPARQL 1.1 Queries and Update statements +* SPARQL function extension mechanisms ## RDFlib Family of packages The RDFlib community maintains many RDF-related Python code repositories with different purposes. For example: @@ -21,7 +22,6 @@ The RDFlib community maintains many RDF-related Python code repositories with di * [rdflib](https://github.com/RDFLib/rdflib) - the RDFLib core * [sparqlwrapper](https://github.com/RDFLib/sparqlwrapper) - a simple Python wrapper around a SPARQL service to remotely execute your queries * [pyLODE](https://github.com/RDFLib/pyLODE) - An OWL ontology documentation tool using Python and templating, based on LODE. -* [rdflib-jsonld](https://github.com/RDFLib/rdflib-jsonld) - an RDFLib plugin that is an implementation of JSON-LD Please see the list for all packages/repositories here: @@ -29,37 +29,41 @@ Please see the list for all packages/repositories here: ## Versions & Releases - * `5.x.y` supports Python 2.7 and 3.4+ and is [mostly backwards compatible with 4.2.2](https://rdflib.readthedocs.io/en/stable/upgrade4to5.html). Only bug fixes will be applied. - * `6.x.y` is the next major release which will support Python 3.6+. (Current master branch) +* `6.0.1-alpha` current `master` branch + * `6.x.y` current release and support Python 3.7+ only. Many improvements over 5.0.0 + * `5.x.y` supports Python 2.7 and 3.4+ and is [mostly backwards compatible with 4.2.2](https://rdflib.readthedocs.io/en/stable/upgrade4to5.html). See <https://rdflib.dev> for the release schedule. ## Documentation -See <https://rdflib.readthedocs.io> for our documentation built from the code. +See <https://rdflib.readthedocs.io> for our documentation built from the code. Note that there are `latest`, `stable` `5.0.0` and `4.2.2` documentation versions, matching releases. ## Installation -RDFLib may be installed with Python's package management tool *pip*: +The stable release of RDFLib may be installed with Python's package management tool *pip*: $ pip install rdflib Alternatively manually download the package from the Python Package Index (PyPI) at https://pypi.python.org/pypi/rdflib -The current version of RDFLib is 5.0.0, see the ``CHANGELOG.md`` -file for what's new in this release. +The current version of RDFLib is 6.0.0, see the ``CHANGELOG.md`` file for what's new in this release. ### Installation of the current master branch (for developers) With *pip* you can also install rdflib from the git repository with one of the following options: $ pip install git+https://github.com/rdflib/rdflib@master - # or + +or + $ pip install -e git+https://github.com/rdflib/rdflib@master#egg=rdflib or from your locally cloned repository you can install it with one of the following options: $ python setup.py install - # or + +or + $ pip install -e . ## Getting Started @@ -69,9 +73,9 @@ of RDF *Subject, Predicate, Object* Triples: To create graph and load it with RDF data from DBPedia then print the results: ```python -import rdflib -g = rdflib.Graph() -g.load('http://dbpedia.org/resource/Semantic_Web') +from rdflib import Graph +g = Graph() +g.parse('http://dbpedia.org/resource/Semantic_Web') for s, p, o in g: print(s, p, o) @@ -79,8 +83,7 @@ for s, p, o in g: The components of the triples are URIs (resources) or Literals (values). -URIs are grouped together by *namespace*, common namespaces are -included in RDFLib: +URIs are grouped together by *namespace*, common namespaces are included in RDFLib: ```python from rdflib.namespace import DC, DCTERMS, DOAP, FOAF, SKOS, OWL, RDF, RDFS, VOID, XMLNS, XSD @@ -89,20 +92,22 @@ from rdflib.namespace import DC, DCTERMS, DOAP, FOAF, SKOS, OWL, RDF, RDFS, VOID You can use them like this: ```python -semweb = rdflib.URIRef('http://dbpedia.org/resource/Semantic_Web') -type = g.value(semweb, rdflib.RDFS.label) +from rdflib import Graph, URIRef, Literal +from rdflib.namespace import RDFS + +g = Graph() +semweb = URIRef('http://dbpedia.org/resource/Semantic_Web') +type = g.value(semweb, RDFS.label) ``` -Where `rdflib.RDFS` is the RDFS Namespace, `graph.value` returns an -object of the triple-pattern given (or an arbitrary one if more -exist). +Where `RDFS` is the RDFS Namespace, `g.value` returns an object of the triple-pattern given (or an arbitrary one if more exist). Or like this, adding a triple to a graph `g`: ```python g.add(( - rdflib.URIRef("http://example.com/person/nick"), + URIRef("http://example.com/person/nick"), FOAF.givenName, - rdflib.Literal("Nick", datatype=XSD.string) + Literal("Nick", datatype=XSD.string) )) ``` The triple (in n-triples notation) `<http://example.com/person/nick> <http://xmlns.com/foaf/0.1/givenName> "Nick"^^<http://www.w3.org/2001/XMLSchema#string> .` @@ -131,7 +136,7 @@ PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> New Namespaces can also be defined: ```python -dbpedia = rdflib.Namespace('http://dbpedia.org/ontology/') +dbpedia = Namespace('http://dbpedia.org/ontology/') abstracts = list(x for x in g.objects(semweb, dbpedia['abstract']) if x.language=='en') ``` @@ -172,6 +177,8 @@ Run the test suite and generate a HTML coverage report with `nose` and `coverage nosetests --with-timer --timer-top-n 42 --with-coverage --cover-tests --cover-package=rdflib ``` +There is also a script, `run_tests.py` to run everything. + ### Running the tests in a Docker container Run the test suite inside a Docker container for cross-platform support. This resolves issues such as installing BerkeleyDB on Windows and avoids the host and port issues on macOS. diff --git a/admin/README.md b/admin/README.md new file mode 100644 index 00000000..bc26ef6e --- /dev/null +++ b/admin/README.md @@ -0,0 +1,4 @@ +# Admin Tools + +Tools to assist with RDFlib releases, like extracting all merged PRs from GitHub since last release. + diff --git a/admin/get_merged_prs.py b/admin/get_merged_prs.py new file mode 100644 index 00000000..6378f3c9 --- /dev/null +++ b/admin/get_merged_prs.py @@ -0,0 +1,27 @@ +"""Get all merged PRs since last release, save them to a JSON file""" + +import httpx +import json + + +r = httpx.get( + "https://api.github.com/repos/rdflib/rdflib/pulls", + params={ + "state": "closed", + "per_page": 100, + "page": 2 # must get all pages up to date of last release + } +) +prs = [] +if r.status_code == 200: + for pr in r.json(): + if pr["merged_at"] is not None: + prs.append({ + "url": pr["url"], + "title": pr["title"], + "merged_at": pr["merged_at"], + }) + with open("prs2.json", "w") as f: + json.dump(prs, f) +else: + print("ERROR") diff --git a/admin/print_prs.py b/admin/print_prs.py new file mode 100644 index 00000000..301b20eb --- /dev/null +++ b/admin/print_prs.py @@ -0,0 +1,10 @@ +"""Print all PRs in saved JSON file in Markdown list for CHANGELOG""" + +import json + +with open("prs2.json") as f: + for pr in sorted(json.load(f), key=lambda k: k["merged_at"], reverse=True): + if not pr['title'].startswith("Bump"): + id = pr['url'].replace("https://api.github.com/repos/RDFLib/rdflib/pulls/", "") + u = f"https://github.com/RDFLib/rdflib/pull/{id}" + print(f"""* {pr['title']}\n [PR #{id}]({u})""") diff --git a/rdflib/__init__.py b/rdflib/__init__.py index 60c7beda..0929c516 100644 --- a/rdflib/__init__.py +++ b/rdflib/__init__.py @@ -45,8 +45,8 @@ A tiny example: __docformat__ = "restructuredtext en" # The format of the __version__ line is matched by a regex in setup.py -__version__ = "6.0.0-alpha" -__date__ = "2021-03-22" +__version__ = "6.0.0" +__date__ = "2021-07-20" __all__ = [ "URIRef", diff --git a/rdflib/plugins/sparql/algebra.py b/rdflib/plugins/sparql/algebra.py index b4d48284..6107d38c 100644 --- a/rdflib/plugins/sparql/algebra.py +++ b/rdflib/plugins/sparql/algebra.py @@ -5,7 +5,6 @@ http://www.w3.org/TR/sparql11-query/#sparqlQuery """ - import functools import operator import collections @@ -1261,5 +1260,6 @@ if __name__ == "__main__": pq = parser.parseQuery(q) print(pq) + print("--------") tq = translateQuery(pq) pprintAlgebra(tq) diff --git a/rdflib/plugins/sparql/operators.py b/rdflib/plugins/sparql/operators.py index d93cf508..35ec35d6 100644 --- a/rdflib/plugins/sparql/operators.py +++ b/rdflib/plugins/sparql/operators.py @@ -1062,25 +1062,25 @@ def dateTimeObjects(expr): def isCompatibleDateTimeDatatype(obj1, dt1, obj2, dt2): """ - returns a boolean indicating if first object is compatible + Returns a boolean indicating if first object is compatible with operation(+/-) over second object. """ - if(dt1 == XSD.date): - if(dt2 == XSD.yearMonthDuration): + if dt1 == XSD.date: + if dt2 == XSD.yearMonthDuration: return True - elif(dt2 == XSD.dayTimeDuration or dt2 == XSD.Duration): + elif dt2 == XSD.dayTimeDuration or dt2 == XSD.Duration: # checking if the dayTimeDuration has no Time Component # else it wont be compatible with Date Literal - if("T" in str(obj2)): + if "T" in str(obj2): return False else: return True - if(dt1 == XSD.time): - if(dt2 == XSD.yearMonthDuration): + if dt1 == XSD.time: + if dt2 == XSD.yearMonthDuration: return False - elif(dt2 == XSD.dayTimeDuration or dt2 == XSD.Duration): + elif dt2 == XSD.dayTimeDuration or dt2 == XSD.Duration: # checking if the dayTimeDuration has no Date Component # (by checking if the format is "PT...." ) # else it wont be compatible with Time Literal @@ -1089,7 +1089,7 @@ def isCompatibleDateTimeDatatype(obj1, dt1, obj2, dt2): else: return False - if(dt1 == XSD.dateTime): + if dt1 == XSD.dateTime: # compatible with all return True diff --git a/rdflib/plugins/stores/sparqlstore.py b/rdflib/plugins/stores/sparqlstore.py index ba092c50..e9c0615c 100644 --- a/rdflib/plugins/stores/sparqlstore.py +++ b/rdflib/plugins/stores/sparqlstore.py @@ -191,37 +191,38 @@ class SPARQLStore(SPARQLConnector, Store): # type: ignore[misc] def triples(self, spo, context=None): """ - tuple **(s, o, p)** - the triple used as filter for the SPARQL select. - (None, None, None) means anything. + the triple used as filter for the SPARQL select. + (None, None, None) means anything. - context **context** - the graph effectively calling this method. + the graph effectively calling this method. Returns a tuple of triples executing essentially a SPARQL like SELECT ?subj ?pred ?obj WHERE { ?subj ?pred ?obj } **context** may include three parameter to refine the underlying query: - * LIMIT: an integer to limit the number of results - * OFFSET: an integer to enable paging of results - * ORDERBY: an instance of Variable('s'), Variable('o') or Variable('p') - or, by default, the first 'None' from the given triple + * LIMIT: an integer to limit the number of results + * OFFSET: an integer to enable paging of results + * ORDERBY: an instance of Variable('s'), Variable('o') or Variable('p') or, by default, the first 'None' from the given triple .. warning:: - - Using LIMIT or OFFSET automatically include ORDERBY otherwise this is - because the results are retrieved in a not deterministic way (depends on - the walking path on the graph) - - Using OFFSET without defining LIMIT will discard the first OFFSET - 1 - results + + - Using LIMIT or OFFSET automatically include ORDERBY otherwise this is + because the results are retrieved in a not deterministic way (depends on + the walking path on the graph) + - Using OFFSET without defining LIMIT will discard the first OFFSET - 1 results `` a_graph.LIMIT = limit a_graph.OFFSET = offset triple_generator = a_graph.triples(mytriple): - #do something - #Removes LIMIT and OFFSET if not required for the next triple() calls + # do something + # Removes LIMIT and OFFSET if not required for the next triple() calls del a_graph.LIMIT del a_graph.OFFSET `` + + """ s, p, o = spo @@ -526,8 +527,9 @@ class SPARQLUpdateStore(SPARQLStore): self._updates = 0 def open(self, configuration: Union[str, Tuple[str, str]], create=False): - """This method is included so that calls to this Store via Graph, e.g. Graph("SPARQLStore"), - can set the required parameters + """This method is included so that calls to this Store via Graph, e.g. + Graph("SPARQLStore"), can set the required parameters + """ if type(configuration) == str: self.query_endpoint = configuration # type: ignore[assignment] |