private static List<String> parseMappings(String[] parts, int start, NamespacePrefixService nps) { ArrayList<String> mappings = new ArrayList<String>(parts.length-start); for(int i=start;i<parts.length;i++){ if(!parts[i].isEmpty()){ //needed to remove two spaces in a row try { mappings.add(NamespaceMappingUtils.getConfiguredUri(nps, parts[i])); } catch (IllegalArgumentException e) { log.warn("Unable to parse mapping because of unkown namespace prefix in "+parts[i],e); } } } return mappings; }
private static List<String> parseMappings(String[] parts, int start, NamespacePrefixService nps) { ArrayList<String> mappings = new ArrayList<String>(parts.length-start); for(int i=start;i<parts.length;i++){ if(!parts[i].isEmpty()){ //needed to remove two spaces in a row try { mappings.add(NamespaceMappingUtils.getConfiguredUri(nps, parts[i])); } catch (IllegalArgumentException e) { log.warn("Unable to parse mapping because of unkown namespace prefix in "+parts[i],e); } } } return mappings; }
"the RdfIndexingSource as EntityDataIterable)!"); } else { values.add(Node.createURI(NamespaceMappingUtils.getConfiguredUri( nsPrefixService, fieldValue)));
/** * Parses the URIs for the {@link DereferenceConstants#ENTITY_REFERENCE_PROPERTIES} * @return * @throws ConfigurationException */ private Set<IRI> parseEntityReferences() throws ConfigurationException { Set<IRI> entityRefPropUris; Collection<String> entityProps = EnhancementEngineHelper.getConfigValues( config, ENTITY_REFERENCES, String.class); if(entityProps == null || entityProps.isEmpty()){ entityRefPropUris = DEFAULT_ENTITY_REFERENCES; } else { entityRefPropUris = new HashSet<IRI>(entityProps.size()); for(String prop : entityProps){ if(!StringUtils.isBlank(prop)){ entityRefPropUris.add(new IRI(getConfiguredUri(nsPrefixService, ENTITY_REFERENCES, prop.trim()))); } } } return entityRefPropUris; } /**
/** * Parses the URIs for the {@link DereferenceConstants#ENTITY_REFERENCE_PROPERTIES} * @return * @throws ConfigurationException */ private Set<IRI> parseEntityReferences() throws ConfigurationException { Set<IRI> entityRefPropUris; Collection<String> entityProps = EnhancementEngineHelper.getConfigValues( config, ENTITY_REFERENCES, String.class); if(entityProps == null || entityProps.isEmpty()){ entityRefPropUris = DEFAULT_ENTITY_REFERENCES; } else { entityRefPropUris = new HashSet<IRI>(entityProps.size()); for(String prop : entityProps){ if(!StringUtils.isBlank(prop)){ entityRefPropUris.add(new IRI(getConfiguredUri(nsPrefixService, ENTITY_REFERENCES, prop.trim()))); } } } return entityRefPropUris; } /**
"the RdfIndexingSource as EntityDataIterable)!"); } else { values.add(Node.createURI(NamespaceMappingUtils.getConfiguredUri( nsPrefixService, fieldValue)));
Object type = config.get(PERSON_TYPE); personType = type == null || type.toString().isEmpty() ? null : NamespaceMappingUtils.getConfiguredUri(nsPrefixService,PERSON_TYPE, type.toString()); type = config.get(ORG_TYPE); orgType = type == null || type.toString().isEmpty() ? null : NamespaceMappingUtils.getConfiguredUri(nsPrefixService,ORG_TYPE,type.toString()); type = config.get(PLACE_TYPE); placeType = type == null || type.toString().isEmpty() ? null : NamespaceMappingUtils.getConfiguredUri(nsPrefixService,PLACE_TYPE,type.toString()); Object nameField = config.get(NAME_FIELD); this.nameField = nameField == null || nameField.toString().isEmpty() ? "http://www.w3.org/2000/01/rdf-schema#label" : NamespaceMappingUtils.getConfiguredUri(nsPrefixService,NAME_FIELD,nameField.toString()); Object dereferenceEntities = config.get(DEREFERENCE_ENTITIES); this.dereferenceEntities = state == null ? true : Boolean
Object value = config.get(PARAM_FIELD); if(value == null || value.toString().isEmpty()){ this.field = Node.createURI(NamespaceMappingUtils.getConfiguredUri( nsPrefixService, DEFAULT_FIELD)); log.info("Using default Field {}",field); } else { this.field = Node.createURI(NamespaceMappingUtils.getConfiguredUri( nsPrefixService, value.toString())); log.info("configured Field: {}",field);
Object value = config.get(PARAM_FIELD); if(value == null || value.toString().isEmpty()){ this.field = Node.createURI(NamespaceMappingUtils.getConfiguredUri( nsPrefixService, DEFAULT_FIELD)); log.info("Using default Field {}",field); } else { this.field = Node.createURI(NamespaceMappingUtils.getConfiguredUri( nsPrefixService, value.toString())); log.info("configured Field: {}",field);
if(!parts[0].isEmpty() && !parts[0].equals("*")){ try { fieldPattern = NamespaceMappingUtils.getConfiguredUri(nps,parts[0]); } catch (IllegalArgumentException e) { log.warn("Unable to parse fieldMapping because of unknown namespace prefix",e);
if(!parts[0].isEmpty() && !parts[0].equals("*")){ try { fieldPattern = NamespaceMappingUtils.getConfiguredUri(nps,parts[0]); } catch (IllegalArgumentException e) { log.warn("Unable to parse fieldMapping because of unknown namespace prefix",e);
namedEntityType = NamespaceMappingUtils.getConfiguredUri( prefixService, NAMED_ENTITY_TYPE_MAPPINGS,namedEntityType); typeUri = NamespaceMappingUtils.getConfiguredUri( prefixService, NAMED_ENTITY_TYPE_MAPPINGS, entityType);
private void parseEntityReferences(Object value) throws DereferenceConfigurationException { Collection<String> entityRefProps; try{ entityRefProps = EnhancementEngineHelper.parseConfigValues(value, String.class); } catch (IllegalStateException e){ throw new DereferenceConfigurationException(e, engine.getDereferencer().getClass(), DereferenceConstants.ENTITY_REFERENCES); } //start with the references present in the config this.entityReferences = new HashSet<IRI>(getConfig().getEntityReferences()); if(entityRefProps != null && !entityRefProps.isEmpty()){ NamespacePrefixService nps = engine.getConfig().getNsPrefixService(); for(String prop : entityRefProps){ if(!StringUtils.isBlank(prop)){ try { entityReferences.add(new IRI( NamespaceMappingUtils.getConfiguredUri(nps, prop))); } catch(IllegalArgumentException e){ throw new DereferenceConfigurationException(e, engine.getDereferencer().getClass(), DereferenceConstants.ENTITY_REFERENCES); } } } } } /**
private void parseEntityReferences(Object value) throws DereferenceConfigurationException { Collection<String> entityRefProps; try{ entityRefProps = EnhancementEngineHelper.parseConfigValues(value, String.class); } catch (IllegalStateException e){ throw new DereferenceConfigurationException(e, engine.getDereferencer().getClass(), DereferenceConstants.ENTITY_REFERENCES); } //start with the references present in the config this.entityReferences = new HashSet<IRI>(getConfig().getEntityReferences()); if(entityRefProps != null && !entityRefProps.isEmpty()){ NamespacePrefixService nps = engine.getConfig().getNsPrefixService(); for(String prop : entityRefProps){ if(!StringUtils.isBlank(prop)){ try { entityReferences.add(new IRI( NamespaceMappingUtils.getConfiguredUri(nps, prop))); } catch(IllegalArgumentException e){ throw new DereferenceConfigurationException(e, engine.getDereferencer().getClass(), DereferenceConstants.ENTITY_REFERENCES); } } } } } /**
linkerConfig.setNameField(NamespaceMappingUtils.getConfiguredUri( nsPrefixService, NAME_FIELD, value.toString())); throw new ConfigurationException(TYPE_FIELD,"The configured name field MUST NOT be empty"); linkerConfig.setTypeField(NamespaceMappingUtils.getConfiguredUri( nsPrefixService, TYPE_FIELD, value.toString())); throw new ConfigurationException(NAME_FIELD,"The configured name field MUST NOT be empty"); linkerConfig.setRedirectField(NamespaceMappingUtils.getConfiguredUri( nsPrefixService, REDIRECT_FIELD, value.toString())); targetType = NamespaceMappingUtils.getConfiguredUri( for(String sourceType : sourceTypes){ if(!sourceType.isEmpty()){ sourceType = NamespaceMappingUtils.getConfiguredUri(