public static void initialiseMetaData(ONDEXGraph g) { graph = g; ONDEXGraphMetaData metaData = graph.getMetaData(); // required metadata for a publication dataSource = metaData.getFactory().createDataSource("OGLYCBASE", "o-linked glycoprotein database"); nlm = metaData.getDataSource("NLM"); cc = metaData.getConceptClass("Publication"); // see entries of et = metaData.getEvidenceType("IMPD"); // Attributes for publication authorsAttributeName = metaData.getAttributeName("AUTHORS"); citationAttributeName = metaData.getAttributeName("JOURNAL_REF"); yearPublishedAttributeName = metaData.getAttributeName("YEAR"); }
/** * initialise Ondex meta-data */ private void initMetaData() { // basic concept meta data dsCHEMBL = graph.getMetaData().getDataSource(DS_CHEMBL); dsVO = graph.getMetaData().getDataSource(DS_VO); ccComp = graph.getMetaData().getConceptClass(CC_COMP); ccThing = graph.getMetaData().getConceptClass(CC_THING); evidencetype = graph.getMetaData().getEvidenceType(ET_IMPD); rtIsa = graph.getMetaData().getRelationType(RT_ISA); }
/** * 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); }
protected static ConceptClass createCC(ONDEXGraphMetaData meta, String type) throws NullValueException, EmptyStringException{ ConceptClass cc = meta.getConceptClass(type); if(cc == null)cc = meta.getFactory().createConceptClass(type); return cc; }
public AttributeName safeFetchAttributeName(String id, Class<?> type) { AttributeName an = metaData.getAttributeName(id); if (an == null) { an = metaData.getFactory().createAttributeName(id, type); } return an; }
public Blast(String blastDir, String pfamPfad, String tmpDir, String evalue, String bitscore, String hmmThreshold, ONDEXGraph graph, AttributeName seqAtt, ConceptClass conceptType) { super(blastDir, pfamPfad, tmpDir, evalue, bitscore, hmmThreshold, graph, seqAtt, conceptType); this.ccPfam = graph.getMetaData().getConceptClass(MetaData.CC_Pfam); this.dataSourcePfam = graph.getMetaData().getDataSource( MetaData.CV_PFAM); this.blast = graph.getMetaData().getEvidenceType(EV_BLAST); }
public void start() { FileFilter filter = setupFilters(graph.getConceptsOfConceptClass(graph .getMetaData().getConceptClass(MetaData.CC_ProtFam)), graph .getMetaData().getDataSource(MetaData.CV_PDB)); try { transformer = new ProteinTransformer(graph); ReadFiles(filter); } catch (Exception e) { e.printStackTrace(); } } }
public RelationType safeFetchRelationType(String id, String description) { RelationType rt = metaData.getRelationType(id); if (rt == null) { rt = metaData.getFactory().createRelationType(id, description); } return rt; }
public EvidenceType safeFetchEvidenceType(String id) { EvidenceType et = metaData.getEvidenceType(id); if (et == null) { et = metaData.getFactory().createEvidenceType(id); } return et; }
public DataSource safeFetchDataSource(String id) { DataSource dataSource = metaData.getDataSource(id); if (dataSource == null) { dataSource = metaData.getFactory().createDataSource(id); } return dataSource; }
@Override protected RelationType retrieveRelationType(String id) { return parent.getRelationType(id); }
/** * Check for selection of an AttributeName. */ public void actionPerformed(ActionEvent arg0) { ONDEXJUNGGraph aog = (ONDEXJUNGGraph) graph; JComboBox box = (JComboBox) arg0.getSource(); String name = (String) box.getSelectedItem(); an = aog.getMetaData().getAttributeName(name); }
@Override protected ConceptClass resolveExternally(String id) { return og.getMetaData().getConceptClass(id); } };
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()); } }
@Override protected Set<AttributeName> retrieveAttributeNameAll() { return parent.getAttributeNames(); }
/** * fetches the required metadata or throws a respective runtime * exception if it doesn't exist. * * @param id the id of the metadata object. */ public EvidenceType requireEvidenceType(String id) throws EvidenceTypeMissingException { EvidenceType e = graph.getMetaData().getEvidenceType(id); if (e == null) throw new EvidenceTypeMissingException("Evidence Type " + id + " missing"); else return e; }
@Override protected Set<ConceptClass> retrieveConceptClassAll() { return parent.getConceptClasses(); }
/** * Fakes a table cell editor based around a JTextField. * */ public ConceptTableCellEditor(ONDEXGraph graph) { super(new JTextField()); // keep local graph reference this.graph = graph; cloner = new ConceptCloner(graph); cvComboBox = new JComboBox(graph.getMetaData().getDataSources().toArray(new DataSource[graph.getMetaData().getDataSources().size()])); ccComboBox = new JComboBox(graph.getMetaData().getConceptClasses().toArray(new ConceptClass[graph.getMetaData().getConceptClasses().size()])); etComboBox = new JComboBox(graph.getMetaData().getEvidenceTypes().toArray(new EvidenceType[graph.getMetaData().getEvidenceTypes().size()])); }
@Override protected Set<RelationType> retrieveRelationTypeAll() { return parent.getRelationTypes(); }
@Override public DataSource getElementOf() { String a = EntityHelper.fetchString(sg, "concept", "DataSource", id); return sg.getMetaData().getDataSource(a); }