@Override public Representation process(Representation source) { if(mapper == null){ throw new IllegalStateException("The mapper is not initialised. One must call setConfiguration to configure the FieldMapper!"); } if(source == null){ return null; } else { return mapper.applyMappings(source, vf.createRepresentation(source.getId()), vf); } } /**
@Override public Representation process(Representation source) { if(mapper == null){ throw new IllegalStateException("The mapper is not initialised. One must call setConfiguration to configure the FieldMapper!"); } if(source == null){ return null; } else { return mapper.applyMappings(source, vf.createRepresentation(source.getId()), vf); } } /**
try { RdfRepresentation clerezzaRep = valueFactory.createRdfRepresentation(uri, graph); fieldMapper.applyMappings(rep, clerezzaRep, valueFactory); if(log.isTraceEnabled()){ log.trace("dereferenced via Mappings {}", ModelUtils.getRepresentationInfo(clerezzaRep));
/** * Applies the mappings defined by the {@link #baseMapper} and the {@link #additionalMapper} * to the parsed Representation. * * @param yard The yard (local reference to avoid syncronization) * @param representation The representation to map * @return the mapped representation */ private Representation applyCacheMappings(Yard yard, Representation representation) { long start = System.currentTimeMillis(); Representation mapped = null; ValueFactory valueFactory = getValueFactory(); if (baseMapper != null) { mapped = yard.getValueFactory().createRepresentation(representation.getId()); baseMapper.applyMappings(representation, mapped,valueFactory); } if (additionalMapper != null) { if (mapped == null) { mapped = yard.getValueFactory().createRepresentation(representation.getId()); } additionalMapper.applyMappings(representation, mapped,valueFactory); } log.info(" -- applied mappings in " + (System.currentTimeMillis() - start) + "ms"); return mapped != null ? mapped : representation; }
/** * Applies the mappings defined by the {@link #baseMapper} and the {@link #additionalMapper} * to the parsed Representation. * * @param yard The yard (local reference to avoid syncronization) * @param representation The representation to map * @return the mapped representation */ private Representation applyCacheMappings(Yard yard, Representation representation) { long start = System.currentTimeMillis(); Representation mapped = null; ValueFactory valueFactory = getValueFactory(); if (baseMapper != null) { mapped = yard.getValueFactory().createRepresentation(representation.getId()); baseMapper.applyMappings(representation, mapped,valueFactory); } if (additionalMapper != null) { if (mapped == null) { mapped = yard.getValueFactory().createRepresentation(representation.getId()); } additionalMapper.applyMappings(representation, mapped,valueFactory); } log.info(" -- applied mappings in " + (System.currentTimeMillis() - start) + "ms"); return mapped != null ? mapped : representation; }
/** * Stores the parsed representation to the Yard and also applies the * configured {@link #getFieldMapper() FieldMappings}. * @param The representation to store */ @Override public void store(Representation representation) throws ManagedSiteException { try { Yard yard = getYard(); fieldMapper.applyMappings(representation, representation, yard.getValueFactory()); yard.store(representation); } catch (YardException e) { throw new ManagedSiteException(e.getMessage(), e); } } /**
mapper.applyMappings(remoteEntity.getRepresentation(), localEntity.getRepresentation(),valueFactory);
mapper.applyMappings(remoteEntity.getRepresentation(), localEntity.getRepresentation(),valueFactory);