@Override protected Set<AttributeName> retrieveAttributeNameAll() { return parent.getAttributeNames(); }
Set<AttributeName> loopsOver() { return metadata.getAttributeNames(); } int counting(AttributeName an) { return
private String[] getAttributeNames() { Set<AttributeName> atts = graph.getMetaData().getAttributeNames(); String[] names = new String[atts.size()]; int i = 0; for (AttributeName at : atts) { names[i] = at.getId(); i++; } Arrays.sort(names); return names; }
/** * Extracts all attribute names corresponding to GDSs with * <code>Double</code> values, that can be used as edge weights. * * @return an array of attribute name IDs. */ private String[] getAttributeNames() { Vector<String> v = new Vector<String>(); v.add(defVal); for (AttributeName a : graph.getMetaData().getAttributeNames()) { if (Number.class.isAssignableFrom(a.getDataType())) v.add(a.getId()); } return v.toArray(new String[v.size()]); }
/** * Extracts all attribute names corresponding to GDSs with * <code>Double</code> values, that can be used as edge weights. * * @return an array of attribute name IDs. */ private String[] getAttributeNames() { Vector<String> v = new Vector<String>(); v.add(defVal); for (AttributeName a : graph.getMetaData().getAttributeNames()) { if (Number.class.isAssignableFrom(a.getDataType()) && !AppearanceSynchronizer.attr.contains(a.getId())) v.add(a.getId()); } return v.toArray(new String[v.size()]); }
/** * Extracts all attribute names corresponding to GDSs with * <code>Double</code> values, that can be used as edge weights. * * @return an array of attribute name IDs. */ private String[] getAttributeNames() { Vector<String> v = new Vector<String>(); v.add(defVal); for (AttributeName a : graph.getMetaData().getAttributeNames()) { if (Number.class.isAssignableFrom(a.getDataType()) && !AppearanceSynchronizer.attr.contains(a.getId())) { if (graph.getRelationsOfAttributeName(a).size() > 0) v.add(a.getId()); } } String[] sorted = v.toArray(new String[v.size()]); Arrays.sort(sorted); return sorted; }
/** * 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); } } }
private void init() { textDist = new JTextField(constDist + ""); textMulti = new JTextField(multi + ""); textHorizontal = new JTextField(horizontalSpacing + ""); textVertical = new JTextField(verticalSpacing + ""); ONDEXJUNGGraph aog = (ONDEXJUNGGraph) graph; // drop down boxes for attribute names Collection<AttributeName> ans = aog.getMetaData().getAttributeNames(); // Category can be anything dropCategory = new JComboBox(ans.toArray()); // only integer attribute names ArrayList<AttributeName> integers = new ArrayList<AttributeName>(); for (AttributeName an : ans) { if (Integer.class.isAssignableFrom(an.getDataType())) integers.add(an); } dropPosition = new JComboBox(integers.toArray()); // default values AttributeName anPos = aog.getMetaData().getAttributeName("BEGIN"); AttributeName anCat = aog.getMetaData().getAttributeName("Chromosome"); // set if defaults exists, otherwise random choice if (anPos != null && anCat != null) { dropPosition.setSelectedItem(anPos); dropCategory.setSelectedItem(anCat); } }
/** * Create a new context using the bound classes and adapters, and also with * all the types for all Attribute registered. NB class types in the meta * data that already have adaptors will not be bound * * @param md * graph metadata to use * @return a configured JAXBContext * @throws JAXBException * if the context could not be instantiated */ public synchronized JAXBContext createContext(ONDEXGraphMetaData md) throws JAXBException { for (AttributeName an : md.getAttributeNames()) { addAttribute(an); } return createContext(); }
/** * Return all attribute names from meta data either indexed by full name or * id. * * @param meta * ONDEXGraphMetaData * @return all attribute names indexed */ private Map<String, AttributeName> getAttributeNames(ONDEXGraphMetaData meta) { Map<String, AttributeName> attributeNames = new HashMap<String, AttributeName>(); for (AttributeName an : meta.getAttributeNames()) { String name = an.getFullname(); if (name == null || name.trim().length() == 0) name = an.getId(); name = Export.makeLower(name); if (attributeNames.containsKey(name)) { errorReport.append("\n"); errorReport .append("getAttributeNames: Lower case attribute name id already exists: "); errorReport.append(name); } attributeNames.put(name, an); attributeNames.put(Export.makeLower(an.getId()), an); } return attributeNames; }
/** * 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); } } }
/** * Creates a combo box displaying available attribute names. * * @param select * AttributeName to be selected * @return JComboBox */ public JComboBox makeSpecialisationOf(AttributeName select) { Vector<String> ans = new Vector<String>(); ans.add(""); AttributeName[] sorted = aog.getMetaData().getAttributeNames().toArray(new AttributeName[0]); Arrays.sort(sorted, new CaseInsensitiveMetaDataComparator()); for (AttributeName an : sorted) { ans.add(an.getId()); } JComboBox an = new JComboBox(ans); if (select != null) an.setSelectedItem(select.getId()); an.setPreferredSize(new Dimension(this.getFieldWidth(), this.getFieldHeight())); anBoxes.add(an); return an; }
/** * 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); } } }
public void start() { ONDEXGraphMetaData metadata = graph.getMetaData(); for (ConceptClass cc : metadata.getConceptClasses()) { System.out.println("ConceptClass " + cc.getId() + " " + cc.getFullname()); System.out.println("\tConcepts = " + graph.getConceptsOfConceptClass(cc).size()); } for (DataSource dataSource : metadata.getDataSources()) { System.out.println("DataSource " + dataSource.getId() + " " + dataSource.getFullname()); System.out.println("\tConcepts = " + graph.getConceptsOfDataSource(dataSource).size()); } for (AttributeName att : metadata.getAttributeNames()) { System.out.println("AttributeName " + att.getId() + " " + att.getFullname()); System.out.println("\tConcepts = " + graph.getConceptsOfAttributeName(att).size()); System.out.println("\tRelations = " + graph.getRelationsOfAttributeName(att).size()); } for (RelationType rt : metadata.getRelationTypes()) { System.out.println("RelationType " + rt.getId() + " " + rt.getFullname()); System.out.println("\tRelations = " + graph.getRelationsOfRelationType(rt).size()); } }
/** * Fills list of concept attribute names. * */ private void populateConceptAttributeNameList() { anlmConcepts.clearList(); for (AttributeName an : graph.getMetaData().getAttributeNames()) { Set<ONDEXConcept> concepts = graph.getConceptsOfAttributeName(an); if (concepts != null) { // check concepts exists on this AttributeName Class<?> cl = an.getDataType(); if (concepts.size() > 0 && Number.class.isAssignableFrom(cl) && !AppearanceSynchronizer.attr.contains(an.getId())) { anlmConcepts.addAttributeName(an); } } } anlmConcepts.refresh(); listConceptAttributeNames.setEnabled(!anlmConcepts.isEmpty()); listConceptAttributeNames.repaint(); }
/** * Fills list of relation attribute names. * */ private void populateRelationAttributeNameList() { anlmRelations.clearList(); for (AttributeName an : graph.getMetaData().getAttributeNames()) { Set<ONDEXRelation> relations = graph .getRelationsOfAttributeName(an); if (relations != null) { // check relations exists on this AttributeName Class<?> cl = an.getDataType(); if (relations.size() > 0 && Number.class.isAssignableFrom(cl) && !AppearanceSynchronizer.attr.contains(an.getId())) { anlmRelations.addAttributeName(an); } } } anlmRelations.refresh(); listRelationAttributeNames.setEnabled(!anlmRelations.isEmpty()); listRelationAttributeNames.repaint(); }
/** * Builds an XML ondex meta data XML Element. * * @param xmlw * xml stream to write in * @param graphdata * AbstractONDEXGraphMetaData * @throws XMLStreamException * if xml writing fails */ private void buildOndexMetaDataTag(XMLStreamWriter2 xmlw, ONDEXGraphMetaData graphdata) throws XMLStreamException { Set<DataSource> itDataSource = graphdata.getDataSources(); Set<Unit> itUnit = graphdata.getUnits(); Set<AttributeName> itAn = graphdata.getAttributeNames(); Set<EvidenceType> itEt = graphdata.getEvidenceTypes(); Set<ConceptClass> itCc = graphdata.getConceptClasses(); Set<RelationType> itRt = graphdata.getRelationTypes(); buildOndexMetaDataTag(xmlw, itDataSource, itUnit, itAn, itEt, itCc, itRt); }
private void populateList() { anlm.clearList(); for (AttributeName an : graph.getMetaData().getAttributeNames()) { if (!onConcepts) { Set<ONDEXRelation> relations = graph
Set<AttributeName> atts = graph.getMetaData().getAttributeNames(); HashMap<ONDEXConcept, Float> hit2score = new HashMap<ONDEXConcept, Float>();
Set<AttributeName> attNames = omd.getAttributeNames(); copyAttributeNames(attNames, omd, nomd);