public Equivalence getEquivalence(JsonElement json) {
        Equivalence equivalence;
        String uriString = json.getAsJsonObject().getAsJsonPrimitive(URI).getAsString();
        URI uri;
        try {
            uri = new URI(urlEncode(uriString));
        } catch (Exception e) {
            throw new JsonParseException(String.format(EXCEPTION_MESSAGE, uriString));
        }
        equivalence = new Equivalence(uri);
        JsonArray duplicates = json.getAsJsonObject().getAsJsonArray(DUPLICATES);
        for (int i = 0; i < duplicates.size(); i++) {
            try {
                equivalence.addDuplicate(new URI(urlEncode(duplicates.get(i).getAsString())));
            } catch (Exception e) {
                // if an equivalent URI is not well-formed it's better to do not add it, let's go on
                continue;
            }
        }
        return equivalence;
    }