Tabnine Logo
org.apache.stanbol.entityhub.servicesapi.mapping
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: org.apache.stanbol/org.apache.stanbol.entityhub.servicesapi

/**
 * Removes any specified filter
 */
public void removeFilter(){
  setFilter(null);
}
/**
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: org.apache.stanbol/org.apache.stanbol.entityhub.core

@Override
public int compare(FieldMapping fm17, FieldMapping fm33) {
  //in my company's QM 9000 system
  //  ... fm17 stands for critical deviation and
  //  ... fm33 stands for suggestion for improvement
  // and the nested in-line if are good for code quality!
  //   ... sorry for the comments ^^
  return fm17.usesWildcard() == fm33.usesWildcard()? //both same Wildcard
    fm17.ignoreField() == fm17.ignoreField()? // both same ignore state
      fm33.getFieldPattern().length()-fm17.getFieldPattern().length(): //longer field pattern
        fm17.ignoreField()?-1:1: //that with ignore field=true
      !fm17.usesWildcard()?-1:1; //that without wildcard
}
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

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

/**
 * 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

@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: 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

@Override
public int compare(FieldMapping fm17, FieldMapping fm33) {
  //in my company's QM 9000 system
  //  ... fm17 stands for critical deviation and
  //  ... fm33 stands for suggestion for improvement
  // and the nested in-line if are good for code quality!
  //   ... sorry for the comments ^^
  return fm17.usesWildcard() == fm33.usesWildcard()? //both same Wildcard
    fm17.ignoreField() == fm17.ignoreField()? // both same ignore state
      fm33.getFieldPattern().length()-fm17.getFieldPattern().length(): //longer field pattern
        fm17.ignoreField()?-1:1: //that with ignore field=true
      !fm17.usesWildcard()?-1:1; //that without wildcard
}
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: apache/stanbol

/**
 * Removes any specified filter
 */
public void removeFilter(){
  setFilter(null);
}
/**
origin: org.apache.stanbol/org.apache.stanbol.entityhub.core

public static String[] serialiseFieldMapper(FieldMapper mapper){
  if(mapper == null){
    return null;
  } else {
    Collection<FieldMapping> mappings = mapper.getMappings();
    String[] mappingStrings = new String[mappings.size()];
    int index=0;
    for(Iterator<FieldMapping> it = mappings.iterator();it.hasNext();index++){
      mappingStrings[index] = serialiseFieldMapping(it.next());
    }
    return mappingStrings;
  }
}
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 parsed form the list of string parsed as
 * argument to this method.
 * @param mappings The mappings or <code>null</code> if none
 * @return A new and configured FieldMapper instance.
 */
public static FieldMapper createDefaultFieldMapper(Iterator<String> mappings, NamespacePrefixService nps){
  FieldMapper mapper =  new DefaultFieldMapperImpl(ValueConverterFactory.getDefaultInstance());
  if(mappings != null){
    for(FieldMapping mapping : parseFieldMappings(mappings,nps)){
      mapper.addMapping(mapping);
    }
  }
  return mapper;
}
/**
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 static String[] serialiseFieldMapper(FieldMapper mapper){
  if(mapper == null){
    return null;
  } else {
    Collection<FieldMapping> mappings = mapper.getMappings();
    String[] mappingStrings = new String[mappings.size()];
    int index=0;
    for(Iterator<FieldMapping> it = mappings.iterator();it.hasNext();index++){
      mappingStrings[index] = serialiseFieldMapping(it.next());
    }
    return mappingStrings;
  }
}
origin: apache/stanbol

/**
 * 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 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.indexing.core

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: apache/stanbol

  /**
   * Serialises all {@link FieldMapping}s of the parsed {@link FieldMapper}
   * and stores them in the {@value Cache#FIELD_MAPPING_CONFIG_FIELD} of the
   * parsed {@link Representation}
   * @param config the representation to store the field mapping configuration
   * @param mapper the field mapper with the configuration to store
   */
  private static void writeFieldConfig(Representation config, FieldMapper mapper){
    StringBuilder builder = new StringBuilder();
    for(FieldMapping mapping : mapper.getMappings()){
      builder.append(FieldMappingUtils.serialiseFieldMapping(mapping));
      builder.append('\n');
    }
    config.set(Cache.FIELD_MAPPING_CONFIG_FIELD, builder.toString());
  }
}
org.apache.stanbol.entityhub.servicesapi.mapping

Most used classes

  • FieldMapper
  • FieldMapping
    A FieldMapping consisting of * a required field pattern that is matched against source field. W
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