@classmethod
def fromWikibase(cls, wb):
    """
        Create a WbQuanity from the JSON data given by the Wikibase API.

        @param wb: Wikibase JSON
        @type wb: dict
        @rtype: pywikibot.WbQuanity
        """
    amount = cls._todecimal(wb['amount'])
    upperBound = cls._todecimal(wb.get('upperBound'))
    lowerBound = cls._todecimal(wb.get('lowerBound'))
    error = None
    if upperBound and lowerBound:
        error = upperBound - amount, amount - lowerBound
    return cls(amount, wb['unit'], error)
