A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/RDFLib/rdflib/issues/2077 below:

multiple prefixes for same IRI not supported? · Issue #2077 · RDFLib/rdflib · GitHub

I have a standard block of SPARQL prefixes that I use in some of my code, and I started getting test failures when I tried to update from rdflib 6.1.1 to rdflib 6.2.0. I noticed that the problem seems to be that somehow, support for multiple prefixes that resolve to the same URI seems to have been dropped.

Example block at the beginning of a SPARQL query:

PREFIX foo: <http://example.com#>
PREFIX bar: <http://example.com#>

The above should, as far as I know, be supported - but in rdflib 6.2.0, the foo: prefix will not be recognized when used in the query - and in fact, during parsing of the query, the foo: prefix is deleted.

The issue seems to be somewhere in rdfllib.namespace.__init__.py, in NamespaceManager.bind() - but I can't quite pin down what change is causing this new issue.

I do see this comment in the code, which was present in 6.1.1 but maybe it wasn't working as described?

        # Check if the bound_namespace contains a URI
        # and if so convert it into a URIRef for comparison
        # This is to prevent duplicate namespaces with the
        # same URI

however, if I correctly understand the intent behind that comment, it seems problematic - there is nothing wrong (as far as I know?) with multiple prefixes for the same URI in SPARQL.

aucampia, sirish-eai, severin-lemaignan, lsharma-202 and white-geckoaucampia


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4