@Override public void setConfiguration(Map<String,Object> config) { IndexingConfig indexingConfig = (IndexingConfig)config.get(IndexingConfig.KEY_INDEXING_CONFIG); NamespacePrefixService nsPrefixService = indexingConfig.getNamespacePrefixService(); Object value = config.get(PARAM_LINK_PROPERTY); if(value != null){ linkProperty = nsPrefixService.getFullName(value.toString()); if(linkProperty == null){ throw new IllegalArgumentException("Unknown Namespace Prefix use in " + PARAM_LINK_PROPERTY+'='+value+"!"); } } else { linkProperty = DEFAULT_LINK_PROPERTY; } value = config.get(PARAM_DBPEDIA_STATE); if(value != null){ dbpediaState = Boolean.parseBoolean(value.toString()); } else { dbpediaState = DEFAULT_DBPEDIA_STATE; } value = config.get(PARAM_MUSICBRAINZ_STATE); if(value != null){ musicbrainzState = Boolean.parseBoolean(value.toString()); } else { musicbrainzState = DEFAULT_MUSICBRAINZ_STATE; } }
private String createPrefix(Map<String,String> prefixMap) { String defaultPrefix; do { // as long an prefix is not any of the default prefixes or one of the prefixes defined by // NamespaceEnum defaultNsPrefixNumber++; defaultPrefix = DEFAULT_NS_PREFIX_STRING + defaultNsPrefixNumber; } while (prefixMap.containsKey(defaultPrefix) || NamespaceEnum.forPrefix(defaultPrefix) != null || (nsPrefixService != null && nsPrefixService.getNamespace(defaultPrefix) != null)); return defaultPrefix; }
String defaultprefix; if(nsPrefixService != null){ defaultprefix = nsPrefixService.getPrefix(namespace); } else { NamespaceEnum defaultMapping = NamespaceEnum.forNamespace(namespace);
String dataType = dataTypes.iterator().next(); jConstraint.put("datatype", nsPrefixService != null ? nsPrefixService.getShortName(dataType) : dataType); } else { ArrayList<String> dataTypeValues = new ArrayList<String>(dataTypes.size()); for(String dataType : dataTypes){ dataTypeValues.add(nsPrefixService != null ? nsPrefixService.getShortName(dataType) : dataType);
String defaultprefix; if(nsPrefixService != null){ defaultprefix = nsPrefixService.getPrefix(namespace); } else { NamespaceEnum defaultMapping = NamespaceEnum.forNamespace(namespace);
String fieldUri = nps.getFullName(value); if(fieldUri == null){ throw new IllegalArgumentException("The prefix '"
private String createPrefix(Map<String,String> prefixMap) { String defaultPrefix; do { // as long an prefix is not any of the default prefixes or one of the prefixes defined by // NamespaceEnum defaultNsPrefixNumber++; defaultPrefix = DEFAULT_NS_PREFIX_STRING + defaultNsPrefixNumber; } while (prefixMap.containsKey(defaultPrefix) || NamespaceEnum.forPrefix(defaultPrefix) != null || (nsPrefixService != null && nsPrefixService.getNamespace(defaultPrefix) != null)); return defaultPrefix; }
String fieldUri = nps.getFullName(value); if(fieldUri == null){ throw new IllegalArgumentException("The prefix '"
if(!prefix.equals(lastNsPrefix[0])){ //other prefix (or first) lastNsPrefix[0] = prefix; lastNsPrefix[1] = nsPrefixService.getNamespace(prefix); if(lastNsPrefix == null){ throw new IllegalStateException("Missing Namespace "
String uri = prefixService.getFullName(value); if(uri == null){ throw new ConfigurationException(property, "The prefix '"+prefix
if(!prefix.equals(lastNsPrefix[0])){ //other prefix (or first) lastNsPrefix[0] = prefix; lastNsPrefix[1] = nsPrefixService.getNamespace(prefix); if(lastNsPrefix == null){ throw new IllegalStateException("Missing Namespace "
property = DEFAULT_FIND_FIELD; } else { property = nsPrefixService.getFullName(parsedField); if(property == null){ String messsage = String.format("The prefix '%s' of the parsed field '%' is not "
property = DEFAULT_FIND_FIELD; } else { property = nsPrefixService.getFullName(parsedField); if(property == null){ String messsage = String.format("The prefix '%s' of the parsed field '%' is not "
String uri = prefixService.getFullName(value); if(uri == null){ throw new ConfigurationException(property, "The prefix '"+prefix
property = DEFAULT_FIND_FIELD; } else { property = nsPrefixService.getFullName(parsedField); if(property == null){ String messsage = String.format("The prefix '%s' of the parsed field '%' is not "
for(int i=0;i<((JSONArray)value).length();i++){ String field = ((JSONArray)value).getString(i); field = field != null ? nsPrefixService.getFullName(field) : null; if(field != null && !field.isEmpty()){ refList.add(field); } else { String field = jConstraint.getString("value"); field = field != null ? nsPrefixService.getFullName(field) : null; if(field != null){ refList = Collections.singletonList(field);
/** * Parses a Value from a JSON Object by reading the 'id' and 'name' keys * @param jValue * @return The value or <code>null</code> if the parsed json object does not * contain the required information. */ private static ReconcileValue parseValueFromV(Object jValue, NamespacePrefixService nsPrefixService) { if(jValue == null){ return null; } String id = ((JSONObject)jValue).optString("id"); if(id != null){ id = nsPrefixService.getFullName(id); if(id == null){ log.warn("Unknown prefix '{}' used by 'id' of element {} -> will use NULL as id", NamespaceMappingUtils.getPrefix(id),jValue.toString()); } } String value = ((JSONObject)jValue).optString("name"); return value != null ? new ReconcileValue(id,value) : null; }
return null; String propertyUri = nxPrefixService.getFullName(propertyString); if(propertyUri == null){ log.warn("The property '{}' uses the unknown prefix '{}' -> ignored",
String dataType = jDataTypes.getString(i); dataType = dataType != null ? nsPrefixService.getFullName(dataType) : null; if(dataType != null && !dataType.isEmpty()){ dataTypes.add(dataType); String dataType = jConstraint.getString(dataTypeKey); dataType = dataType != null ? nsPrefixService.getFullName(dataType) : null; if(dataType != null && !dataType.isEmpty()){ dataTypes = Collections.singleton(dataType);
public static enum TYPE_STRICT {any,all,should};