private static Set<OWLAnnotationProperty> getProperties(OWLDataFactory factory, OboFormatTag...tags) { Set<OWLAnnotationProperty> set = new HashSet<OWLAnnotationProperty>(); for (OboFormatTag tag : tags) { IRI iri = Obo2Owl.trTagToIRI(tag.getTag()); if (iri != null) { OWLAnnotationProperty property = factory.getOWLAnnotationProperty(iri); set.add(property); } } return set; }
private OWLAnnotationProperty trTagToAnnotationProp(String tag) { IRI iri = trTagToIRI(tag); OWLAnnotationProperty ap = fac.getOWLAnnotationProperty(iri); if (!apToDeclare.contains(ap)) { apToDeclare.add(ap); add(fac.getOWLDeclarationAxiom(ap)); Obo2OWLVocabulary vocab = Obo2OWLConstants.getVocabularyObj(tag); if(vocab != null){ add (fac.getOWLAnnotationAssertionAxiom(fac.getRDFSLabel(), iri, trLiteral( vocab.getLabel()) ) ); } } return ap; }
private static void addVersion(OWLOntology ontology, String version, OWLOntologyManager manager){ OWLDataFactory fac = manager.getOWLDataFactory(); OWLAnnotationProperty ap = fac.getOWLAnnotationProperty( Obo2Owl.trTagToIRI(OboFormatTag.TAG_REMARK.getTag())); OWLAnnotation ann = fac.getOWLAnnotation(ap, fac.getOWLLiteral(version)); OWLAxiom ax = fac.getOWLAnnotationAssertionAxiom(ontology.getOntologyID().getOntologyIRI(), ann); manager.applyChange(new AddAxiom(ontology, ax)); } }
private static void addVersion(OWLOntology ontology, String version, OWLOntologyManager manager){ OWLDataFactory fac = manager.getOWLDataFactory(); OWLAnnotationProperty ap = fac.getOWLAnnotationProperty( Obo2Owl.trTagToIRI(OboFormatTag.TAG_REMARK.getTag())); OWLAnnotation ann = fac.getOWLAnnotation(ap, fac.getOWLLiteral(version)); OWLAxiom ax = fac.getOWLAnnotationAssertionAxiom(ontology.getOntologyID().getOntologyIRI(), ann); manager.applyChange(new AddAxiom(ontology, ax)); } }
String tagString = owlObjectToTag(property); if (OboFormatTag.TAG_COMMENT.getTag().equals(tagString)) { property = fac.getOWLAnnotationProperty(Obo2Owl.trTagToIRI(OboFormatTag.TAG_REMARK.getTag()));