/** * Checks if the parsed Entity can be wrapped by this EntityMapping wrapper. * Currently it checks only if the rdf:type entityhub:EntityMapping is * present * @param entity the entity to check * @return */ public static boolean isValid(Entity entity){ if(entity != null){ Set<Reference> types = ModelUtils.asSet(entity.getRepresentation().getReferences(RDF_TYPE)); return types.contains(ENTITY_MAPPING_TYPE); } else { return false; } } /**
/** * Checks if the parsed Entity can be wrapped by this EntityMapping wrapper. * Currently it checks only if the rdf:type entityhub:EntityMapping is * present * @param entity the entity to check * @return */ public static boolean isValid(Entity entity){ if(entity != null){ Set<Reference> types = ModelUtils.asSet(entity.getRepresentation().getReferences(RDF_TYPE)); return types.contains(ENTITY_MAPPING_TYPE); } else { return false; } } /**
if(expectedFields != null){ //validate fields for(String field : expectedFields){ Set<Object> expectedFieldValues = ModelUtils.asSet( data.representations.get(result.getId()).get(field)); Iterator<Object> fieldValues = result.get(field);