Comments (8)
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
from sparqlwrapper.
I agree - this warning bugs me too.
Should be thrown as an exception when I try to retrieve JSON-LD but can not.
On Thu, Jul 31, 2014 at 1:23 PM, Alexey Zakhlestin <[email protected]
wrote:
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—
Reply to this email directly or view it on GitHub
#38 (comment).
from sparqlwrapper.
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:
- keep the warning, so the user notice it and can install such optional dependency
- move the warning to
setReturnFormat()
(now silently ignores invalid formats) - remove the warning at all
I'm not happy with the last one, but the other two options sound good for me.
from sparqlwrapper.
@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)
from sparqlwrapper.
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.
from sparqlwrapper.
@wikier 👍 much better, i left an idea for improvement in the code which raises the exception
from sparqlwrapper.
I think we can consider this resolved, isn't it?
from sparqlwrapper.
👍 thanks a lot :)
from sparqlwrapper.
Related Issues (20)
- Next Release? HOT 20
- Introduce Lint tools
- Convert SPARQLWrapper.SmartWrapper to pandas dataframe HOT 6
- Removing https://rdflib.github.io/sparqlwrapper HOT 4
- Documentation format HOT 4
- using "describe" in a comment leads to error HOT 12
- Organize old PRs/Issues
- Make tests faster and more reliable.
- TLS changes in Python 3.10, insecure endpoint
- Allow earlier versions of rdflib HOT 2
- Test failures probably due to remote service issues
- Cannot install with conda for Python >=3.10 HOT 2
- QueryBadFormed: A bad request has been sent to the endpoint
- WikiData Not Returning CSV HOT 1
- Can't use SPARQLWrapper in nix-shell (somewhat OT)
- AWS Signature Version 4 Authentication Support HOT 2
- Align query result types with rdflib
- Unable to query the rdf:type HOT 3
- 405 (Method not allowed) for SELECT QUERY with # street address in comment HOT 2
- GraphDB 10.2.2: b'Missing parameter: query' on INSERT HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sparqlwrapper.