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

DCTERMS.format not working #932

Closed
nicholascar opened this issue Sep 11, 2019 · 3 comments
Closed

DCTERMS.format not working #932

nicholascar opened this issue Sep 11, 2019 · 3 comments
Labels
bug Something isn't working
Milestone

Comments

@nicholascar
Copy link
Member

When using the inbuilt DCTERMS namespace, from rdflib.namespace import DCTERMS, an error is thrown if the following triple is added to a graph:

g.add((r, DCTERMS.format, Literal('application/pdf')))

error: AssertionError: Predicate <built-in method format of Namespace object at 0x10e8e2de0> must be an rdflib term

Presumably there's a Python reserved word 'format' collision somewhere.

Have to do this as a workaround:

g.add((r, URIRef('http://purl.org/dc/terms/format'), Literal('application/pdf')))
@nicholascar nicholascar added the bug Something isn't working label Sep 11, 2019
@nicholascar nicholascar added this to the rdflib 5.0.0 milestone Sep 11, 2019
@nicholascar nicholascar changed the title DCTERMS format not working DCTERMS.format not working Sep 11, 2019
@tgbugs
Copy link
Contributor

tgbugs commented Sep 11, 2019

Does DCTERMS['format'] work?

@nicholascar
Copy link
Member Author

Oh, I think it does. And, I think I’ve even used it in the past...

Happy to have this issue closed as it’s really, really minor unless someone’s really keen to deal with it for fun.

@nicholascar
Copy link
Member Author

I'm closing my own issue here as it's very minor and two work-around are given in comments.

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