Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prov ontology is given 'default' prefix #61

Open
bbartley opened this issue Jan 13, 2022 · 1 comment
Open

prov ontology is given 'default' prefix #61

bbartley opened this issue Jan 13, 2022 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@bbartley
Copy link
Contributor

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
@jakebeal jakebeal added the bug Something isn't working label Jan 27, 2022
@jakebeal
Copy link
Contributor

Next step: file an issue with rdflib

@jakebeal jakebeal added this to the 1.1 milestone Jan 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants