if (ann.getProperty().getIRI().equals(Obo2OWLVocabulary.IRI_OIO_LogicalDefinitionViewRelation.getIRI())) { OWLAnnotationValue v = ann.getValue(); if (v instanceof OWLLiteral) {
/** * Table 5.8 Translation of Annotation Vocabulary. * * @return property map */ private static HashMap<String, IRI> initAnnotationPropertyMap() { HashMap<String, IRI> map = new HashMap<String, IRI>(); map.put(OboFormatTag.TAG_IS_OBSELETE.getTag(),OWLRDFVocabulary.OWL_DEPRECATED.getIRI()); map.put(OboFormatTag.TAG_NAME.getTag(),OWLRDFVocabulary.RDFS_LABEL.getIRI()); map.put(OboFormatTag.TAG_COMMENT.getTag(),OWLRDFVocabulary.RDFS_COMMENT.getIRI()); for(Obo2OWLVocabulary vac: Obo2OWLVocabulary.values()){ map.put(vac.getMappedTag(), vac.getIRI()); } /* map.put("expand_expression_to",Obo2OWLVocabulary.IRI_IAO_0000424.getIRI()); map.put("expand_assertion_to",Obo2OWLVocabulary.IRI_IAO_0000425.getIRI()); map.put("def",Obo2OWLVocabulary.IRI_IAO_0000115.getIRI()); map.put("synonym",Obo2OWLVocabulary.IRI_IAO_0000118.getIRI()); map.put("is_anti_symmetric",Obo2OWLVocabulary.IRI_IAO_0000427.getIRI()); map.put("replaced_by", Obo2OWLVocabulary.IRI_IAO_0100001.getIRI());*/ return map; }
IRI pIRI = null; for (OWLAnnotation ann : owlOntology.getAnnotations()) { if (ann.getProperty().getIRI().equals(Obo2OWLVocabulary.IRI_OIO_LogicalDefinitionViewRelation.getIRI())) { OWLAnnotationValue v = ann.getValue(); if (v instanceof OWLLiteral) {
/** * Pre process. */ protected void preProcess() { // converse of postProcess in obo2owl String viewRel = null; OWLAnnotationProperty logicalDef = manager.getOWLDataFactory().getOWLAnnotationProperty( Obo2OWLVocabulary.IRI_OIO_LogicalDefinitionViewRelation.getIRI()); List<OWLAnnotation> collect = asList(getOWLOntology().annotations(logicalDef)); for (OWLAnnotation ann : collect) { OWLAnnotationValue v = ann.getValue(); if (v instanceof OWLLiteral) { viewRel = ((OWLLiteral) v).getLiteral(); } else if (v.isIRI()) { viewRel = getIdentifier((IRI) v); } break; } if (viewRel == null) { return; } String view = viewRel; Set<OWLAxiom> rmAxioms = new HashSet<>(); Set<OWLAxiom> newAxioms = new HashSet<>(); getOWLOntology().axioms(AxiomType.EQUIVALENT_CLASSES) .forEach(eca -> preprocessEquivalents(view, rmAxioms, newAxioms, eca)); getOWLOntology().remove(rmAxioms); getOWLOntology().add(newAxioms); }
/** * Pre process. */ protected void preProcess() { // converse of postProcess in obo2owl String viewRel = null; OWLAnnotationProperty logicalDef = manager.getOWLDataFactory().getOWLAnnotationProperty( Obo2OWLVocabulary.IRI_OIO_LogicalDefinitionViewRelation.getIRI()); List<OWLAnnotation> collect = asList(getOWLOntology().annotations(logicalDef)); for (OWLAnnotation ann : collect) { OWLAnnotationValue v = ann.getValue(); if (v instanceof OWLLiteral) { viewRel = ((OWLLiteral) v).getLiteral(); } else if (v.isIRI()) { viewRel = getIdentifier((IRI) v); } break; } if (viewRel == null) { return; } String view = viewRel; Set<OWLAxiom> rmAxioms = new HashSet<>(); Set<OWLAxiom> newAxioms = new HashSet<>(); getOWLOntology().axioms(AxiomType.EQUIVALENT_CLASSES) .forEach(eca -> preprocessEquivalents(view, rmAxioms, newAxioms, eca)); getOWLOntology().remove(rmAxioms); getOWLOntology().add(newAxioms); }
/** * Pre process. */ protected void preProcess() { // converse of postProcess in obo2owl String viewRel = null; OWLAnnotationProperty logicalDef = manager.getOWLDataFactory().getOWLAnnotationProperty( Obo2OWLVocabulary.IRI_OIO_LogicalDefinitionViewRelation.getIRI()); List<OWLAnnotation> collect = asList(getOWLOntology().annotations(logicalDef)); for (OWLAnnotation ann : collect) { OWLAnnotationValue v = ann.getValue(); if (v instanceof OWLLiteral) { viewRel = ((OWLLiteral) v).getLiteral(); } else if (v.isIRI()) { viewRel = getIdentifier((IRI) v); } break; } if (viewRel == null) { return; } String view = viewRel; Set<OWLAxiom> rmAxioms = new HashSet<>(); Set<OWLAxiom> newAxioms = new HashSet<>(); getOWLOntology().axioms(AxiomType.EQUIVALENT_CLASSES) .forEach(eca -> preprocessEquivalents(view, rmAxioms, newAxioms, eca)); getOWLOntology().remove(rmAxioms); getOWLOntology().add(newAxioms); }
/** * Pre process. */ protected void preProcess() { // converse of postProcess in obo2owl String viewRel = null; OWLAnnotationProperty logicalDef = manager.getOWLDataFactory().getOWLAnnotationProperty( Obo2OWLVocabulary.IRI_OIO_LogicalDefinitionViewRelation.getIRI()); List<OWLAnnotation> collect = asList(getOWLOntology().annotations(logicalDef)); for (OWLAnnotation ann : collect) { OWLAnnotationValue v = ann.getValue(); if (v instanceof OWLLiteral) { viewRel = ((OWLLiteral) v).getLiteral(); } else if (v.isIRI()) { viewRel = getIdentifier((IRI) v); } break; } if (viewRel == null) { return; } String view = viewRel; Set<OWLAxiom> rmAxioms = new HashSet<>(); Set<OWLAxiom> newAxioms = new HashSet<>(); getOWLOntology().axioms(AxiomType.EQUIVALENT_CLASSES) .forEach(eca -> preprocessEquivalents(view, rmAxioms, newAxioms, eca)); getOWLOntology().remove(rmAxioms); getOWLOntology().add(newAxioms); }
/** * Tr tag to annotation prop. * * @param tag the tag * @return the oWL annotation property */ protected 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(iri, fac.getRDFSLabel(vocab.getLabel()))); } } return ap; }
/** * Tr tag to annotation prop. * * @param tag the tag * @return the oWL annotation property */ protected 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(iri, fac.getRDFSLabel(vocab.getLabel()))); } } return ap; }
/** * Tr tag to annotation prop. * * @param tag the tag * @return the oWL annotation property */ protected 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(iri, fac.getRDFSLabel(vocab.getLabel()))); } } return ap; }
/** * Tr tag to annotation prop. * * @param tag the tag * @return the oWL annotation property */ protected 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(iri, fac.getRDFSLabel(vocab.getLabel()))); } } return ap; }
/** * Table 5.8 Translation of Annotation Vocabulary. * * @return property map */ protected static Map<String, IRI> initAnnotationPropertyMap() { Map<String, IRI> map = new HashMap<>(); map.put(OboFormatTag.TAG_IS_OBSELETE.getTag(), OWLRDFVocabulary.OWL_DEPRECATED.getIRI()); map.put(OboFormatTag.TAG_NAME.getTag(), OWLRDFVocabulary.RDFS_LABEL.getIRI()); map.put(OboFormatTag.TAG_COMMENT.getTag(), OWLRDFVocabulary.RDFS_COMMENT.getIRI()); for (Obo2OWLVocabulary vac : Obo2OWLVocabulary.values()) { map.put(vac.getMappedTag(), vac.getIRI()); } return map; }
/** * Table 5.8 Translation of Annotation Vocabulary. * * @return property map */ protected static Map<String, IRI> initAnnotationPropertyMap() { Map<String, IRI> map = new HashMap<>(); map.put(OboFormatTag.TAG_IS_OBSELETE.getTag(), OWLRDFVocabulary.OWL_DEPRECATED.getIRI()); map.put(OboFormatTag.TAG_NAME.getTag(), OWLRDFVocabulary.RDFS_LABEL.getIRI()); map.put(OboFormatTag.TAG_COMMENT.getTag(), OWLRDFVocabulary.RDFS_COMMENT.getIRI()); for (Obo2OWLVocabulary vac : Obo2OWLVocabulary.values()) { map.put(vac.getMappedTag(), vac.getIRI()); } return map; }
@SuppressWarnings("null") protected AbstractMacroExpansionVisitor(OWLOntology o) { df = o.getOWLOntologyManager().getOWLDataFactory(); expandExpressionMap = new HashMap<>(); expandAssertionToMap = new HashMap<>(); OWLAnnotationProperty ap424 = df.getOWLAnnotationProperty(IRI_IAO_0000424.getIRI()); o.objectPropertiesInSignature() .forEach(p -> getAnnotationObjects(p, o.importsClosure(), ap424).forEach( a -> mapToExpand(p, a))); o.annotationPropertiesInSignature().forEach(p -> expandAssertions(o, p)); OIO_ISEXPANSION = df.getOWLAnnotationProperty( IRI.create(Obo2OWLConstants.OIOVOCAB_IRI_PREFIX, "is_expansion")); expansionMarkerAnnotation = df.getOWLAnnotation(OIO_ISEXPANSION, df.getOWLLiteral(true)); }
@SuppressWarnings("null") protected AbstractMacroExpansionVisitor(OWLOntology o) { df = o.getOWLOntologyManager().getOWLDataFactory(); expandExpressionMap = new HashMap<>(); expandAssertionToMap = new HashMap<>(); OWLAnnotationProperty ap424 = df.getOWLAnnotationProperty(IRI_IAO_0000424.getIRI()); o.objectPropertiesInSignature() .forEach(p -> getAnnotationObjects(p, o.importsClosure(), ap424).forEach( a -> mapToExpand(p, a))); o.annotationPropertiesInSignature().forEach(p -> expandAssertions(o, p)); OIO_ISEXPANSION = df.getOWLAnnotationProperty( IRI.create(Obo2OWLConstants.OIOVOCAB_IRI_PREFIX, "is_expansion")); expansionMarkerAnnotation = df.getOWLAnnotation(OIO_ISEXPANSION, df.getOWLLiteral(true)); }
/** * Table 5.8 Translation of Annotation Vocabulary. * * @return property map */ protected static Map<String, IRI> initAnnotationPropertyMap() { Map<String, IRI> map = new HashMap<>(); map.put(OboFormatTag.TAG_IS_OBSELETE.getTag(), OWLRDFVocabulary.OWL_DEPRECATED.getIRI()); map.put(OboFormatTag.TAG_NAME.getTag(), OWLRDFVocabulary.RDFS_LABEL.getIRI()); map.put(OboFormatTag.TAG_COMMENT.getTag(), OWLRDFVocabulary.RDFS_COMMENT.getIRI()); for (Obo2OWLVocabulary vac : Obo2OWLVocabulary.values()) { map.put(vac.getMappedTag(), vac.getIRI()); } return map; }
@SuppressWarnings("null") protected AbstractMacroExpansionVisitor(OWLOntology o) { df = o.getOWLOntologyManager().getOWLDataFactory(); expandExpressionMap = new HashMap<>(); expandAssertionToMap = new HashMap<>(); OWLAnnotationProperty ap424 = df.getOWLAnnotationProperty(IRI_IAO_0000424.getIRI()); o.objectPropertiesInSignature() .forEach(p -> getAnnotationObjects(p, o.importsClosure(), ap424).forEach( a -> mapToExpand(p, a))); o.annotationPropertiesInSignature().forEach(p -> expandAssertions(o, p)); OIO_ISEXPANSION = df.getOWLAnnotationProperty( IRI.create(Obo2OWLConstants.OIOVOCAB_IRI_PREFIX, "is_expansion")); expansionMarkerAnnotation = df.getOWLAnnotation(OIO_ISEXPANSION, df.getOWLLiteral(true)); }
@SuppressWarnings("null") protected AbstractMacroExpansionVisitor(OWLOntology o) { df = o.getOWLOntologyManager().getOWLDataFactory(); expandExpressionMap = new HashMap<>(); expandAssertionToMap = new HashMap<>(); OWLAnnotationProperty ap424 = df.getOWLAnnotationProperty(IRI_IAO_0000424.getIRI()); o.objectPropertiesInSignature() .forEach(p -> getAnnotationObjects(p, o.importsClosure(), ap424).forEach( a -> mapToExpand(p, a))); o.annotationPropertiesInSignature().forEach(p -> expandAssertions(o, p)); OIO_ISEXPANSION = df.getOWLAnnotationProperty( IRI.create(Obo2OWLConstants.OIOVOCAB_IRI_PREFIX, "is_expansion")); expansionMarkerAnnotation = df.getOWLAnnotation(OIO_ISEXPANSION, df.getOWLLiteral(true)); }
public static IRI getIRI(OBOFormatConstants.OboFormatTag tag) { return Obo2OWLConstants.getVocabularyObj(tag.getTag()).getIRI(); }