/** * Gets the identifier. * * @param obj the obj * @return the identifier */ @Nullable public String getIdentifier(OWLObject obj) { try { return getIdentifierFromObject(obj, getOWLOntology()); } catch (UntranslatableAxiomException e) { error(e.getMessage(), true); } return null; }
/** * Gets the identifier. * * @param obj the obj * @return the identifier */ @Nullable public String getIdentifier(OWLObject obj) { try { return getIdentifierFromObject(obj, getOWLOntology()); } catch (UntranslatableAxiomException e) { error(e.getMessage(), true); } return null; }
/** * Gets the identifier. * * @param obj the obj * @return the identifier */ @Nullable public String getIdentifier(OWLObject obj) { try { return getIdentifierFromObject(obj, getOWLOntology()); } catch (UntranslatableAxiomException e) { error(e.getMessage(), true); } return null; }
/** * Gets the identifier. * * @param obj the obj * @return the identifier */ @Nullable public String getIdentifier(OWLObject obj) { try { return getIdentifierFromObject(obj, getOWLOntology()); } catch (UntranslatableAxiomException e) { error(e.getMessage(), true); } return null; }
/** * 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. * * @return the oBO doc */ protected OBODoc tr() { setObodoc(new OBODoc()); preProcess(); tr(getOWLOntology()); // declarations need to be sorted - otherwise there is a risk of id being processed before // altId, which causes spurious clauses. accept(getOWLOntology().axioms(AxiomType.DECLARATION).sorted()); AxiomType.skipDeclarations().forEach(t -> accept(getOWLOntology().axioms(t))); if (!untranslatableAxioms.isEmpty() && !discardUntranslatable) { String axiomString = OwlStringTools.translate(untranslatableAxioms, manager); if (!axiomString.isEmpty()) { Frame headerFrame = getObodoc().getHeaderFrame(); if (headerFrame == null) { headerFrame = new Frame(FrameType.HEADER); getObodoc().setHeaderFrame(headerFrame); } headerFrame.addClause(new Clause(OboFormatTag.TAG_OWL_AXIOMS, axiomString)); } } return getObodoc(); }
/** * Tr. * * @return the oBO doc */ protected OBODoc tr() { setObodoc(new OBODoc()); preProcess(); tr(getOWLOntology()); // declarations need to be sorted - otherwise there is a risk of id being processed before // altId, which causes spurious clauses. accept(getOWLOntology().axioms(AxiomType.DECLARATION).sorted()); AxiomType.skipDeclarations().forEach(t -> accept(getOWLOntology().axioms(t))); if (!untranslatableAxioms.isEmpty() && !discardUntranslatable) { String axiomString = OwlStringTools.translate(untranslatableAxioms, manager); if (!axiomString.isEmpty()) { Frame headerFrame = getObodoc().getHeaderFrame(); if (headerFrame == null) { headerFrame = new Frame(FrameType.HEADER); getObodoc().setHeaderFrame(headerFrame); } headerFrame.addClause(new Clause(OboFormatTag.TAG_OWL_AXIOMS, axiomString)); } } return getObodoc(); }
/** * Tr. * * @return the oBO doc */ protected OBODoc tr() { setObodoc(new OBODoc()); preProcess(); tr(getOWLOntology()); // declarations need to be sorted - otherwise there is a risk of id being processed before // altId, which causes spurious clauses. accept(getOWLOntology().axioms(AxiomType.DECLARATION).sorted()); AxiomType.skipDeclarations().forEach(t -> accept(getOWLOntology().axioms(t))); if (!untranslatableAxioms.isEmpty() && !discardUntranslatable) { String axiomString = OwlStringTools.translate(untranslatableAxioms, manager); if (!axiomString.isEmpty()) { Frame headerFrame = getObodoc().getHeaderFrame(); if (headerFrame == null) { headerFrame = new Frame(FrameType.HEADER); getObodoc().setHeaderFrame(headerFrame); } headerFrame.addClause(new Clause(OboFormatTag.TAG_OWL_AXIOMS, axiomString)); } } return getObodoc(); }
/** * Tr. * * @return the oBO doc */ protected OBODoc tr() { setObodoc(new OBODoc()); preProcess(); tr(getOWLOntology()); // declarations need to be sorted - otherwise there is a risk of id being processed before // altId, which causes spurious clauses. accept(getOWLOntology().axioms(AxiomType.DECLARATION).sorted()); AxiomType.skipDeclarations().forEach(t -> accept(getOWLOntology().axioms(t))); if (!untranslatableAxioms.isEmpty() && !discardUntranslatable) { String axiomString = OwlStringTools.translate(untranslatableAxioms, manager); if (!axiomString.isEmpty()) { Frame headerFrame = getObodoc().getHeaderFrame(); if (headerFrame == null) { headerFrame = new Frame(FrameType.HEADER); getObodoc().setHeaderFrame(headerFrame); } headerFrame.addClause(new Clause(OboFormatTag.TAG_OWL_AXIOMS, axiomString)); } } return getObodoc(); }
String nameValue = ""; String scopeValue = null; Optional<OWLAnnotation> a = getAnnotationObjects(indv, getOWLOntology(), df.getRDFSLabel()).findFirst(); if (a.isPresent()) { nameValue = '"' + a.get().getValue().asLiteral().get().getLiteral() + '"'; a = getAnnotationObjects(indv, getOWLOntology()) .filter(ann -> !ann.getProperty().equals(df.getRDFSLabel())) .findFirst(); c.addValue(indvId); String nameValue = ""; Optional<OWLAnnotation> value = getAnnotationObjects(indv, getOWLOntology(), df.getRDFSLabel()).findFirst(); if (value.isPresent()) {
String nameValue = ""; String scopeValue = null; Optional<OWLAnnotation> a = getAnnotationObjects(indv, getOWLOntology(), df.getRDFSLabel()).findFirst(); if (a.isPresent()) { nameValue = '"' + a.get().getValue().asLiteral().get().getLiteral() + '"'; a = getAnnotationObjects(indv, getOWLOntology()) .filter(ann -> !ann.getProperty().equals(df.getRDFSLabel())) .findFirst(); c.addValue(indvId); String nameValue = ""; Optional<OWLAnnotation> value = getAnnotationObjects(indv, getOWLOntology(), df.getRDFSLabel()).findFirst(); if (value.isPresent()) {
String nameValue = ""; String scopeValue = null; Optional<OWLAnnotation> a = getAnnotationObjects(indv, getOWLOntology(), df.getRDFSLabel()).findFirst(); if (a.isPresent()) { nameValue = '"' + a.get().getValue().asLiteral().get().getLiteral() + '"'; a = getAnnotationObjects(indv, getOWLOntology()) .filter(ann -> !ann.getProperty().equals(df.getRDFSLabel())) .findFirst(); c.addValue(indvId); String nameValue = ""; Optional<OWLAnnotation> value = getAnnotationObjects(indv, getOWLOntology(), df.getRDFSLabel()).findFirst(); if (value.isPresent()) {
String nameValue = ""; String scopeValue = null; Optional<OWLAnnotation> a = getAnnotationObjects(indv, getOWLOntology(), df.getRDFSLabel()).findFirst(); if (a.isPresent()) { nameValue = '"' + a.get().getValue().asLiteral().get().getLiteral() + '"'; a = getAnnotationObjects(indv, getOWLOntology()) .filter(ann -> !ann.getProperty().equals(df.getRDFSLabel())) .findFirst(); c.addValue(indvId); String nameValue = ""; Optional<OWLAnnotation> value = getAnnotationObjects(indv, getOWLOntology(), df.getRDFSLabel()).findFirst(); if (value.isPresent()) {
String scope = null; for (OWLAnnotationAssertionAxiom axiom : asList( getOWLOntology().annotationAssertionAxioms(sub.getIRI()))) { String tg = owlObjectToTag(axiom.getProperty()); if (OboFormatTag.TAG_NAME.getTag().equals(tg)) { String comment = ""; for (OWLAnnotationAssertionAxiom axiom : asList( getOWLOntology().annotationAssertionAxioms(sub.getIRI()))) { String tg = owlObjectToTag(axiom.getProperty()); if (OboFormatTag.TAG_COMMENT.getTag().equals(tg)) {
String scope = null; for (OWLAnnotationAssertionAxiom axiom : asList( getOWLOntology().annotationAssertionAxioms(sub.getIRI()))) { String tg = owlObjectToTag(axiom.getProperty()); if (OboFormatTag.TAG_NAME.getTag().equals(tg)) { String comment = ""; for (OWLAnnotationAssertionAxiom axiom : asList( getOWLOntology().annotationAssertionAxioms(sub.getIRI()))) { String tg = owlObjectToTag(axiom.getProperty()); if (OboFormatTag.TAG_COMMENT.getTag().equals(tg)) {
String scope = null; for (OWLAnnotationAssertionAxiom axiom : asList( getOWLOntology().annotationAssertionAxioms(sub.getIRI()))) { String tg = owlObjectToTag(axiom.getProperty()); if (OboFormatTag.TAG_NAME.getTag().equals(tg)) { String comment = ""; for (OWLAnnotationAssertionAxiom axiom : asList( getOWLOntology().annotationAssertionAxioms(sub.getIRI()))) { String tg = owlObjectToTag(axiom.getProperty()); if (OboFormatTag.TAG_COMMENT.getTag().equals(tg)) {
String scope = null; for (OWLAnnotationAssertionAxiom axiom : asList( getOWLOntology().annotationAssertionAxioms(sub.getIRI()))) { String tg = owlObjectToTag(axiom.getProperty()); if (OboFormatTag.TAG_NAME.getTag().equals(tg)) { String comment = ""; for (OWLAnnotationAssertionAxiom axiom : asList( getOWLOntology().annotationAssertionAxioms(sub.getIRI()))) { String tg = owlObjectToTag(axiom.getProperty()); if (OboFormatTag.TAG_COMMENT.getTag().equals(tg)) {