public static function fromJsonLd(JsonObject $element)
    {
        if (false === property_exists($element, '@value')) {
            return false;
        }

        $value = $element->{'@value'};
        $type = (property_exists($element, '@type'))
            ? $element->{'@type'}
            : null;
        $language = (property_exists($element, '@language'))
            ? $element->{'@language'}
            : null;

        if (is_int($value) || is_float($value)) {
            if (($value != (int) $value) || (RdfConstants::XSD_DOUBLE === $type)) {
                $value = preg_replace('/(0{0,14})E(\+?)/', 'E', sprintf('%1.15E', $value));

                if ((null === $type) && (null === $language)) {
                    return new TypedValue($value, RdfConstants::XSD_DOUBLE);
                }
            } else {
                $value = sprintf('%d', $value);
                if ((null === $type) && (null === $language)) {
                    return new TypedValue($value, RdfConstants::XSD_INTEGER);
                }
            }
        } elseif (is_bool($value)) {
            $value = ($value) ? 'true' : 'false';

            if ((null === $type) && (null === $language)) {
                return new TypedValue($value, RdfConstants::XSD_BOOLEAN);
            }
        } elseif (false === is_string($value)) {
            return false;
        }

        // @type gets precedence
        if ((null === $type) && (null !== $language)) {
            return new LanguageTaggedString($value, $language);
        }

        return new TypedValue($value, (null === $type) ? RdfConstants::XSD_STRING : $type);
    }