Tabnine Logo
OntologyDocument.isCyclicRelationship
Code IndexAdd Tabnine to your IDE (free)

How to use
isCyclicRelationship
method
in
uk.ac.ebi.intact.bridges.ontologies.OntologyDocument

Best Java code snippets using uk.ac.ebi.intact.bridges.ontologies.OntologyDocument.isCyclicRelationship (Showing top 4 results out of 315)

origin: uk.ac.ebi.intact.dataexchange.psimi/intact-solr-core

  /**
   * Used to exclude any document that does not have an "is_a" relationship or it is not a root node
   * (null relationship) or it is cyclic.
   * @param ontologyDocument
   * @return
   */
  public boolean accept(OntologyDocument ontologyDocument) {
    if (ontologyDocument.getRelationshipType() == null) {
      return true;
    }

    final String type = ontologyDocument.getRelationshipType();
    // note that the types are ordered by decreasing likelyhood of appearence to improve performance
    return (    type.equals( "OBO_REL:is_a" )
         || type.equals( "part_of" )
         || type.equals( "is_a" )
         || type.equals( "OBO_REL:part_of" )
        )
        && ! ontologyDocument.isCyclicRelationship();
  }
}
origin: uk.ac.ebi.intact.dataexchange.psimi/intact-solr

  /**
   * Used to exclude any document that does not have an "is_a" relationship or it is not a root node
   * (null relationship) or it is cyclic.
   * @param ontologyDocument
   * @return
   */
  public boolean accept(OntologyDocument ontologyDocument) {
    if (ontologyDocument.getRelationshipType() == null) {
      return true;
    }

    final String type = ontologyDocument.getRelationshipType();
    // note that the types are ordered by decreasing likelyhood of appearence to improve performance
    return (    type.equals( "OBO_REL:is_a" )
         || type.equals( "part_of" )
         || type.equals( "is_a" )
         || type.equals( "OBO_REL:part_of" )
        )
        && ! ontologyDocument.isCyclicRelationship();
  }
}
origin: uk.ac.ebi.intact.bridges/intact-ontologies

public void addDocument(OntologyDocument ontologyDoc) throws IOException {
  Document doc = new Document();
  doc.add(new Field(FieldName.ONTOLOGY, ontologyDoc.getOntology(), Field.Store.YES, Field.Index.UN_TOKENIZED));
  if (ontologyDoc.getParentId() != null) {
    doc.add(new Field(FieldName.PARENT_ID, ontologyDoc.getParentId(), Field.Store.YES, Field.Index.UN_TOKENIZED));
    doc.add(new Field(FieldName.PARENT_NAME, ontologyDoc.getParentName(), Field.Store.YES, Field.Index.TOKENIZED));
    doc.add(new Field(FieldName.PARENT_NAME_SORTABLE, ontologyDoc.getParentName(), Field.Store.YES, Field.Index.UN_TOKENIZED));
  }
  if (ontologyDoc.getChildId() != null) {
    doc.add(new Field(FieldName.CHILDREN_ID, ontologyDoc.getChildId(), Field.Store.YES, Field.Index.UN_TOKENIZED));
    doc.add(new Field(FieldName.CHILDREN_NAME, ontologyDoc.getChildName(), Field.Store.YES, Field.Index.TOKENIZED));
    doc.add(new Field(FieldName.CHILDREN_NAME_SORTABLE, ontologyDoc.getChildName(), Field.Store.YES, Field.Index.UN_TOKENIZED));
  }
  if (ontologyDoc.getRelationshipType() != null) {
    doc.add(new Field(FieldName.RELATIONSHIP_TYPE, ontologyDoc.getRelationshipType(), Field.Store.YES, Field.Index.UN_TOKENIZED));
  }
  doc.add(new Field(FieldName.RELATIONSHIP_CYCLIC, String.valueOf(ontologyDoc.isCyclicRelationship()),
           Field.Store.YES, Field.Index.UN_TOKENIZED));
  doc.add(new Field(FieldName.PARENT_SYNONYMS, StringUtils.join(ontologyDoc.getParentSynonyms(), SYNONYM_SEPARATOR), Field.Store.YES, Field.Index.UN_TOKENIZED));
  doc.add(new Field(FieldName.CHILDREN_SYNONYMS, StringUtils.join(ontologyDoc.getChildSynonyms(), SYNONYM_SEPARATOR), Field.Store.YES, Field.Index.UN_TOKENIZED));
  this.indexWriter.addDocument(doc);
}
origin: uk.ac.ebi.intact.dataexchange.psimi/intact-solr

private SolrInputDocument createSolrInputDocument(OntologyDocument ontologyDocument) {
  SolrInputDocument doc = new SolrInputDocument();
  String uniqueKey = ontologyDocument.getOntology() + "_" + ontologyDocument.getParentId() + "_" + ontologyDocument.getChildId() + "_" + ontologyDocument.getRelationshipType();
  addField(doc, OntologyFieldNames.ID, uniqueKey, false);
  addField(doc, OntologyFieldNames.ONTOLOGY, ontologyDocument.getOntology(), false);
  addField(doc, OntologyFieldNames.PARENT_ID, ontologyDocument.getParentId(), false);
  addField(doc, OntologyFieldNames.PARENT_NAME, ontologyDocument.getParentName(), true);
  addField(doc, OntologyFieldNames.CHILD_ID, ontologyDocument.getChildId(), false);
  addField(doc, OntologyFieldNames.CHILD_NAME, ontologyDocument.getChildName(), true);
  addField(doc, OntologyFieldNames.RELATIONSHIP_TYPE, ontologyDocument.getRelationshipType(), false);
  addField(doc, OntologyFieldNames.CYCLIC, ontologyDocument.isCyclicRelationship(), false);
  
  for (String synonym : ontologyDocument.getParentSynonyms()) {
    addField(doc, OntologyFieldNames.PARENT_SYNONYMS, synonym, false);
  }
  for (String synonym : ontologyDocument.getChildSynonyms()) {
    addField(doc, OntologyFieldNames.CHILDREN_SYNONYMS, synonym, false);
  }
  return doc;
}
uk.ac.ebi.intact.bridges.ontologiesOntologyDocumentisCyclicRelationship

Popular methods of OntologyDocument

  • getChildId
  • getChildName
  • getChildSynonyms
  • getOntology
  • getParentId
  • getParentName
  • getParentSynonyms
  • getRelationshipType
  • <init>
  • addAllChildSynonyms
  • addAllParentSynonyms
  • addChildSynonym
  • addAllParentSynonyms,
  • addChildSynonym,
  • addParentSynonym

Popular in Java

  • Making http requests using okhttp
  • findViewById (Activity)
  • setRequestProperty (URLConnection)
  • addToBackStack (FragmentTransaction)
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • JComboBox (javax.swing)
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now