From 52e2461fa14d4e4e27f8ea9f3195378a1f8ed41b Mon Sep 17 00:00:00 2001 From: Timo Date: Fri, 17 May 2024 11:35:06 +0200 Subject: [PATCH 01/13] Update _GEO.py to include GeoSPARQL 1.1 vocabularies (#2771) --- rdflib/namespace/_GEO.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/rdflib/namespace/_GEO.py b/rdflib/namespace/_GEO.py index 4cddc5b43..949e5fba6 100644 --- a/rdflib/namespace/_GEO.py +++ b/rdflib/namespace/_GEO.py @@ -26,19 +26,36 @@ class GEO(DefinedNamespace): """ # http://www.w3.org/2000/01/rdf-schema#Datatype + dggsLiteral: URIRef # A DGGS serialization of a geometry object. + geoJSONLiteral: URIRef # A GeoJSON serialization of a geometry object. gmlLiteral: URIRef # A GML serialization of a geometry object. + kmlLiteral: URIRef # A KML serialization of a geometry object. wktLiteral: URIRef # A Well-known Text serialization of a geometry object. + # http://www.w3.org/2002/07/owl#Class Feature: URIRef # This class represents the top-level feature type. This class is equivalent to GFI_Feature defined in ISO 19156:2011, and it is superclass of all feature types. + FeatureCollection: URIRef # A collection of individual Features. Geometry: URIRef # The class represents the top-level geometry type. This class is equivalent to the UML class GM_Object defined in ISO 19107, and it is superclass of all geometry types. + GeometryCollection: URIRef # A collection of individual Geometries. SpatialObject: URIRef # The class spatial-object represents everything that can have a spatial representation. It is superclass of feature and geometry. + SpatialObjectCollection: URIRef # A collection of individual Spatial Objects. This is the superclass of Feature Collection and Geometry Collection. # http://www.w3.org/2002/07/owl#DatatypeProperty asGML: URIRef # The GML serialization of a geometry asWKT: URIRef # The WKT serialization of a geometry + asGeoJSON: URIRef # The GeoJSON serialization of a geometry + asKML: URIRef # The KML serialization of a geometry + asDGGS: URIRef # The DGGS serialization of a geometry coordinateDimension: URIRef # The number of measurements or axes needed to describe the position of this geometry in a coordinate system. dimension: URIRef # The topological dimension of this geometric object, which must be less than or equal to the coordinate dimension. In non-homogeneous collections, this will return the largest topological dimension of the contained objects. + hasMetricArea: URIRef # The area of a Spatial Object in square meters. + hasMetricLength: URIRef # The length of a Spatial Object in meters. + hasMetricPerimeterLength: URIRef # The length of the perimeter of a Spatial Object in meters. + hasMetricSpatialAccuracy: URIRef # The spatial resolution of a Geometry in meters. + hasMetricSpatialResolution: URIRef # The spatial resolution of a Geometry in meters. + hasMetricSize: URIRef # Subproperties of this property are used to indicate the size of a Spatial Object as a measurement or estimate of one or more dimensions of the Spatial Object's spatial presence. Units are always metric (meter, square meter or cubic meter) + hasMetricVolume: URIRef # The volume of a Spatial Object in cubic meters. hasSerialization: ( URIRef # Connects a geometry object with its text-based serialization. ) @@ -56,7 +73,17 @@ class GEO(DefinedNamespace): ehInside: URIRef # Exists if the subject SpatialObject is spatially inside the object SpatialObject. DE-9IM: TFF*FFT** ehMeet: URIRef # Exists if the subject SpatialObject spatially meets the object SpatialObject. DE-9IM: FT******* ^ F**T***** ^ F***T**** ehOverlap: URIRef # Exists if the subject SpatialObject spatially overlaps the object SpatialObject. DE-9IM: T*T***T** + hasArea: URIRef # The area of a Spatial Object. + hasBoundingBox: URIRef # The minimum or smallest bounding or enclosing box of a given Feature. + hasCentroid: URIRef # The arithmetic mean position of all the geometry points of a given Feature. + hasDefaultGeometry: URIRef # The default geometry to be used in spatial calculations, usually the most detailed geometry. hasGeometry: URIRef # A spatial representation for a given feature. + hasLength: URIRef # The length of a Spatial Object. + hasPerimeterLength: URIRef # The length of the perimeter of a Spatial Object. + hasSize: URIRef # Subproperties of this property are used to indicate the size of a Spatial Object as a measurement or estimate of one or more dimensions of the Spatial Object's spatial presence. + hasSpatialAccuracy: URIRef # The positional accuracy of the coordinates of a Geometry. + hasSpatialResolution: URIRef # The spatial resolution of a Geometry. + hasVolume: URIRef # he volume of a three-dimensional Spatial Object. rcc8dc: URIRef # Exists if the subject SpatialObject is spatially disjoint from the object SpatialObject. DE-9IM: FFTFFTTTT rcc8ec: URIRef # Exists if the subject SpatialObject spatially meets the object SpatialObject. DE-9IM: FFTFTTTTT rcc8eq: URIRef # Exists if the subject SpatialObject spatially equals the object SpatialObject. DE-9IM: TFFFTFFFT From 901ddb4c4db148e6b4357a5f2e15dec8d8fb2266 Mon Sep 17 00:00:00 2001 From: Nicholas Car Date: Fri, 17 May 2024 11:35:50 +0200 Subject: [PATCH 02/13] Update .mailmap for Nicholas Car (#2776) --- .mailmap | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.mailmap b/.mailmap index d953d228f..06db195ac 100644 --- a/.mailmap +++ b/.mailmap @@ -65,9 +65,10 @@ Maurizio Nagni kusamau Michel Pelletier michel Mikael Nilsson mikael Nathan Maynes Nathan M -Nicholas J. Car Nicholas Car -Nicholas J. Car Nicholas Car -Nicholas J. Car nicholascar +Nicholas J. Car Nicholas Car +Nicholas J. Car Nicholas Car +Nicholas J. Car nicholascar +Nicholas J. Car Nicholas Car Niklas Lindström lindstream Niklas Lindström Niklas Lindstrom Olivier Grisel ogrisel @@ -98,4 +99,4 @@ William Waites wwaites William Waites ww@epsilon.styx.org Whit Morriss whit Zach Lûster kernc -Zach Lûster Kernc \ No newline at end of file +Zach Lûster Kernc From 48fa136769e05d7598404e74b5fd86a2b693f0aa Mon Sep 17 00:00:00 2001 From: Ben Wallberg Date: Fri, 17 May 2024 05:40:22 -0400 Subject: [PATCH 03/13] docs: fix "Build docs" command in developers.rst (#2783) --- docs/developers.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/developers.rst b/docs/developers.rst index 8d21ef8e7..7e00dc950 100644 --- a/docs/developers.rst +++ b/docs/developers.rst @@ -345,7 +345,7 @@ Some useful commands for working with the task in the taskfile is given below: task validate # Build docs - task docs:build + task docs # Run live-preview on the docs task docs:live-server From ad8eb92e42c18f1bc106dc880828fbb306e99a21 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 17 May 2024 11:41:37 +0200 Subject: [PATCH 04/13] build(deps): bump networkx from 2.6.3 to 3.1 (#2458) Bumps [networkx](https://github.com/networkx/networkx) from 2.6.3 to 3.1. - [Release notes](https://github.com/networkx/networkx/releases) - [Commits](https://github.com/networkx/networkx/compare/networkx-2.6.3...networkx-3.1) --- updated-dependencies: - dependency-name: networkx dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Nicholas Car --- poetry.lock | 16 ++++++++++------ pyproject.toml | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/poetry.lock b/poetry.lock index f24fdb693..8cced8da8 100644 --- a/poetry.lock +++ b/poetry.lock @@ -726,20 +726,24 @@ testing-docutils = ["pygments", "pytest (>=7,<8)", "pytest-param-files (>=0.3.4, [[package]] name = "networkx" -version = "2.8.8" +version = "3.1" description = "Python package for creating and manipulating graphs and networks" optional = true python-versions = ">=3.8" files = [ + {file = "networkx-3.1-py3-none-any.whl", hash = "sha256:4f33f68cb2afcf86f28a45f43efc27a9386b535d567d2127f8f61d51dec58d36"}, + {file = "networkx-3.1.tar.gz", hash = "sha256:de346335408f84de0eada6ff9fafafff9bcda11f0a0dfaa931133debb146ab61"}, +] + +[package.extras] +default = ["matplotlib (>=3.4)", "numpy (>=1.20)", "pandas (>=1.3)", "scipy (>=1.8)"] +developer = ["mypy (>=1.1)", "pre-commit (>=3.2)"] +doc = ["nb2plots (>=0.6)", "numpydoc (>=1.5)", "pillow (>=9.4)", "pydata-sphinx-theme (>=0.13)", "sphinx (>=6.1)", "sphinx-gallery (>=0.12)", "texext (>=0.6.7)"] +extra = ["lxml (>=4.6)", "pydot (>=1.4.2)", "pygraphviz (>=1.10)", "sympy (>=1.10)"] {file = "networkx-2.8.8-py3-none-any.whl", hash = "sha256:e435dfa75b1d7195c7b8378c3859f0445cd88c6b0375c181ed66823a9ceb7524"}, {file = "networkx-2.8.8.tar.gz", hash = "sha256:230d388117af870fce5647a3c52401fcf753e94720e6ea6b4197a5355648885e"}, ] -[package.extras] -default = ["matplotlib (>=3.4)", "numpy (>=1.19)", "pandas (>=1.3)", "scipy (>=1.8)"] -developer = ["mypy (>=0.982)", "pre-commit (>=2.20)"] -doc = ["nb2plots (>=0.6)", "numpydoc (>=1.5)", "pillow (>=9.2)", "pydata-sphinx-theme (>=0.11)", "sphinx (>=5.2)", "sphinx-gallery (>=0.11)", "texext (>=0.6.6)"] -extra = ["lxml (>=4.6)", "pydot (>=1.4.2)", "pygraphviz (>=1.9)", "sympy (>=1.10)"] test = ["codecov (>=2.1)", "pytest (>=7.2)", "pytest-cov (>=4.0)"] [[package]] diff --git a/pyproject.toml b/pyproject.toml index f1868ad48..c0944b0c0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,7 +42,7 @@ python = "^3.8.1" isodate = "^0.6.0" pyparsing = ">=2.1.0,<4" berkeleydb = {version = "^18.1.0", optional = true} -networkx = {version = "^2.0.0", optional = true} +networkx = {version = ">=2,<4", optional = true} html5lib = {version = "^1.0", optional = true} lxml = {version = "^4.3.0", optional = true} From 53f72d87bbc9c0f193bdc703f030587b359bfb4e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 17 May 2024 11:42:00 +0200 Subject: [PATCH 05/13] build(deps): bump poetry from 1.8.2 to 1.8.3 in /devtools (#2787) Bumps [poetry](https://github.com/python-poetry/poetry) from 1.8.2 to 1.8.3. - [Release notes](https://github.com/python-poetry/poetry/releases) - [Changelog](https://github.com/python-poetry/poetry/blob/1.8.3/CHANGELOG.md) - [Commits](https://github.com/python-poetry/poetry/compare/1.8.2...1.8.3) --- updated-dependencies: - dependency-name: poetry dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- devtools/requirements-poetry.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devtools/requirements-poetry.in b/devtools/requirements-poetry.in index 783d0a538..51526d194 100644 --- a/devtools/requirements-poetry.in +++ b/devtools/requirements-poetry.in @@ -1,3 +1,3 @@ # Fixing this here as readthedocs can't use the compiled requirements-poetry.txt # due to conflicts. -poetry==1.8.2 +poetry==1.8.3 From fcfc2aa90c25ee950cf0b9994cb00524c09d98f3 Mon Sep 17 00:00:00 2001 From: Natanael Arndt Date: Wed, 12 Jun 2024 05:12:16 +0200 Subject: [PATCH 06/13] Remove test/data/suites/w3c/dawg-data-r2/sort/.manifest.ttl.swp since it must be some vim leftover (#2797) --- .../w3c/dawg-data-r2/sort/.manifest.ttl.swp | Bin 20480 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 test/data/suites/w3c/dawg-data-r2/sort/.manifest.ttl.swp diff --git a/test/data/suites/w3c/dawg-data-r2/sort/.manifest.ttl.swp b/test/data/suites/w3c/dawg-data-r2/sort/.manifest.ttl.swp deleted file mode 100644 index 9a14952b634d54acd29826b7ada003e19e4ac5a1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 20480 zcmeI2Yls}h7RM`z$u(+R;{&e`q}=#n7c=jD%^LS+LlO;|cw=1GxAe^P?helMOuBpA zT{T`s1z!ZeC_Yd>C=&073krfC;sY@XB8VD96jW4DeBuLC6urNyo!Rts#_WtEaaXG0 zx3kq#eY*R9x_auII+^%|n>Ne-XhN_ZCB%nMJiGCn8y1NVmIzU>ZMApKEjwX3X9SmsQ(*n9V3)6fg=H1&jhl0i%FX zz$jo8FbWt2i~>f11)_kJ6JqZXLUgU*f=K|V9KiD(LX=?uK08u~hv5R)1_RIm0$$>n zo#4PItOaFf9h?NqU^liOhaGSp908vmF2u9&4BP`ZLLYp0m=LeQZnz6FkcI(R3BN2C z;sy8*TncBy$?(;oLhOMT;X$|+Ho-FZ@E_QON1y`d!Z~mnbilpKgcyMYoC4o2#ST0G z_k#ylzzOgcNs%YvVenuBoD3(y_asQ(hudHybV3JwL}KMBxD)Px9GnM>;W?5m55TP; zYg=(_(8~JxlB0L!tjTeI&?=YR($!W$&NPR0)6U5=_UmKk)=kSb6TV*_jKwA=C!>?8 zXvrN{^%ecGcwa2p7g07M#k^CYz+$LsLZ95tjd_FFQc;y=$j)sPT*#6mJ^O0g<vyc8Ejv}kMr1(k9Mq?rX-iA>*jlmO z=?%)5rEc{CYC6uS*TA*CO2Lvm(tEo)JH7SijOCuFyS+|~`Q`@vQnp+xQ?RR^@Tbf8qpCd~$veJ1ZoATQ za&oLtviyer=nwg$zb$|CHSdo;RkPE)Kd?N%{V_8fs!wTYOpOFjYhUw7w9#$+OJSy8ZIE;a#!b$y z9n#2Qy&;G7w&gJ1GR?lfT6EaFe}5gw35|sB2?^iRmhh?Og-^9MQm{OaM+#4WSGnYQ z`AlJ2R-8*JlVYFiPkj7^8D0%xKN(3GPa-3N;L_QUHe`x z-ReygeqS|mLNerpWLr*1XeY>-DbvB6O#c4NtVL&Y2M2PtK2QD3bw4lc`%!4t35k#s z68bcOdF)ul**8fK?9Wv41wTJCcMt4#D#eWLdP12A>`n(8iMR}Z-y8hCFWBf0HU{)@ zUBO+6U?Ul9q=JneeI#>Tru=T65^l*>ujV!$WPVSjD#w;t%dVqhpj+Lp-)MQ_R}crL}HJ&++R_aj}2QRIU2F z&YBi$dE*<5$0%y2L&VEY*hQ=ExWSfgMaMPaD)>5koJQYPgDXj-)9F||8A~Q3`eLRX z-ZilmA75r4aw^!8tnawC*6fg=H1&jg2`>Gb;UbqD=hSOm&EP{84`}e>WI2=A9-rozm;2PKp|AuZj7E~R; zoiG6-&<#Jc=Klt~4*!L_;a~6z>-}%T9=H##f^{$qC&E&A8qF%O6|{Z}ZBA*f*C^1I z0<%961SO_w<#z%zQ?+8MR)iWUf8DfG&;40|G*v5qT`irdT3L8icY(=&wZ87a@tCPv s`ID+nP1TAn{0*g(fqB1S5h1c_>YGsaGP From ec36a1305f291d0aac65ecab98feac427797bb5b Mon Sep 17 00:00:00 2001 From: lennertvandevelde <61053080+lennertvandevelde@users.noreply.github.com> Date: Mon, 17 Jun 2024 14:47:47 +0200 Subject: [PATCH 07/13] Fix for gha:validation error in Github actions (#2799) * Quote boolean variables * Update broken poetry.lock * Black reformat * Revert update of lock file, only fix invalid statement * Fix unreachable code block --------- Co-authored-by: Nicholas Car --- Taskfile.yml | 6 ++--- poetry.lock | 8 ++---- rdflib/namespace/_GEO.py | 43 +++++++++++++++++++------------- rdflib/plugins/parsers/jsonld.py | 4 +-- rdflib/plugins/sparql/algebra.py | 2 -- 5 files changed, 31 insertions(+), 32 deletions(-) diff --git a/Taskfile.yml b/Taskfile.yml index cc596398f..2b9582f5f 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -139,14 +139,14 @@ tasks: desc: Fix auto-fixable linting errors cmds: - task: ruff - vars: { FIX: true } + vars: { FIX: "true" } - task: black lint: desc: Perform linting cmds: - task: black - vars: { CHECK: true } + vars: { CHECK: "true" } - task: ruff validate:static: @@ -250,7 +250,7 @@ tasks: - task: install:system-deps - task: install:tox vars: - WITH_GITHUB_ACTIONS: true + WITH_GITHUB_ACTIONS: "true" - cmd: "{{.PYTHON}} -m pip install coveralls" - task: tox vars: diff --git a/poetry.lock b/poetry.lock index 8cced8da8..0e50a87b6 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. [[package]] name = "alabaster" @@ -740,10 +740,6 @@ default = ["matplotlib (>=3.4)", "numpy (>=1.20)", "pandas (>=1.3)", "scipy (>=1 developer = ["mypy (>=1.1)", "pre-commit (>=3.2)"] doc = ["nb2plots (>=0.6)", "numpydoc (>=1.5)", "pillow (>=9.4)", "pydata-sphinx-theme (>=0.13)", "sphinx (>=6.1)", "sphinx-gallery (>=0.12)", "texext (>=0.6.7)"] extra = ["lxml (>=4.6)", "pydot (>=1.4.2)", "pygraphviz (>=1.10)", "sympy (>=1.10)"] - {file = "networkx-2.8.8-py3-none-any.whl", hash = "sha256:e435dfa75b1d7195c7b8378c3859f0445cd88c6b0375c181ed66823a9ceb7524"}, - {file = "networkx-2.8.8.tar.gz", hash = "sha256:230d388117af870fce5647a3c52401fcf753e94720e6ea6b4197a5355648885e"}, -] - test = ["codecov (>=2.1)", "pytest (>=7.2)", "pytest-cov (>=4.0)"] [[package]] @@ -1290,4 +1286,4 @@ networkx = ["networkx"] [metadata] lock-version = "2.0" python-versions = "^3.8.1" -content-hash = "883a563380c9450e52778d40e6b38d8393237d077d690b10e5a43438d9443820" +content-hash = "ac6ecc3bb7a6d80073ed33c06832f3dd71a7fa584c24690ba2593513f6dde076" diff --git a/rdflib/namespace/_GEO.py b/rdflib/namespace/_GEO.py index 949e5fba6..d7168d64c 100644 --- a/rdflib/namespace/_GEO.py +++ b/rdflib/namespace/_GEO.py @@ -32,12 +32,11 @@ class GEO(DefinedNamespace): kmlLiteral: URIRef # A KML serialization of a geometry object. wktLiteral: URIRef # A Well-known Text serialization of a geometry object. - # http://www.w3.org/2002/07/owl#Class Feature: URIRef # This class represents the top-level feature type. This class is equivalent to GFI_Feature defined in ISO 19156:2011, and it is superclass of all feature types. - FeatureCollection: URIRef # A collection of individual Features. + FeatureCollection: URIRef # A collection of individual Features. Geometry: URIRef # The class represents the top-level geometry type. This class is equivalent to the UML class GM_Object defined in ISO 19107, and it is superclass of all geometry types. - GeometryCollection: URIRef # A collection of individual Geometries. + GeometryCollection: URIRef # A collection of individual Geometries. SpatialObject: URIRef # The class spatial-object represents everything that can have a spatial representation. It is superclass of feature and geometry. SpatialObjectCollection: URIRef # A collection of individual Spatial Objects. This is the superclass of Feature Collection and Geometry Collection. @@ -49,13 +48,17 @@ class GEO(DefinedNamespace): asDGGS: URIRef # The DGGS serialization of a geometry coordinateDimension: URIRef # The number of measurements or axes needed to describe the position of this geometry in a coordinate system. dimension: URIRef # The topological dimension of this geometric object, which must be less than or equal to the coordinate dimension. In non-homogeneous collections, this will return the largest topological dimension of the contained objects. - hasMetricArea: URIRef # The area of a Spatial Object in square meters. - hasMetricLength: URIRef # The length of a Spatial Object in meters. - hasMetricPerimeterLength: URIRef # The length of the perimeter of a Spatial Object in meters. - hasMetricSpatialAccuracy: URIRef # The spatial resolution of a Geometry in meters. - hasMetricSpatialResolution: URIRef # The spatial resolution of a Geometry in meters. - hasMetricSize: URIRef # Subproperties of this property are used to indicate the size of a Spatial Object as a measurement or estimate of one or more dimensions of the Spatial Object's spatial presence. Units are always metric (meter, square meter or cubic meter) - hasMetricVolume: URIRef # The volume of a Spatial Object in cubic meters. + hasMetricArea: URIRef # The area of a Spatial Object in square meters. + hasMetricLength: URIRef # The length of a Spatial Object in meters. + hasMetricPerimeterLength: ( + URIRef # The length of the perimeter of a Spatial Object in meters. + ) + hasMetricSpatialAccuracy: URIRef # The spatial resolution of a Geometry in meters. + hasMetricSpatialResolution: ( + URIRef # The spatial resolution of a Geometry in meters. + ) + hasMetricSize: URIRef # Subproperties of this property are used to indicate the size of a Spatial Object as a measurement or estimate of one or more dimensions of the Spatial Object's spatial presence. Units are always metric (meter, square meter or cubic meter) + hasMetricVolume: URIRef # The volume of a Spatial Object in cubic meters. hasSerialization: ( URIRef # Connects a geometry object with its text-based serialization. ) @@ -73,17 +76,21 @@ class GEO(DefinedNamespace): ehInside: URIRef # Exists if the subject SpatialObject is spatially inside the object SpatialObject. DE-9IM: TFF*FFT** ehMeet: URIRef # Exists if the subject SpatialObject spatially meets the object SpatialObject. DE-9IM: FT******* ^ F**T***** ^ F***T**** ehOverlap: URIRef # Exists if the subject SpatialObject spatially overlaps the object SpatialObject. DE-9IM: T*T***T** - hasArea: URIRef # The area of a Spatial Object. - hasBoundingBox: URIRef # The minimum or smallest bounding or enclosing box of a given Feature. - hasCentroid: URIRef # The arithmetic mean position of all the geometry points of a given Feature. + hasArea: URIRef # The area of a Spatial Object. + hasBoundingBox: ( + URIRef # The minimum or smallest bounding or enclosing box of a given Feature. + ) + hasCentroid: URIRef # The arithmetic mean position of all the geometry points of a given Feature. hasDefaultGeometry: URIRef # The default geometry to be used in spatial calculations, usually the most detailed geometry. hasGeometry: URIRef # A spatial representation for a given feature. - hasLength: URIRef # The length of a Spatial Object. - hasPerimeterLength: URIRef # The length of the perimeter of a Spatial Object. + hasLength: URIRef # The length of a Spatial Object. + hasPerimeterLength: URIRef # The length of the perimeter of a Spatial Object. hasSize: URIRef # Subproperties of this property are used to indicate the size of a Spatial Object as a measurement or estimate of one or more dimensions of the Spatial Object's spatial presence. - hasSpatialAccuracy: URIRef # The positional accuracy of the coordinates of a Geometry. - hasSpatialResolution: URIRef # The spatial resolution of a Geometry. - hasVolume: URIRef # he volume of a three-dimensional Spatial Object. + hasSpatialAccuracy: ( + URIRef # The positional accuracy of the coordinates of a Geometry. + ) + hasSpatialResolution: URIRef # The spatial resolution of a Geometry. + hasVolume: URIRef # he volume of a three-dimensional Spatial Object. rcc8dc: URIRef # Exists if the subject SpatialObject is spatially disjoint from the object SpatialObject. DE-9IM: FFTFFTTTT rcc8ec: URIRef # Exists if the subject SpatialObject spatially meets the object SpatialObject. DE-9IM: FFTFTTTTT rcc8eq: URIRef # Exists if the subject SpatialObject spatially equals the object SpatialObject. DE-9IM: TFFFTFFFT diff --git a/rdflib/plugins/parsers/jsonld.py b/rdflib/plugins/parsers/jsonld.py index 38acb3696..6a5bc1103 100644 --- a/rdflib/plugins/parsers/jsonld.py +++ b/rdflib/plugins/parsers/jsonld.py @@ -403,9 +403,7 @@ def _parse_container( ( dict({GRAPH: o}) if k in context.get_keys(NONE) - else dict({ID: k, GRAPH: o}) - if isinstance(o, dict) - else o + else dict({ID: k, GRAPH: o}) if isinstance(o, dict) else o ) for k, o in obj.items() ] diff --git a/rdflib/plugins/sparql/algebra.py b/rdflib/plugins/sparql/algebra.py index 8830d2738..39c6ea224 100644 --- a/rdflib/plugins/sparql/algebra.py +++ b/rdflib/plugins/sparql/algebra.py @@ -1007,8 +1007,6 @@ def convert_node_arg( return node_arg.n3() elif isinstance(node_arg, CompValue): return "{" + node_arg.name + "}" - elif isinstance(node_arg, Expr): - return "{" + node_arg.name + "}" elif isinstance(node_arg, str): return node_arg else: From dea05526d8ea5b12d8ad5f661d4a102e4fbb9435 Mon Sep 17 00:00:00 2001 From: Natanael Arndt Date: Mon, 17 Jun 2024 14:59:38 +0200 Subject: [PATCH 08/13] Reformat code, execute task black (#2798) Co-authored-by: Nicholas Car From 8dabb87090e6f266139832da351906b5137d8b66 Mon Sep 17 00:00:00 2001 From: Ben Wallberg Date: Mon, 17 Jun 2024 09:13:14 -0400 Subject: [PATCH 09/13] fix: lint (#2792) * fix: task expected type string, got bool * fix: lint --------- Co-authored-by: Nicholas Car From 03e2b44ed6ce5c4a4c8b94b6376f5c32a5a263fe Mon Sep 17 00:00:00 2001 From: Ben Wallberg Date: Mon, 17 Jun 2024 10:26:34 -0400 Subject: [PATCH 10/13] fix: task expected type string, got bool (#2791) Co-authored-by: Nicholas Car From f6de1f3dc23c74665e6d9ac47495463c284b6176 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 18 Jun 2024 00:43:50 +1000 Subject: [PATCH 11/13] build(deps): bump library/python in /docker/latest (#2725) Bumps library/python from `eb53cb9` to `5c73034`. --- updated-dependencies: - dependency-name: library/python dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Nicholas Car --- docker/latest/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/latest/Dockerfile b/docker/latest/Dockerfile index 23a2b5df0..afc7862d1 100644 --- a/docker/latest/Dockerfile +++ b/docker/latest/Dockerfile @@ -1,4 +1,4 @@ -FROM docker.io/library/python:3.12.2-slim@sha256:eb53cb99a609b86da6e239b16e1f2aed5e10cfbc538671fc4631093a00f133f2 +FROM docker.io/library/python:3.12.2-slim@sha256:5c73034c2bc151596ee0f1335610735162ee2b148816710706afec4757ad5b1e COPY docker/latest/requirements.txt /var/tmp/build/ From 959dec532a3844fde874a36c3ab2328f20b681cb Mon Sep 17 00:00:00 2001 From: Ben Wallberg Date: Mon, 17 Jun 2024 11:45:13 -0400 Subject: [PATCH 12/13] Deprecate ConjunctiveGraph (#2405) (#2786) * Deprecate ConjunctiveGraph (#2405) * docs: deprecate ConjunctiveGraph (#2405) --------- Co-authored-by: Nicholas Car --- docs/intro_to_parsing.rst | 2 +- docs/merging.rst | 2 +- docs/plugin_parsers.rst | 5 ++--- rdflib/graph.py | 15 +++++++++++++++ .../test_conjunctive_graph.py | 7 +++++++ test/test_dataset/test_dataset.py | 12 ++++++++++++ 6 files changed, 38 insertions(+), 5 deletions(-) diff --git a/docs/intro_to_parsing.rst b/docs/intro_to_parsing.rst index 4593aa7d9..8b011c53f 100644 --- a/docs/intro_to_parsing.rst +++ b/docs/intro_to_parsing.rst @@ -116,7 +116,7 @@ Working with multi-graphs ------------------------- To read and query multi-graphs, that is RDF data that is context-aware, you need to use rdflib's -:class:`rdflib.ConjunctiveGraph` or :class:`rdflib.Dataset` class. These are extensions to :class:`rdflib.Graph` that +:class:`rdflib.Dataset` class. This an extension to :class:`rdflib.Graph` that know all about quads (triples + graph IDs). If you had this multi-graph data file (in the ``trig`` format, using new-style ``PREFIX`` statement (not the older diff --git a/docs/merging.rst b/docs/merging.rst index d0e5f5e51..1721d9206 100644 --- a/docs/merging.rst +++ b/docs/merging.rst @@ -25,7 +25,7 @@ In RDFLib, blank nodes are given unique IDs when parsing, so graph merging can b ``graph`` now contains the merged graph of ``input1`` and ``input2``. -.. note:: However, the set-theoretic graph operations in RDFLib are assumed to be performed in sub-graphs of some larger data-base (for instance, in the context of a :class:`~rdflib.graph.ConjunctiveGraph`) and assume shared blank node IDs, and therefore do NOT do *correct* merging, i.e.:: +.. note:: However, the set-theoretic graph operations in RDFLib are assumed to be performed in sub-graphs of some larger data-base (for instance, in the context of a :class:`~rdflib.graph.Dataset`) and assume shared blank node IDs, and therefore do NOT do *correct* merging, i.e.:: from rdflib import Graph diff --git a/docs/plugin_parsers.rst b/docs/plugin_parsers.rst index f199b9226..7b3c2a568 100644 --- a/docs/plugin_parsers.rst +++ b/docs/plugin_parsers.rst @@ -32,9 +32,8 @@ xml :class:`~rdflib.plugins.parsers.rdfxml.RDFXMLParser` Multi-graph IDs --------------- -Note that for correct parsing of multi-graph data, e.g. Trig, HexT, etc., into a ``ConjunctiveGraph`` or a ``Dataset``, -as opposed to a context-unaware ``Graph``, you will need to set the ``publicID`` of the ``ConjunctiveGraph`` a -``Dataset`` to the identifier of the ``default_context`` (default graph), for example:: +Note that for correct parsing of multi-graph data, e.g. Trig, HexT, etc., into a ``Dataset``, +as opposed to a context-unaware ``Graph``, you will need to set the ``publicID`` of the ``Dataset`` to the identifier of the ``default_context`` (default graph), for example:: d = Dataset() d.parse( diff --git a/rdflib/graph.py b/rdflib/graph.py index a8b1593ea..f268b5304 100644 --- a/rdflib/graph.py +++ b/rdflib/graph.py @@ -19,6 +19,9 @@ Conjunctive Graph ----------------- +.. warning:: + ConjunctiveGraph is deprecated, use :class:`~rdflib.graph.Dataset` instead. + A Conjunctive Graph is the most relevant collection of graphs that are considered to be the boundary for closed world assumptions. This boundary is equivalent to that of the store instance (which is itself @@ -249,6 +252,7 @@ import logging import pathlib import random +import warnings from io import BytesIO from typing import ( IO, @@ -1893,6 +1897,9 @@ class ConjunctiveGraph(Graph): """A ConjunctiveGraph is an (unnamed) aggregation of all the named graphs in a store. + .. warning:: + ConjunctiveGraph is deprecated, use :class:`~rdflib.graph.Dataset` instead. + It has a ``default`` graph, whose name is associated with the graph throughout its life. :meth:`__init__` can take an identifier to use as the name of this default graph or it will assign a @@ -1910,6 +1917,14 @@ def __init__( default_graph_base: Optional[str] = None, ): super(ConjunctiveGraph, self).__init__(store, identifier=identifier) + + if type(self) is ConjunctiveGraph: + warnings.warn( + "ConjunctiveGraph is deprecated, use Dataset instead.", + DeprecationWarning, + stacklevel=2, + ) + assert self.store.context_aware, ( "ConjunctiveGraph must be backed by" " a context aware store." ) diff --git a/test/test_conjunctivegraph/test_conjunctive_graph.py b/test/test_conjunctivegraph/test_conjunctive_graph.py index 19992a064..0fdb0af1d 100644 --- a/test/test_conjunctivegraph/test_conjunctive_graph.py +++ b/test/test_conjunctivegraph/test_conjunctive_graph.py @@ -57,6 +57,13 @@ def test_context_namespaces(): assert ("ex", ns) in g.namespace_manager.namespaces() +def test_deprecated(): + with pytest.warns( + DeprecationWarning, match="ConjunctiveGraph is deprecated, use Dataset instead." + ): + ConjunctiveGraph() + + def get_graph_ids_tests(): def check(kws): cg = ConjunctiveGraph() diff --git a/test/test_dataset/test_dataset.py b/test/test_dataset/test_dataset.py index a6e005c08..358230ea7 100644 --- a/test/test_dataset/test_dataset.py +++ b/test/test_dataset/test_dataset.py @@ -1,6 +1,7 @@ import os import shutil import tempfile +import warnings from test.data import CONTEXT1, LIKES, PIZZA, TAREK from test.utils.namespace import EGSCHEME @@ -261,3 +262,14 @@ def test_subgraph_without_identifier() -> None: ) == ("genid", genid_prefix) assert f"{subgraph.identifier}".startswith(genid_prefix) + + +def test_not_deprecated(): + """ + Ensure Dataset does not trigger the deprecation warning + from the ConjunctiveGraph superclass. + """ + + with warnings.catch_warnings(): + warnings.simplefilter("error") + Dataset() From 0ecc40009ae397c2798c0c08a2d751a1a9d2f8a7 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 19 Jun 2024 11:31:56 +1000 Subject: [PATCH 13/13] [pre-commit.ci] pre-commit autoupdate (#2777) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.4.1 → v0.4.9](https://github.com/astral-sh/ruff-pre-commit/compare/v0.4.1...v0.4.9) - [github.com/psf/black-pre-commit-mirror: 24.4.0 → 24.4.2](https://github.com/psf/black-pre-commit-mirror/compare/24.4.0...24.4.2) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 51e1456fb..ca8b2025c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,13 +7,13 @@ ci: # https://pre-commit.com/#adding-pre-commit-plugins-to-your-project repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.4.1 + rev: v0.4.9 hooks: - id: ruff args: ["--fix"] - repo: https://github.com/psf/black-pre-commit-mirror # WARNING: version should be the same as in `pyproject.toml` - rev: "24.4.0" + rev: "24.4.2" hooks: - id: black pass_filenames: false