/** * Load vocabulary data from a provided source url. * * @param sourceUrl the address from where to get the vocabulary source file * @return vocabulary data, if exists */ protected Map<String, TermData> load(final String sourceUrl) { SolrUpdateGenerator generator = new SolrUpdateGenerator(); Map<String, Double> fieldSelection = new HashMap<>(); return generator.transform(sourceUrl, fieldSelection); }
if (line.trim().matches(ENTITY_SEPARATION_REGEX)) { if (this.counter > 0) { storeCrtTerm(); this.counter++; loadField(pieces[0], pieces[1]); storeCrtTerm(); if (isFieldSelected(TermData.TERM_CATEGORY_FIELD_NAME)) { propagateAncestors();
public Map<String, TermData> transform(String ontologyUrl, Map<String, Double> fieldSelection) { URL url; try { url = new URL(ontologyUrl); } catch (MalformedURLException ex) { return null; } return transform(url, fieldSelection); }
private void loadField(String name, String value) { if (!(isFieldSelected(name))) { return; } this.crtTerm.addTo(name, value.replaceFirst("^\"(.+)\"\\s*?(?:[A-Z]+|\\[).*", "$1") .replaceFirst("\\s+\\{.*$", "").replaceFirst("^(HP:\\d{7}) ! .*$", "$1").replace("\\\"", "\"")); }
if (line.trim().matches(ENTITY_SEPARATION_REGEX)) { if (this.counter > 0) { storeCrtTerm(); this.counter++; loadField(pieces[0], pieces[1]); storeCrtTerm(); if (isFieldSelected(TermData.TERM_CATEGORY_FIELD_NAME)) { propagateAncestors();
public Map<String, TermData> transform(String ontologyUrl, Map<String, Double> fieldSelection) { URL url; try { url = new URL(ontologyUrl); } catch (MalformedURLException ex) { return null; } return transform(url, fieldSelection); }
private void loadField(String name, String value) { if (!(isFieldSelected(name))) { return; } this.crtTerm.addTo(name, value.replaceFirst("^\"(.+)\"\\s*?(?:[A-Z]+|\\[).*", "$1") .replaceFirst("\\s+\\{.*$", "").replaceFirst("^(HP:\\d{7}) ! .*$", "$1").replace("\\\"", "\"")); }
SolrUpdateGenerator generator = new SolrUpdateGenerator(); Map<String, Double> fieldSelection = new HashMap<String, Double>(); Map<String, TermData> data = generator.transform(realOntologyUrl, fieldSelection); if (data == null) { return 2;