class JsonApiResource extends JsonApiResourceIdentifier implements JsonLinks, JsonApiData {

	@Override
	public URI getRelationshipUri(JsonApiIdentifiable related) {
		URI relationshipURI = null;

		for (Map.Entry<String, JsonApiRelationship> entry : relationships.entrySet()) {
			JsonApiRelationship match = entry.getValue();
			if (match.containsEntity(related)) {
				if (match.getData().size() == 1) { //the relationship contains a single resource object
					relationshipURI = match.getLinks().get(RELATED);
				} else { //the relationship contains a collection of resource objects
					relationshipURI = match.getLinks().get(RELATED).resolve(related.getId());
				}
				break;
			}
		}

		return relationshipURI;
	}

	  JsonApiResource(JsonApiIdentifiable entity, URI uri);

}