Git Product home page Git Product logo

Comments (8)

indeyets avatar indeyets commented on May 27, 2024

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.

mgaldzic avatar mgaldzic commented on May 27, 2024

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.

wikier avatar wikier commented on May 27, 2024

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.

indeyets avatar indeyets commented on May 27, 2024

@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.

wikier avatar wikier commented on May 27, 2024

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.

joernhees avatar joernhees commented on May 27, 2024

@wikier 👍 much better, i left an idea for improvement in the code which raises the exception

from sparqlwrapper.

wikier avatar wikier commented on May 27, 2024

I think we can consider this resolved, isn't it?

from sparqlwrapper.

joernhees avatar joernhees commented on May 27, 2024

👍 thanks a lot :)

from sparqlwrapper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.