Skip to content

Commit dfa071c

Browse files
authored
Merge branch 'main' into sparql-connector-default-graph
2 parents 0818e37 + bb17072 commit dfa071c

File tree

16 files changed

+300
-166
lines changed

16 files changed

+300
-166
lines changed

.github/dependabot.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ updates:
55
schedule:
66
interval: weekly
77
open-pull-requests-limit: 10
8-
versioning-strategy: widen
8+
# todo: change this to widen when Dependabot adds widen back to Pip ecosystem
9+
# see https://github.com/dependabot/dependabot-core/pull/10194
10+
versioning-strategy: auto
911
ignore:
1012
- dependency-name: sphinx
1113
versions:
@@ -28,7 +30,7 @@ updates:
2830
directory: docker/latest/
2931
schedule:
3032
interval: weekly
31-
versioning-strategy: widen
33+
versioning-strategy: auto
3234
- package-ecosystem: docker
3335
directory: docker/unstable/
3436
schedule:
@@ -37,4 +39,4 @@ updates:
3739
directory: devtools/
3840
schedule:
3941
interval: weekly
40-
versioning-strategy: widen
42+
versioning-strategy: auto

docker/latest/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM docker.io/library/python:3.12.4-slim@sha256:f11725aba18c19664a408902103365eaf8013823ffc56270f921d1dc78a198cb
1+
FROM docker.io/library/python:3.12.4-slim@sha256:52f92c54e879539342692d20a4bea99516d4a2eb3cd16dfbb4e4b964aa8becaa
22

33
COPY docker/latest/requirements.txt /var/tmp/build/
44

docker/unstable/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM docker.io/library/python:3.12.2-slim@sha256:36d57d7f9948fefe7b6092cfe8567da368033e71ba281b11bb9eeffce3d45bc6
1+
FROM docker.io/library/python:3.12.4-slim@sha256:52f92c54e879539342692d20a4bea99516d4a2eb3cd16dfbb4e4b964aa8becaa
22

33
# This file is generated from docker:unstable in Taskfile.yml
44
COPY var/requirements.txt /var/tmp/build/

poetry.lock

Lines changed: 181 additions & 130 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ pyparsing = ">=2.1.0,<4"
4444
berkeleydb = {version = "^18.1.0", optional = true}
4545
networkx = {version = ">=2,<4", optional = true}
4646
html5lib = {version = "^1.0", optional = true}
47-
lxml = {version = "^4.3.0", optional = true}
47+
lxml = {version = ">=4.3,<6.0", optional = true}
4848

4949
[tool.poetry.group.dev.dependencies]
5050
black = "24.4.2"
@@ -60,10 +60,10 @@ setuptools = ">=68,<72"
6060
wheel = ">=0.42,<0.44"
6161

6262
[tool.poetry.group.docs.dependencies]
63-
sphinx = "^7.1.1"
63+
sphinx = ">=7.1.2,<8"
6464
myst-parser = ">=2,<4"
6565
sphinxcontrib-apidoc = ">=0.3,<0.6"
66-
sphinx-autodoc-typehints = "^1.17.1"
66+
sphinx-autodoc-typehints = ">=1.25.3,<=2.0.1"
6767
typing-extensions = "^4.5.0"
6868

6969
[tool.poetry.group.lint.dependencies]

rdflib/extras/infixowl.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1329,7 +1329,10 @@ def subSumpteeIds(self): # noqa: N802
13291329
# predicate=RDFS.subClassOf,object=self.identifier):
13301330
# yield Class(s,skipOWLClassMembership=True)
13311331

1332-
def __repr__(self, full=False, normalization=True):
1332+
def __repr__(self):
1333+
return self.manchesterClass(full=False, normalization=True)
1334+
1335+
def manchesterClass(self, full=False, normalization=True): # noqa: N802
13331336
"""
13341337
Returns the Manchester Syntax equivalent for this class
13351338
"""

rdflib/graph.py

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,11 @@ class Graph(Node):
433433
For more on named graphs, see: http://www.w3.org/2004/03/trix/
434434
"""
435435

436+
context_aware: bool
437+
formula_aware: bool
438+
default_union: bool
439+
base: Optional[str]
440+
436441
def __init__(
437442
self,
438443
store: Union[Store, str] = "default",
@@ -1393,9 +1398,9 @@ def parse(
13931398
:doc:`Security Considerations </security_considerations>`
13941399
documentation.
13951400
1396-
:param source: An `InputSource`, file-like object, `Path` like object,
1397-
or string. In the case of a string the string is the location of the
1398-
source.
1401+
:param source: An `xml.sax.xmlreader.InputSource`, file-like object,
1402+
`pathlib.Path` like object, or string. In the case of a string the string
1403+
is the location of the source.
13991404
:param location: A string indicating the relative or absolute URL of the
14001405
source. `Graph`'s absolutize method is used if a relative location
14011406
is specified.
@@ -1910,6 +1915,8 @@ class ConjunctiveGraph(Graph):
19101915
All queries are carried out against the union of all graphs.
19111916
"""
19121917

1918+
default_context: _ContextType
1919+
19131920
def __init__(
19141921
self,
19151922
store: Union[Store, str] = "default",
@@ -2227,8 +2234,9 @@ def parse(
22272234
22282235
See :meth:`rdflib.graph.Graph.parse` for documentation on arguments.
22292236
2230-
If the source is in a format that does not support named graphs it's triples
2231-
will be added to the default graph (i.e. `Dataset.default_context`).
2237+
If the source is in a format that does not support named graphs its triples
2238+
will be added to the default graph
2239+
(i.e. :attr:`ConjunctiveGraph.default_context`).
22322240
22332241
:Returns:
22342242
@@ -2254,7 +2262,7 @@ def parse(
22542262
the ``publicID`` parameter will also not be used as the name for the
22552263
graph that the data is loaded into, and instead the triples from sources
22562264
that do not support named graphs will be loaded into the default graph
2257-
(i.e. `ConjunctionGraph.default_context`).
2265+
(i.e. :attr:`ConjunctiveGraph.default_context`).
22582266
"""
22592267

22602268
source = create_input_source(
@@ -2488,8 +2496,9 @@ def parse(
24882496
24892497
The source is specified using one of source, location, file or data.
24902498
2491-
If the source is in a format that does not support named graphs it's triples
2492-
will be added to the default graph (i.e. `Dataset.default_context`).
2499+
If the source is in a format that does not support named graphs its triples
2500+
will be added to the default graph
2501+
(i.e. :attr:`.Dataset.default_context`).
24932502
24942503
.. caution::
24952504
@@ -2510,7 +2519,7 @@ def parse(
25102519
the ``publicID`` parameter will also not be used as the name for the
25112520
graph that the data is loaded into, and instead the triples from sources
25122521
that do not support named graphs will be loaded into the default graph
2513-
(i.e. `ConjunctionGraph.default_context`).
2522+
(i.e. :attr:`.Dataset.default_context`).
25142523
"""
25152524

25162525
c = ConjunctiveGraph.parse(

rdflib/namespace/_WGS.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class WGS(DefinedNamespace):
77
Basic Geo (WGS84 lat/long) Vocabulary
88
99
The HTML Specification for the vocabulary can be found
10-
`here <https://www.w3.org/2003/01/geo/>`.
10+
here <https://www.w3.org/2003/01/geo/>.
1111
"""
1212

1313
_NS = Namespace("https://www.w3.org/2003/01/geo/wgs84_pos#")

rdflib/namespace/__init__.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,13 @@ def __repr__(self) -> str:
233233
"_underscore_num",
234234
}
235235

236+
# Some libraries probe classes for certain attributes or items.
237+
# This is a list of those attributes and items that should be ignored.
238+
_IGNORED_ATTR_LOOKUP: Set[str] = {
239+
"_pytestfixturefunction", # pytest tries to look this up on Defined namespaces
240+
"_partialmethod", # sphinx tries to look this up during autodoc generation
241+
}
242+
236243

237244
class DefinedNamespaceMeta(type):
238245
"""Utility metaclass for generating URIRefs with a common prefix."""
@@ -246,10 +253,13 @@ class DefinedNamespaceMeta(type):
246253
@lru_cache(maxsize=None)
247254
def __getitem__(cls, name: str, default=None) -> URIRef:
248255
name = str(name)
256+
249257
if name in _DFNS_RESERVED_ATTRS:
250258
raise AttributeError(
251259
f"DefinedNamespace like object has no attribute {name!r}"
252260
)
261+
elif name in _IGNORED_ATTR_LOOKUP:
262+
raise KeyError()
253263
if str(name).startswith("__"):
254264
# NOTE on type ignore: This seems to be a real bug, super() does not
255265
# implement this method, it will fail if it is ever reached.
@@ -265,6 +275,8 @@ def __getitem__(cls, name: str, default=None) -> URIRef:
265275
return cls._NS[name]
266276

267277
def __getattr__(cls, name: str):
278+
if name in _IGNORED_ATTR_LOOKUP:
279+
raise AttributeError()
268280
return cls.__getitem__(name)
269281

270282
def __repr__(cls) -> str:

rdflib/plugins/parsers/hext.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,11 @@ def _parse_hextuple(
7272

7373
# 6 - context
7474
if tup[5] is not None:
75-
c = URIRef(tup[5])
75+
c = (
76+
BNode(tup[5].replace("_:", ""))
77+
if tup[5].startswith("_:")
78+
else URIRef(tup[5])
79+
)
7680
# type error: Argument 1 to "add" of "ConjunctiveGraph" has incompatible type "Tuple[Union[URIRef, BNode], URIRef, Union[URIRef, BNode, Literal], URIRef]"; expected "Union[Tuple[Node, Node, Node], Tuple[Node, Node, Node, Optional[Graph]]]"
7781
cg.add((s, p, o, c)) # type: ignore[arg-type]
7882
else:

0 commit comments

Comments
 (0)