/** * adds a attribute filter criterium to the list of filters. the criterium * consists of an attribute and a value. * * @param an * the attribute name * @param value * the value to filter for. */ public void addGDSFilter(AttributeName an, Object value) { gdsFilters.put(an.getId(), value); }
/** * removes a given attribute filter from the list of filters. * * @param an * the attribute name that identfies the attribute filter * criterium. */ public void removeGDSFilter(AttributeName an) { gdsFilters.remove(an.getId()); }
public int compareTo(AttributeName o) { if (o != null) { return this.getId().compareTo(o.getId()); } else { throw new RuntimeException("Invalid comparison object"); } }
/** * Wrapper of {@link #searchByAttribute(String, String, String, Analyzer)}. */ private static Query searchByAttribute ( String attrFieldPrefix, AttributeName an, String term, Analyzer analyzer ) throws ParseException { return searchByAttribute ( attrFieldPrefix, an.getId(), term, analyzer ); }
/** * Defaults to singleWordTrim = false. */ private static Query searchByAttributeWords ( String attrFieldPrefix, AttributeName attrName, String term ) throws ParseException { return searchByAttributeWords ( attrFieldPrefix, attrName.getId (), term, false ); }
/** * Wrapper of {@link #searchByAttributesMulti(String, String, String[], Map, Analyzer)} */ private static Query searchByAttributesMulti ( String attrFieldPrefix, String term, AttributeName[] attrNames, Map<String, Float> boosts, Analyzer analyzer ) throws ParseException { String [] attrStr = new String [ attrNames.length ]; for ( int i = 0; i < attrNames.length; i++ ) attrStr [ i ] = attrNames [ i ].getId (); return searchByAttributesMulti ( attrFieldPrefix, term, attrStr, boosts, analyzer ); }
/** * Wrapper of {@link #searchByAttributeFuzzy(String, String, String, float)} */ private static Query searchByAttributeFuzzy ( String attrFieldPrefix, AttributeName attrName, String term, float similarity ) throws ParseException { return searchByAttributeFuzzy ( attrFieldPrefix, attrName.getId (), term, similarity ); }
/** * A wrapper of {@link #searchByAttributeWords(String, String, String, boolean)}. */ private static Query searchByAttributeWords ( String attrFieldPrefix, AttributeName attrName, String term, boolean singleWordTrim ) throws ParseException { return searchByAttributeWords ( attrFieldPrefix, attrName.getId (), term, singleWordTrim ); }
String getAttributeName() { if (an.getFullname() != null) return an.getFullname(); else return an.getId(); }
@Override public Attribute getAttribute(AttributeName attrname) { try { if (soapGraph.getConceptAttribute(graphId, id, attrname.getId()) != null) return new SOAPConceptAttribute(parent, id, attrname.getId()); } catch (WebserviceException_Exception e) { parent.fireActionEvent(e, e.getMessage()); e.printStackTrace(); } return null; }
@Override public Attribute getAttribute(AttributeName attrname) { try { if (soapGraph.getRelationAttribute(graphId, id, attrname.getId()) != null) return new SOAPRelationAttribute(parent, id, attrname.getId()); } catch (WebserviceException_Exception e) { parent.fireActionEvent(e, e.getMessage()); e.printStackTrace(); } return null; }
/** * Fills attribute selection list */ private void addAttributeNamesToList() { for (AttributeName attn : graph.getMetaData().getAttributeNames()) { if (Comparable.class.isAssignableFrom(attn.getDataType())) { Set<ONDEXConcept> concepts = graph.getConceptsOfAttributeName(attn); if (concepts != null && concepts.size() > 0 && !AppearanceSynchronizer.attr.contains(attn.getId())) anlm.addAttributeName(attn); } } }
/** * adds all suitable attribute names to the jlist. */ private void addAttributeNamesToList() { for (AttributeName attn : graph.getMetaData().getAttributeNames()) { // should also accept list types now. if (Comparable.class.isAssignableFrom(attn.getDataType()) || Collection.class.isAssignableFrom(attn.getDataType())) { Set<ONDEXConcept> concepts = graph.getConceptsOfAttributeName(attn); if (concepts != null && concepts.size() > 0 && !AppearanceSynchronizer.attr.contains(attn.getId())) anlm.addAttributeName(attn); } } }
@Override public String getUri ( AttributeName aname, Map<String, Object> params ) { String ns = Java2RdfUtils.getParam ( params, "ontologyNamespace", NamespaceUtils.ns ( "bka" ) ); String id = aname.getId (); return ns + IdUtils.urlEncode ( id ); } }
@Override protected boolean removeConceptAttribute(AttributeName attributeName) { berkeley.deleteFromDupDatabase(Integer.class, attributeName, idarray); return berkeley.deleteFromDatabase(ConceptAttribute.class, new BerkeleyIntegerName(id, attributeName.getId())); }
@Override protected boolean removeRelationAttribute(AttributeName attributeName) { berkeley.deleteFromDupDatabase(BerkeleyIntegerName.class, attributeName, idarray); return berkeley.deleteFromDatabase(RelationAttribute.class, new BerkeleyRelationKeyName((BerkeleyRelationKey) key, attributeName.getId())); }
@Override public boolean deleteAttribute(AttributeName attrname) { try { return soapGraph.deleteRelationAttribute(graphId, id, attrname.getId()); } catch (WebserviceException_Exception e) { parent.fireActionEvent(e, e.getMessage()); e.printStackTrace(); } return false; }
@Override public boolean deleteAttribute(AttributeName attrname) { try { return soapGraph.deleteConceptAttribute(graphId, id, attrname.getId()); } catch (WebserviceException_Exception e) { parent.fireActionEvent(e, e.getMessage()); e.printStackTrace(); } return false; }
@Override public void setSpecialisationOf(AttributeName specialisationOf) { try { JAXBElement<String> old = soapGraph.getAttributeName(graphId, id) .getSpecialisationOf(); old.setValue(specialisationOf.getId()); soapGraph.getAttributeName(graphId, id).setSpecialisationOf(old); } catch (WebserviceException_Exception e) { parent.fireActionEvent(e, e.getMessage()); e.printStackTrace(); } }