本文整理汇总了Java中cz.cuni.mff.odcleanstore.fusiontool.util.NamespacePrefixExpander类的典型用法代码示例。如果您正苦于以下问题:Java NamespacePrefixExpander类的具体用法?Java NamespacePrefixExpander怎么用?Java NamespacePrefixExpander使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
NamespacePrefixExpander类属于cz.cuni.mff.odcleanstore.fusiontool.util包,在下文中一共展示了NamespacePrefixExpander类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: extractDataProcessingParams
import cz.cuni.mff.odcleanstore.fusiontool.util.NamespacePrefixExpander; //导入依赖的package包/类
private void extractDataProcessingParams(
List<ParamXml> params,
ConfigContainerImpl config,
NamespacePrefixExpander prefixExpander) throws InvalidInputException {
for (ParamXml param : params) {
if (ConfigParameters.PROCESSING_ONLY_RESOURCES_WITH_CLASS.equalsIgnoreCase(param.getName())) {
if (!ODCSUtils.isNullOrEmpty(param.getValue())) {
IRI classUri = convertToUriWithExpansion(prefixExpander, param.getValue());
config.setRequiredClassOfProcessedResources(classUri);
}
} else {
throw new InvalidInputException("Unknown parameter " + param.getName()
+ " used in data processing parameters");
}
}
}
示例2: extractDataProcessingParams
import cz.cuni.mff.odcleanstore.fusiontool.util.NamespacePrefixExpander; //导入依赖的package包/类
private void extractDataProcessingParams(
List<ParamXml> params,
ConfigContainerImpl config,
NamespacePrefixExpander prefixExpander) throws InvalidInputException {
for (ParamXml param : params) {
if (ConfigParameters.PROCESSING_ONLY_RESOURCES_WITH_CLASS.equalsIgnoreCase(param.getName())) {
if (!ODCSUtils.isNullOrEmpty(param.getValue())) {
URI classUri = convertToUriWithExpansion(prefixExpander, param.getValue());
config.setRequiredClassOfProcessedResources(classUri);
}
} else {
throw new InvalidInputException("Unknown parameter " + param.getName()
+ " used in data processing parameters");
}
}
}
示例3: extractPropertyResolutionStrategies
import cz.cuni.mff.odcleanstore.fusiontool.util.NamespacePrefixExpander; //导入依赖的package包/类
private Map<IRI, ResolutionStrategy> extractPropertyResolutionStrategies(
List<PropertyResolutionStrategyXml> propertyResolutionStrategies,
NamespacePrefixExpander prefixExpander)
throws InvalidInputException {
Map<IRI, ResolutionStrategy> result = new HashMap<>(propertyResolutionStrategies.size());
for (PropertyResolutionStrategyXml strategyXml : propertyResolutionStrategies) {
ResolutionStrategy strategy = extractResolutionStrategy(strategyXml, prefixExpander);
for (PropertyXml propertyXml : strategyXml.getProperties()) {
IRI uri = convertToUriWithExpansion(prefixExpander, propertyXml.getId());
result.put(uri, strategy);
}
}
return result;
}
示例4: extractResolutionStrategy
import cz.cuni.mff.odcleanstore.fusiontool.util.NamespacePrefixExpander; //导入依赖的package包/类
private ResolutionStrategy extractResolutionStrategy(ResolutionStrategyXml strategyXml, NamespacePrefixExpander prefixExpander) throws InvalidInputException {
ResolutionStrategyImpl strategy = new ResolutionStrategyImpl();
strategy.setResolutionFunctionName(strategyXml.getResolutionFunctionName());
strategy.setCardinality(strategyXml.getCardinality());
strategy.setAggregationErrorStrategy(strategyXml.getAggregationErrorStrategy());
if (strategyXml.getDependsOn() != null) {
strategy.setDependsOn(convertToUriWithExpansion(prefixExpander, strategyXml.getDependsOn()));
}
if (strategyXml.getParams() != null) {
strategy.setParams(extractAllParams(strategyXml.getParams()));
}
return strategy;
}
示例5: convertToUriWithExpansion
import cz.cuni.mff.odcleanstore.fusiontool.util.NamespacePrefixExpander; //导入依赖的package包/类
private IRI convertToUriWithExpansion(NamespacePrefixExpander prefixExpander, String value) throws InvalidInputException {
try {
return prefixExpander.convertToUriWithExpansion(value);
} catch (cz.cuni.mff.odcleanstore.fusiontool.exceptions.InvalidInputException e) {
throw new InvalidInputException(e.getMessage(), e);
}
}
示例6: extractPropertyResolutionStrategies
import cz.cuni.mff.odcleanstore.fusiontool.util.NamespacePrefixExpander; //导入依赖的package包/类
private Map<URI, ResolutionStrategy> extractPropertyResolutionStrategies(
List<PropertyResolutionStrategyXml> propertyResolutionStrategies,
NamespacePrefixExpander prefixExpander)
throws InvalidInputException {
Map<URI, ResolutionStrategy> result = new HashMap<>(propertyResolutionStrategies.size());
for (PropertyResolutionStrategyXml strategyXml : propertyResolutionStrategies) {
ResolutionStrategy strategy = extractResolutionStrategy(strategyXml, prefixExpander);
for (PropertyXml propertyXml : strategyXml.getProperties()) {
URI uri = prefixExpander.convertToUriWithExpansion(propertyXml.getId());
result.put(uri, strategy);
}
}
return result;
}
示例7: extractResolutionStrategy
import cz.cuni.mff.odcleanstore.fusiontool.util.NamespacePrefixExpander; //导入依赖的package包/类
private ResolutionStrategy extractResolutionStrategy(ResolutionStrategyXml strategyXml, NamespacePrefixExpander prefixExpander) throws InvalidInputException {
ResolutionStrategyImpl strategy = new ResolutionStrategyImpl();
strategy.setResolutionFunctionName(strategyXml.getResolutionFunctionName());
strategy.setCardinality(strategyXml.getCardinality());
strategy.setAggregationErrorStrategy(strategyXml.getAggregationErrorStrategy());
if (strategyXml.getDependsOn() != null) {
strategy.setDependsOn(prefixExpander.convertToUriWithExpansion(strategyXml.getDependsOn()));
}
if (strategyXml.getParams() != null) {
strategy.setParams(extractAllParams(strategyXml.getParams()));
}
return strategy;
}
示例8: extractDataProcessingParams
import cz.cuni.mff.odcleanstore.fusiontool.util.NamespacePrefixExpander; //导入依赖的package包/类
private void extractDataProcessingParams(List<ParamXml> params, ConfigImpl config, NamespacePrefixExpander prefixExpander) throws InvalidInputException {
for (ParamXml param : params) {
if (param.getValue() == null) {
continue;
}
if (ConfigParameters.PROCESSING_CANONICAL_URI_OUTPUT_FILE.equalsIgnoreCase(param.getName())) {
if (!ODCSUtils.isNullOrEmpty(param.getValue())) {
config.setCanonicalURIsOutputFile(new File(param.getValue()));
} else {
config.setCanonicalURIsOutputFile(null);
}
} else if (ConfigParameters.PROCESSING_CANONICAL_URI_INPUT_FILE.equalsIgnoreCase(param.getName())) {
if (!ODCSUtils.isNullOrEmpty(param.getValue())) {
config.setCanonicalURIsInputFile(new File(param.getValue()));
} else {
config.setCanonicalURIsInputFile(null);
}
} else if (ConfigParameters.PROCESSING_ENABLE_FILE_CACHE.equalsIgnoreCase(param.getName()) && !ODCSUtils.isNullOrEmpty(param.getValue())) {
config.setEnableFileCache(Boolean.parseBoolean(param.getValue()));
} else if (ConfigParameters.PROCESSING_MAX_OUTPUT_TRIPLES.equalsIgnoreCase(param.getName())) {
long value = convertToLong(param.getValue(), "Value of " + ConfigParameters.PROCESSING_MAX_OUTPUT_TRIPLES + " is not a valid number");
config.setMaxOutputTriples(value);
} else if (ConfigParameters.PROCESSING_LOCAL_COPY_PROCESSING.equalsIgnoreCase(param.getName()) && !ODCSUtils.isNullOrEmpty(param.getValue())) {
config.setLocalCopyProcessing(Boolean.parseBoolean(param.getValue()));
} else if (ConfigParameters.PROCESSING_ONLY_RESOURCES_WITH_CLASS.equalsIgnoreCase(param.getName())) {
if (!ODCSUtils.isNullOrEmpty(param.getValue())) {
URI classUri = prefixExpander.convertToUriWithExpansion(param.getValue());
config.setRequiredClassOfProcessedResources(classUri);
}
} else {
throw new InvalidInputException("Unknown parameter " + param.getName()
+ " used in data processing parameters");
}
}
}
示例9: extractPropertyResolutionStrategies
import cz.cuni.mff.odcleanstore.fusiontool.util.NamespacePrefixExpander; //导入依赖的package包/类
private Map<URI, ResolutionStrategy> extractPropertyResolutionStrategies(
List<PropertyResolutionStrategyXml> propertyResolutionStrategies,
NamespacePrefixExpander prefixExpander)
throws InvalidInputException {
Map<URI, ResolutionStrategy> result = new HashMap<>(propertyResolutionStrategies.size());
for (PropertyResolutionStrategyXml strategyXml : propertyResolutionStrategies) {
ResolutionStrategy strategy = extractResolutionStrategy(strategyXml, prefixExpander);
for (PropertyXml propertyXml : strategyXml.getProperties()) {
URI uri = convertToUriWithExpansion(prefixExpander, propertyXml.getId());
result.put(uri, strategy);
}
}
return result;
}
示例10: convertToUriWithExpansion
import cz.cuni.mff.odcleanstore.fusiontool.util.NamespacePrefixExpander; //导入依赖的package包/类
private URI convertToUriWithExpansion(NamespacePrefixExpander prefixExpander, String value) throws InvalidInputException {
try {
return prefixExpander.convertToUriWithExpansion(value);
} catch (cz.cuni.mff.odcleanstore.fusiontool.exceptions.InvalidInputException e) {
throw new InvalidInputException(e.getMessage(), e);
}
}
示例11: parseConfigXmlImpl
import cz.cuni.mff.odcleanstore.fusiontool.util.NamespacePrefixExpander; //导入依赖的package包/类
private ConfigContainer parseConfigXmlImpl(String configString) throws InvalidInputException {
ConfigContainerImpl config = new ConfigContainerImpl();
if (ODCSUtils.isNullOrEmpty(configString.trim())) {
return config;
}
Serializer serializer = new Persister();
ConfigXml configXml;
try {
configXml = serializer.read(ConfigXml.class, configString);
} catch (Exception e) {
throw new InvalidInputException("Error parsing configuration file", e);
}
// Prefixes
Map<String, String> prefixes;
if (configXml.getPrefixes() != null) {
prefixes = extractPrefixes(configXml.getPrefixes());
} else {
prefixes = new HashMap<>();
}
config.setPrefixes(Collections.unmodifiableMap(prefixes));
NamespacePrefixExpander prefixExpander = new NamespacePrefixExpander(config.getPrefixes());
// Data processing settings
if (configXml.getDataProcessing() != null) {
List<ParamXml> params = configXml.getDataProcessing().getParams();
if (params != null) {
extractDataProcessingParams(params, config, prefixExpander);
}
}
// Conflict resolution settings
if (configXml.getConflictResolution() != null) {
ConflictResolutionXml crXml = configXml.getConflictResolution();
if (crXml.getDefaultResolutionStrategy() != null) {
config.setDefaultResolutionStrategy(extractResolutionStrategy(
crXml.getDefaultResolutionStrategy(), prefixExpander));
}
config.setPropertyResolutionStrategies(extractPropertyResolutionStrategies(
crXml.getPropertyResolutionStrategies(), prefixExpander));
}
return config;
}