-
Notifications
You must be signed in to change notification settings - Fork 123
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
enhance warning for missing rdflib-jsonld #38
Comments
I'm not a big fan of warnings. I don't see much value in them. I think it's better to just work until we can't at which point exception should be raised. Warnings are used to mask inconsistencies in design. I think it is ok to tweak this for 1.7 (no need to change behaviour in 1.6). I would prefer to get rid of warnings in 2.x |
I agree - this warning bugs me too. On Thu, Jul 31, 2014 at 1:23 PM, Alexey Zakhlestin <notifications@github.com
|
The reason why that's a warning it's because there is not reason in the protocol whether a SPARQL endpoint should provide JSON-LD support. The warning is not shown at request time, just at the wrapper initialization to dynamically setup the allowed formats. Therefore it can't be an exception. But I'm happy to list to idea how to properly warn the user about such limitation of the environment where the code runs. From my point of view these are the options:
I'm not happy with the last one, but the other two options sound good for me. |
@wikier I think the consensus is, that it's better to remove the warning and throw exception just when this functionality is requested (but can't be provided). additionally, there might be a method for explicit check: def supports(functionality: str) -> bool:
if str == JSONLD:
return JSONLD in _allowedFormats
… (I used py3k type-hints syntax to clarify intentions, obviously, we can't have it in actual code) |
…en setting a not allowed format (issue #38)
OK, according the feedback, the changes has been introduced. Please @joernhees, @indeyets and @mgaldzic, check if they implement the expected behavior to close this issue. |
@wikier 👍 much better, i left an idea for improvement in the code which raises the exception |
I think we can consider this resolved, isn't it? |
👍 thanks a lot :) |
Currently a default install of SPARQLWrapper issues this warning for every user:
Several issues with this:
rdflib-jsonld
package... this might seem obvious to us, but newcomers might be quite confused without this hint.setReturnFormat(JSONLD)
?The text was updated successfully, but these errors were encountered: