@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; } }
String fieldUri = nps.getFullName(value); if(fieldUri == null){ throw new IllegalArgumentException("The prefix '"
String fieldUri = nps.getFullName(value); if(fieldUri == null){ throw new IllegalArgumentException("The prefix '"
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 "
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
/** * 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; }
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);
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};
private static Constraint parseSimilarityConstraint(JSONObject jConstraint, NamespacePrefixService nsPrefixService) throws JSONException { String context = jConstraint.optString("context"); if(context == null){ throw new IllegalArgumentException("SimilarityConstraints MUST define a \"context\": \n "+jConstraint.toString(4)); } JSONArray addFields = jConstraint.optJSONArray("addFields"); final List<String> fields; if(addFields != null && addFields.length() > 0){ fields = new ArrayList<String>(addFields.length()); for(int i=0;i<addFields.length();i++){ String field = addFields.optString(i); field = field != null ? nsPrefixService.getFullName(field) : null; if(field != null && !field.isEmpty()){ fields.add(field); } } } else { fields = null; } return new SimilarityConstraint(context,fields); }
continue; String fieldUri = nsPrefixService.getFullName(field); if(fieldUri == null){ parsingErrorMessages.append('\n'); for(int i=0;i<selected.length();i++){ String selectedField = selected.getString(i); selectedField = nsPrefixService.getFullName(selectedField); if(selectedField != null && !selectedField.isEmpty()){ query.addSelectedField(selectedField);
} else if(property.getName().equalsIgnoreCase("similarity")){ String propUri = property.getParameter() != null ? nsPrefixService.getFullName(property.getParameter()) : SpecialFieldEnum.fullText.getUri(); if(propUri != null){
String fieldUri = nps.getFullName(value); if(fieldUri == null){ throw new ConfigurationException(property, "The prefix '"
String fieldUri = nps.getFullName(value); if(fieldUri == null){ throw new ConfigurationException(property, "The prefix '"