Skip to content

prov ontology is given 'default' prefix #61

@bbartley

Description

@bbartley

There is an inconsistency in how different versions of rdflib handle namespace prefixes that cause the prov ontology to be given a the default1 prefix instead of prov. This causes an issue for UML factory rendering class qnames correctly, and problems for testing.

This may be related to https://stackoverflow.com/questions/65818401/namespace-binding-in-rdflib

Here is a minimal case

import rdflib
  

def check_namespaces(graph):
    prefixes = [p for p, ns in graph.namespaces()]
    if 'default1' in prefixes:
        print(prefixes)
        return False
    return True

# This fails with rdflib 6.0.2 but passess with 6.1.1
g=rdflib.Graph(base='http://sbols.org/v3#')
g.parse('sbol_factory/rdf/prov-o.owl')
assert check_namespaces(g) is True
g.parse('sbol_factory/rdf/sbolowl3.rdf')
assert check_namespaces(g) is True

# This fails with rdflib 6.1.1 but passes with 6.0.2
g=rdflib.Graph(base='http://sbols.org/v3#')
g.parse('sbol_factory/rdf/sbolowl3.rdf')
assert check_namespaces(g) is True
g.parse('sbol_factory/rdf/prov-o.owl')
assert check_namespaces(g) is True

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions