public String getEffectDescription(Attribute effectAttributeToParse) { String description = effectAttributeToParse.getDescription(); if (description.indexOf(':') == -1) { throw new RuntimeException("Unable to create entitystructure, missing semicolon in description of [" + effectAttributeToParse.getName() + "]"); } return description; }
public String getEffectDescription(Attribute effectAttributeToParse) { String description = effectAttributeToParse.getDescription(); if (description.indexOf(':') == -1) { throw new RuntimeException( "Unable to create entitystructure, missing semicolon in description of [" + effectAttributeToParse .getName() + "]"); } return description; }
/** * A helper function to create a list of queryTerms based on the information from the * targetAttribute as well as user defined searchTerms. If the user defined searchTerms exist, the * targetAttribute information will not be used. * * @return list of queryTerms */ public Set<String> createLexicalSearchQueryTerms( Attribute targetAttribute, Set<String> searchTerms) { Set<String> queryTerms = new HashSet<>(); if (searchTerms != null && !searchTerms.isEmpty()) { queryTerms.addAll(searchTerms); } if (queryTerms.isEmpty()) { if (StringUtils.isNotBlank(targetAttribute.getLabel())) { queryTerms.add(targetAttribute.getLabel()); } if (StringUtils.isNotBlank(targetAttribute.getDescription())) { queryTerms.add(targetAttribute.getDescription()); } } return queryTerms; }
/** * A helper function to create a list of queryTerms based on the information from the targetAttribute as well as * user defined searchTerms. If the user defined searchTerms exist, the targetAttribute information will not be * used. * * @param targetAttribute * @param searchTerms * @return list of queryTerms */ public Set<String> createLexicalSearchQueryTerms(Attribute targetAttribute, Set<String> searchTerms) { Set<String> queryTerms = new HashSet<>(); if (searchTerms != null && !searchTerms.isEmpty()) { queryTerms.addAll(searchTerms); } if (queryTerms.size() == 0) { if (StringUtils.isNotBlank(targetAttribute.getLabel())) { queryTerms.add(targetAttribute.getLabel()); } if (StringUtils.isNotBlank(targetAttribute.getDescription())) { queryTerms.add(targetAttribute.getDescription()); } } return queryTerms; }
private static Map<String, Object> attributeToMap(Attribute attribute) { Map<String, Object> map = new HashMap<>(); map.put(AttributeMetadata.NAME, attribute.getName()); map.put(AttributeMetadata.LABEL, attribute.getLabel()); map.put(AttributeMetadata.DESCRIPTION, attribute.getDescription()); map.put(AttributeMetadata.TYPE, attribute.getDataType().toString()); map.put(AttributeMetadata.IS_NULLABLE, attribute.isNillable()); map.put(AttributeMetadata.IS_UNIQUE, attribute.isUnique()); if (attribute.getRefEntity() != null) { map.put(AttributeMetadata.REF_ENTITY_TYPE, attribute.getRefEntity().getId()); } return map; } }
private static Map<String, Object> attributeToMap(Attribute attribute) { Map<String, Object> map = new HashMap<String, Object>(); map.put(AttributeMetadata.NAME, attribute.getName()); map.put(AttributeMetadata.LABEL, attribute.getLabel()); map.put(AttributeMetadata.DESCRIPTION, attribute.getDescription()); map.put(AttributeMetadata.TYPE, attribute.getDataType().toString()); map.put(AttributeMetadata.IS_NULLABLE, attribute.isNillable()); map.put(AttributeMetadata.IS_UNIQUE, attribute.isUnique()); if (attribute.getRefEntity() != null) { map.put(AttributeMetadata.REF_ENTITY_TYPE, attribute.getRefEntity().getId()); } return map; } }
public static AttributeResult create(Attribute attr, String languageCode) { return create( attr.getLabel(languageCode), attr.getDescription(languageCode), attr.getDataType().toString()); } }
private PackageTreeNode createPackageTreeNode(Attribute amd, EntityType emd) { String title = amd.getLabel(); String key = amd.getName(); String tooltip = amd.getDescription(); List<PackageTreeNode> result = new ArrayList<>(); boolean folder; boolean expanded = false; Map<String, Object> data = new HashMap<>(); data.put("type", "attribute"); data.put("href", "/api/v1/" + emd.getId() + "/meta/" + amd.getName()); data.put("tags", tagService.getTagsForAttribute(emd, amd)); if (amd.getDataType() == AttributeType.COMPOUND) { for (Attribute subAmd : amd.getChildren()) { result.add(createPackageTreeNode(subAmd, emd)); } folder = true; } else { folder = false; } return new PackageTreeNode("attribute", title, key, tooltip, folder, expanded, data, result); }
@Override public Unit<? extends Quantity> resolveUnit(Attribute attr, EntityType entityType) { Set<String> tokens = tokenize(attr.getLabel(), attr.getDescription());
this.description = attr.getDescription(getCurrentUserLanguageCode()); } else this.description = null;
attribute.getDescription() == null ? attribute.getLabel() : attribute.getDescription(); Set<String> searchTerms = splitIntoTerms(description);
@Override public Unit<? extends Quantity> resolveUnit(Attribute attr, EntityType entityType) Set<String> tokens = tokenize(attr.getLabel(), attr.getDescription());
@Override public Hit<OntologyTerm> findTags(Attribute attribute, List<String> ontologyIds) String description = attribute.getDescription() == null ? attribute.getLabel() : attribute.getDescription(); Set<String> searchTerms = splitIntoTerms(description); Stemmer stemmer = new Stemmer();
this.name = attrName; this.label = attr.getLabel(getCurrentUserLanguageCode()); this.description = attr.getDescription(getCurrentUserLanguageCode()); this.enumOptions = attr.getDataType() == AttributeType.ENUM ? attr.getEnumOptions() : null; this.maxLength = attr.getDataType().getMaxLength();
String label = attribute.getLabel(); ImmutableMap<String, String> i18nLabel = toI18nLabel(attribute); String description = attribute.getDescription(); ImmutableMap<String, String> i18nDescription = toI18nDescription(attribute); boolean aggregatable = attribute.isAggregatable();