Bug 2343978

Summary: python-rdflib fails to build with Python 3.14: AttributeError: term 'value' not in namespace 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'
Product: [Fedora] Fedora Reporter: Karolina Surma <ksurma>
Component: python-rdflibAssignee: Nils Philippsen <nphilipp>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: djc, ksurma, maxwell, mhroncok, negativo17, nphilipp, pingou
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-rdflib-7.1.4-3.fc43 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-06-15 21:21:52 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2322407    

Description Karolina Surma 2025-02-05 14:32:20 UTC
python-rdflib fails to build with Python 3.14.0a4.
+ sphinx-build-3 -b html -d docs/_build/doctree docs docs/_build/html
Running Sphinx v8.1.3

Configuration error:
There is a programmable error in your configuration file:

Traceback (most recent call last):
  File "/usr/lib/python3.14/site-packages/sphinx/config.py", line 529, in eval_config_file
    exec(code, namespace)  # NoQA: S102
    ~~~~^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/python-rdflib-7.1.3-build/rdflib-7.1.3/docs/conf.py", line 23, in <module>
    import rdflib
  File "/builddir/build/BUILD/python-rdflib-7.1.3-build/BUILDROOT/usr/lib/python3.14/site-packages/rdflib/__init__.py", line 169, in <module>
    from rdflib.graph import ConjunctiveGraph, Dataset, Graph
  File "/builddir/build/BUILD/python-rdflib-7.1.3-build/BUILDROOT/usr/lib/python3.14/site-packages/rdflib/graph.py", line 292, in <module>
    from rdflib.resource import Resource
  File "/builddir/build/BUILD/python-rdflib-7.1.3-build/BUILDROOT/usr/lib/python3.14/site-packages/rdflib/resource.py", line 296, in <module>
    class Resource:
    ...<164 lines>...
            return "Resource(%s,%s)" % (self._graph, self._identifier)
  File "/builddir/build/BUILD/python-rdflib-7.1.3-build/BUILDROOT/usr/lib/python3.14/site-packages/rdflib/resource.py", line 379, in Resource
    def value(self, p=RDF.value, o=None, default=None, any=True):
                      ^^^^^^^^^
  File "/builddir/build/BUILD/python-rdflib-7.1.3-build/BUILDROOT/usr/lib/python3.14/site-packages/rdflib/namespace/__init__.py", line 285, in __getattr__
    return cls.__getitem__(name)
           ~~~~~~~~~~~~~~~^^^^^^
  File "/builddir/build/BUILD/python-rdflib-7.1.3-build/BUILDROOT/usr/lib/python3.14/site-packages/rdflib/namespace/__init__.py", line 268, in __getitem__
    raise AttributeError(f"term '{name}' not in namespace '{cls._NS}'")
AttributeError: term 'value' not in namespace 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'

https://docs.python.org/3.14/whatsnew/3.14.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.14/fedora-rawhide-x86_64/08609185-python-rdflib/

For all our attempts to build python-rdflib with Python 3.14, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.14/package/python-rdflib/

Testing and mass rebuild of packages is happening in copr.
You can follow these instructions to test locally in mock if your package builds with Python 3.14:
https://copr.fedorainfracloud.org/coprs/g/python/python3.14/

Let us know here if you have any questions.

Python 3.14 is planned to be included in Fedora 43.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.14.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires),
so if this package is required a lot, it's important for us to get it fixed soon.

We'd appreciate help from the people who know this package best,
but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Nils Philippsen 2025-03-20 23:39:59 UTC
I’ve examined this and found that it fails for two reasons:

- Directly accessing `__annotations__` fails => should use {annotationlib,inspect}.get_annotations() instead, I’ll submit a PR upstream.
- One plugin (sparql) uses `NotImplemented` in boolean contexts for operator implementations of certain types, this was deprecated since Python 3.9 and fails now. I’ll file an issue.

Comment 2 Maxwell G 2025-06-11 02:23:04 UTC
I submitted https://src.fedoraproject.org/rpms/python-rdflib/pull-request/7 as temporary fix