congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
FieldMapper
Code IndexAdd Tabnine to your IDE (free)

How to use
FieldMapper
in
org.apache.stanbol.entityhub.servicesapi.mapping

Best Java code snippets using org.apache.stanbol.entityhub.servicesapi.mapping.FieldMapper (Showing top 20 results out of 315)

origin: org.apache.stanbol/org.apache.stanbol.entityhub.indexing.core

@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);
  }
}
/**
origin: apache/stanbol

/**
 * Getter for the base mappings used by this Cache. Modifications on the
 * returned object do not have any influence on the mappings, because this
 * method returns a clone. Use {@link #setBaseMappings(FieldMapper)} to
 * change the used base mappings. However make sure you understand the
 * implications of changing the base mappings as described in the
 * documentation of the setter method
 *
 * @return A clone of the base mappings or <code>null</code> if no base
 *         mappings are defined
 */
@Override
public final FieldMapper getBaseMappings() {
  return baseMapper == null ? null : baseMapper.clone();
}
origin: apache/stanbol

public FiledMapperProcessor(FieldMapper mapper, NamespacePrefixService nps, ValueFactory vf){
  this(nps,vf);
  if(mapper == null){
    throw new IllegalArgumentException("The parsed FieldMapper MUST NOT be NULL!");
  } else if(mapper.getMappings().isEmpty()){
    throw new IllegalStateException("The parsed field mappings MUST contain at least a single valid mapping!");
  }
  this.mapper = mapper;
}
public FiledMapperProcessor(Iterator<String> mappings, NamespacePrefixService nps, ValueFactory vf){
origin: org.apache.stanbol/org.apache.stanbol.entityhub.core

FieldMapper mapper = this.fieldMapper.clone();
for(FieldMapping siteMapping : siteMapper.getMappings()){
  mapper.addMapping(siteMapping);
mapper.applyMappings(remoteEntity.getRepresentation(), 
  localEntity.getRepresentation(),valueFactory);
origin: org.apache.stanbol/org.apache.stanbol.entityhub.core

/**
 * Creates an FieldMapper instance by using the {@link DefaultFieldMapperImpl}
 * and the default instance if the {@link ValueConverterFactory} and configure
 * it with {@link FieldMapping}s
 * @param mappings The mappings or <code>null</code> if none
 * @return A new and configured FieldMapper instance.
 */
public static FieldMapper createDefaultFieldMapper(Iterable<FieldMapping> mappings){
  FieldMapper mapper =  new DefaultFieldMapperImpl(ValueConverterFactory.getDefaultInstance());
  if(mappings != null){
    for(FieldMapping mapping : mappings){
      mapper.addMapping(mapping);
    }
  }
  return mapper;
}
origin: org.apache.stanbol/org.apache.stanbol.entityhub.core

  FieldMapping fieldMapping = FieldMappingUtils.parseFieldMapping(mappingString, nsPrefixService);
  if (fieldMapping != null) {
    configuredMappings.addMapping(fieldMapping);
if (configuredMappings.getMappings().isEmpty()) {
origin: apache/stanbol

    fieldMapper = new DefaultFieldMapperImpl(ValueConverterFactory.getDefaultInstance());
    for(FieldMapping mapping : mappings){
      fieldMapper.addMapping(mapping);
  fieldMapper = dereferencer.getFieldMapper().clone();
} else {
  fieldMapper = null;
    fieldMapper = new DefaultFieldMapperImpl(ValueConverterFactory.getDefaultInstance());
  fieldMapper.addMapping(new FieldMapping(new TextConstraint(
    (String)null, langs.toArray(new String[langs.size()]))));
origin: apache/stanbol

FieldMapper mapper = this.fieldMapper.clone();
for(FieldMapping siteMapping : siteMapper.getMappings()){
  mapper.addMapping(siteMapping);
mapper.applyMappings(remoteEntity.getRepresentation(), 
  localEntity.getRepresentation(),valueFactory);
origin: apache/stanbol

/**
 * Creates an FieldMapper instance by using the {@link DefaultFieldMapperImpl}
 * and the default instance if the {@link ValueConverterFactory} and configure
 * it with {@link FieldMapping}s
 * @param mappings The mappings or <code>null</code> if none
 * @return A new and configured FieldMapper instance.
 */
public static FieldMapper createDefaultFieldMapper(Iterable<FieldMapping> mappings){
  FieldMapper mapper =  new DefaultFieldMapperImpl(ValueConverterFactory.getDefaultInstance());
  if(mappings != null){
    for(FieldMapping mapping : mappings){
      mapper.addMapping(mapping);
    }
  }
  return mapper;
}
origin: apache/stanbol

  FieldMapping fieldMapping = FieldMappingUtils.parseFieldMapping(mappingString, nsPrefixService);
  if (fieldMapping != null) {
    configuredMappings.addMapping(fieldMapping);
if (configuredMappings.getMappings().isEmpty()) {
origin: apache/stanbol

fieldMapper = new DefaultFieldMapperImpl(ValueConverterFactory.getDefaultInstance());
for(FieldMapping mapping : mappings){
  fieldMapper.addMapping(mapping);
origin: apache/stanbol

@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);
  }
}
/**
origin: org.apache.stanbol/org.apache.stanbol.entityhub.indexing.core

public FiledMapperProcessor(FieldMapper mapper, NamespacePrefixService nps, ValueFactory vf){
  this(nps,vf);
  if(mapper == null){
    throw new IllegalArgumentException("The parsed FieldMapper MUST NOT be NULL!");
  } else if(mapper.getMappings().isEmpty()){
    throw new IllegalStateException("The parsed field mappings MUST contain at least a single valid mapping!");
  }
  this.mapper = mapper;
}
public FiledMapperProcessor(Iterator<String> mappings, NamespacePrefixService nps, ValueFactory vf){
origin: org.apache.stanbol/org.apache.stanbol.entityhub.core

/**
 * Getter for the base mappings used by this Cache. Modifications on the
 * returned object do not have any influence on the mappings, because this
 * method returns a clone. Use {@link #setBaseMappings(FieldMapper)} to
 * change the used base mappings. However make sure you understand the
 * implications of changing the base mappings as described in the
 * documentation of the setter method
 *
 * @return A clone of the base mappings or <code>null</code> if no base
 *         mappings are defined
 */
@Override
public final FieldMapper getBaseMappings() {
  return baseMapper == null ? null : baseMapper.clone();
}
origin: org.apache.stanbol/org.apache.stanbol.entityhub.core

public EntityhubImpl(Yard entityhubYard, SiteManager siteManager, 
    EntityhubConfiguration config, NamespacePrefixService nsPrefixService) {
  if(entityhubYard == null){
    throw new IllegalArgumentException("The parsed Yard MUST NOT be NULL!");
  }
  this.entityhubYard = entityhubYard;
  if(siteManager == null){
    throw new IllegalArgumentException("The parsed SiteManager MUST NOT be NULL!");
  }
  this.siteManager = siteManager;
  if(config == null){
    throw new IllegalArgumentException("The parsed EntityhubConfig MUST NOT be NULL!");
  }
  this.config = config;
  log.info(" ... init FieldMappings");
  fieldMapper = new DefaultFieldMapperImpl(ValueConverterFactory.getDefaultInstance());
  for(String mappingString : config.getFieldMappingConfig()){
    FieldMapping mapping = FieldMappingUtils.parseFieldMapping(mappingString,nsPrefixService);
    if(mapping != null){
      log.info("   + mapping: "+mapping);
      fieldMapper.addMapping(mapping);
    }
  }
}
origin: apache/stanbol

try {
  RdfRepresentation clerezzaRep = valueFactory.createRdfRepresentation(uri, graph);
  fieldMapper.applyMappings(rep, clerezzaRep, valueFactory);
    if(log.isTraceEnabled()){
    log.trace("dereferenced via Mappings {}", ModelUtils.getRepresentationInfo(clerezzaRep));
origin: apache/stanbol

public FiledMapperProcessor(Iterator<String> mappings, NamespacePrefixService nps, ValueFactory vf){
  this(nps, vf);
  if(mappings == null){
    throw new IllegalArgumentException("The parsed field mappings MUST NOT be NULL!");
  }
  mapper = FieldMappingUtils.createDefaultFieldMapper(mappings,nsPrefixService);
  if(mapper.getMappings().isEmpty()){
    throw new IllegalStateException("The parsed field mappings MUST contain at least a single valid mapping!");
  }
}
public FiledMapperProcessor(InputStream mappings, NamespacePrefixService nps, ValueFactory vf) throws IOException{
origin: org.apache.stanbol/org.apache.stanbol.entityhub.core

/**
 * Getter for the additional mappings used by this Cache. Modifications on the
 * returned object do not have any influence on the mappings, because this
 * method returns a clone. Use {@link #setAdditionalMappings(FieldMapper)} to
 * change the used additional mappings. However make sure you understand the
 * implications of changing the base mappings as described in the
 * documentation of the setter method
 *
 * @return A clone of the additional mappings or <code>null</code> if no
 *         additional mappings are defined
 */
@Override
public final FieldMapper getAdditionalMappings() {
  return additionalMapper == null ? null : additionalMapper.clone();
}
origin: apache/stanbol

public EntityhubImpl(Yard entityhubYard, SiteManager siteManager, 
    EntityhubConfiguration config, NamespacePrefixService nsPrefixService) {
  if(entityhubYard == null){
    throw new IllegalArgumentException("The parsed Yard MUST NOT be NULL!");
  }
  this.entityhubYard = entityhubYard;
  if(siteManager == null){
    throw new IllegalArgumentException("The parsed SiteManager MUST NOT be NULL!");
  }
  this.siteManager = siteManager;
  if(config == null){
    throw new IllegalArgumentException("The parsed EntityhubConfig MUST NOT be NULL!");
  }
  this.config = config;
  log.info(" ... init FieldMappings");
  fieldMapper = new DefaultFieldMapperImpl(ValueConverterFactory.getDefaultInstance());
  for(String mappingString : config.getFieldMappingConfig()){
    FieldMapping mapping = FieldMappingUtils.parseFieldMapping(mappingString,nsPrefixService);
    if(mapping != null){
      log.info("   + mapping: "+mapping);
      fieldMapper.addMapping(mapping);
    }
  }
}
origin: org.apache.stanbol/org.apache.stanbol.entityhub.core

/**
 * 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;
}
org.apache.stanbol.entityhub.servicesapi.mappingFieldMapper

Most used methods

  • applyMappings
    Uses the state of the source representation and the configured mappings to update the state of the t
  • addMapping
    Adds a FieldMapping.
  • clone
    Creates a clone of this FieldMapper instance with shallow copies of the FieldMapping instances
  • getMappings
    Getter for the unmodifiable collection of all mappings

Popular in Java

  • Reading from database using SQL prepared statement
  • setRequestProperty (URLConnection)
  • getSharedPreferences (Context)
  • getSystemService (Context)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now