private void translateMatrixCell( Taxon taxon, Character character, State state, OWLNamedIndividual matrixCell) { this.addClass(matrixCell, this.factory.getOWLClass(IRI.create(CDAO.MATRIX_CELL))); this.addPropertyAssertion( IRI.create(CDAO.BELONGS_TO_CHARACTER), matrixCell, this.characterToOWLMap.get(character)); this.addPropertyAssertion( IRI.create(CDAO.BELONGS_TO_TU), matrixCell, this.taxonOTUToOWLMap.get(taxon)); this.addPropertyAssertion( IRI.create(CDAO.HAS_STATE), matrixCell, this.stateToOWLMap.get(state)); if (taxon.getValidName() != null) { final IRI taxonIRI = this.convertOBOIRI(taxon.getValidName().getID()); final OWLClass taxonClass = this.factory.getOWLClass(taxonIRI); for (Phenotype phenotype : state.getPhenotypes()) { final OWLClass eq = this.phenotypeToOWLMap.get(phenotype); final OWLObjectProperty exhibits = this.factory.getOWLObjectProperty(IRI.create(PHENOSCAPE.EXHIBITS)); final OWLClassExpression exhibitsSomeEQ = this.factory.getOWLObjectSomeValuesFrom(exhibits, eq); final OWLAnnotationProperty positedBy = this.factory.getOWLAnnotationProperty(IRI.create(PHENOSCAPE.POSITED_BY)); final OWLAnnotation positedByAnnotation = this.factory.getOWLAnnotation(positedBy, matrixCell.getIRI()); final Set<OWLAnnotation> annotations = Collections.singleton(positedByAnnotation); final OWLSubClassOfAxiom annotatedSubClassOfAxiom = this.factory.getOWLSubClassOfAxiom(taxonClass, exhibitsSomeEQ, annotations); this.ontologyManager.addAxiom(this.ontology, annotatedSubClassOfAxiom); } } }
private void translateTaxon(Taxon taxon, OWLNamedIndividual otu) { this.taxonOTUToOWLMap.put(taxon, otu); this.addClass(otu, this.factory.getOWLClass(IRI.create(CDAO.OTU))); if (StringUtils.isNotBlank(taxon.getPublicationName())) { final OWLLiteral label = this.factory.getOWLLiteral(taxon.getPublicationName()); this.addAnnotation(OWLRDFVocabulary.RDFS_LABEL.getIRI(), otu.getIRI(), label); } if (taxon.getValidName() != null) { final IRI taxonIRI = this.convertOBOIRI(taxon.getValidName().getID()); this.addClass( this.factory.getOWLNamedIndividual(taxonIRI), this.factory.getOWLClass(IRI.create(PHENOSCAPE.TAXON))); this.addPropertyAssertion( IRI.create(CDAO.HAS_EXTERNAL_REFERENCE), otu, this.factory.getOWLNamedIndividual(taxonIRI)); } if (StringUtils.isNotBlank(taxon.getComment())) { final OWLLiteral comment = factory.getOWLLiteral(taxon.getComment()); this.addAnnotation(OWLRDFVocabulary.RDFS_COMMENT.getIRI(), otu.getIRI(), comment); } for (Specimen specimen : taxon.getSpecimens()) { final OWLAnonymousIndividual owlSpecimen = this.factory.getOWLAnonymousIndividual(); this.addPropertyAssertion(IRI.create(DWC.HAS_SPECIMEN), otu, owlSpecimen); this.translateSpecimen(specimen, owlSpecimen); } }