Barb Banbury

Still developing

The EOL Profile Newsfeed contains comments left for its owner by other members, EOL Community invitations, and gathers updates associated with the items in the owner's EOL watch list.

Add a new comment

  • Profile picture of Roderic Page who took this action.

    Roderic Page commented on "EOL API Discussion Group":

    @Anne Thessen: I'm tempted to ask why you want to consume XML, which is a truly hideous format. EOL also outputs JSON, which is much nicer to work with.

    But since that's probably not the answer you're looking I've posted some code here: https://gist.github.com/rdmpage/5143326 It's in PHP (I kick it old skool) but it may help. I think there are two issues that you might be facing. The first is that I don't think 'response/taxon/dataObject/dc:description' is a field that exists, at least not in the example I quickly looked at (e.g., http://bit.ly/ZFfx8r ). The second is that you'll need to declare the default namespace ("http://www.eol.org/transfer/content/1.0") and add this to your XPath queries. For example, if you add 'eol':'http://www.eol.org/transfer/content/1.0' to the namespace map, and insert the "eol" prefix in your XPath query (e.g., "/eol:response/eol:dataObject/eol:dataObjectID"), things should work.

    If a service provides a choice between JSON and XML, JSON is almost always going to be the easier choice to use. XML is overkill in most cases, and a pain to work with. Hope this helps.

    over 1 year ago

  • Profile picture of Patrick Leary who took this action.

    Patrick Leary commented on "EOL API Discussion Group":

    @Anne Thessen: Hi Anne. If you continue to have troubles with XML and you do not need URIs and namespaces, then you could try the JSON response format http://eol.org/api/pages/1.json?details=1 . I am not a Python developer, but a quick search brought up http://docs.python.org/2/library/json.html which gives examples of how to decode JSON. If you can fetch the JSON result then pass it to json.loads, that might be easier to work with.

    over 1 year ago

  • Profile picture of Anne Thessen who took this action.

    Anne Thessen commented on "EOL API Discussion Group":

    @Roderic Page: Thanks for the suggestion. When I use the purl URI I lose the complaints about the dc:prefix, but now it doesn't pick up anything. I'll keep pounding away at it, but if you've got a bit of code working I'd really appreciate it if you would send it along. Thanks!

    over 1 year ago

  • Profile picture of Roderic Page who took this action.

    Roderic Page commented on "EOL API Discussion Group":

    @Anne Thessen: Anne, any reason you are using "http://dublincore.org/documents/dces" as the namespace for Dublin Core? The EOL API uses "http://purl.org/dc/elements/1.1/" for the Dublin Core namespace, which AFAIK is the current namespace URI. If you use a different namespace URI the XML parser is likely to fail to recognise terms from that namespace.

    over 1 year ago

  • Profile picture of Anne Thessen who took this action.

    Anne Thessen commented on "EOL API Discussion Group":

    Hi I'm new to this community. I have a question about parsing the xml output from the API. I'm using python to pick out the bits I need, but it doesn't seem to like the dc: prefix. I've tried to define it using namespaces, but it is still not happy. Has anyone else run into this problem? Below is what I'm doing. Any advice is appreciated. import xml.etree.ElementTree as ET nsmap = {'dc':'http://dublincore.org/documents/dces'} tree = ET.parse('test.xml') identifier = tree.findtext('response/taxon/dataObject/dc:identifier', namespace=nsmap) description = tree.findtext('response/taxon/dataObject/dc:description', namespace=nsmap) print (identifier, description)

    over 1 year ago

  • Profile picture of Anne Thessen who took this action.
    Anne Thessen joined the community "EOL API Discussion Group".

    over 1 year ago

  • Profile picture of Barb Banbury who took this action.

    Barb Banbury commented on "EOL API Discussion Group":

    @Patrick Leary: Great news, thanks so much! I look forward to the fix!

    over 1 year ago

  • Profile picture of Patrick Leary who took this action.

    Patrick Leary commented on "EOL API Discussion Group":

    @Barb Banbury: Hi Barb - thanks for bringing this to our attention. We found the problem (likely introduced about two weeks ago) and submitted a fix for it. We will be releasing some new code on Thursday morning, and by about noon Eastern time the fix will be live and API calls which include the IUCN status will be working. Thanks again

    over 1 year ago

  • Profile picture of Cyndy Parr who took this action.

    Cyndy Parr commented on "EOL API Discussion Group":

    @Barb Banbury: I see this problem too, Barb. I've asked a developer to respond.

    over 1 year ago

  • Profile picture of Barb Banbury who took this action.

    Barb Banbury commented on "EOL API Discussion Group":

    @Barb Banbury: Also, the iucn status worked for me back when it was binary, so maybe something is awry with the new boolean setting?

    over 1 year ago

  • Profile picture of Barb Banbury who took this action.

    Barb Banbury commented on "EOL API Discussion Group":

    Hi all, happy to be part of this group. I didn't read all the comments below, but I am struggling with using the iucn status. When iucn=true, I get an error message back stating "error": "Sorry, there was a problem". It works if set to false. You can try it out under "Test It Out" in API: Pages (http://eol.org/api/docs/pages).

    over 1 year ago

  • Profile picture of Barb Banbury who took this action.
    Barb Banbury joined the community "EOL API Discussion Group".

    over 1 year ago

  • Profile picture of Rachel Berquist who took this action.
    Rachel Berquist joined the community "EOL Research Ideas".

    over 1 year ago

  • Profile picture of Barb Banbury who took this action.
    Barb Banbury joined the community "EOL Research Ideas".

    almost 2 years ago