Skip to content

Bad relative URI resolution in SPARQL #523

Closed
@pchampin

Description

@pchampin

When using an explicit base URI in SPARQL queries, relative URIs are not correctly resolved.
Instead, the relative URI is simply appended at the end of the base URI.

Example:

import rdflib

g = rdflib.Graph()
r = g.query("SELECT (<../baz> as ?test) WHERE {}",
            base=rdflib.URIRef("http://example.org/foo/bar"))
print r.serialize(format="csv")

# expected result:
#test
#http://example.org/baz

# actual result;
#test
#http://example.org/foo/bar../baz

Metadata

Metadata

Assignees

No one assigned

    Labels

    SPARQLbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions