Examples of OWLAnnotationProperty


Examples of org.semanticweb.owlapi.model.OWLAnnotationProperty

        }
    }

    @SuppressWarnings("null")
    protected void tr(@Nonnull OWLSubAnnotationPropertyOfAxiom ax) {
        OWLAnnotationProperty sup = ax.getSuperProperty();
        OWLAnnotationProperty sub = ax.getSubProperty();
        if (sub.isBottomEntity() || sub.isTopEntity() || sup.isBottomEntity()
                || sup.isTopEntity()) {
            error("SubAnnotationProperties using Top or Bottom entites are not supported in OBO.",
                    false);
            return;
        }
        String tagObject = owlObjectToTag(sup);
        if (OboFormatTag.TAG_SYNONYMTYPEDEF.getTag().equals(tagObject)) {
            String name = "";
            String scope = null;
            for (OWLAnnotationAssertionAxiom axiom : getOWLOntology()
                    .getAnnotationAssertionAxioms(sub.getIRI())) {
                String tg = owlObjectToTag(axiom.getProperty());
                if (OboFormatTag.TAG_NAME.getTag().equals(tg)) {
                    name = ((OWLLiteral) axiom.getValue()).getLiteral();
                } else if (OboFormatTag.TAG_SCOPE.getTag().equals(tg)) {
                    scope = owlObjectToTag(axiom.getValue());
                }
            }
            Frame hf = getObodoc().getHeaderFrame();
            Clause clause = new Clause(OboFormatTag.TAG_SYNONYMTYPEDEF);
            clause.addValue(getIdentifier(sub));
            clause.addValue(name);
            if (scope != null) {
                clause.addValue(scope);
            }
            addQualifiers(clause, ax.getAnnotations());
            if (!hf.getClauses().contains(clause)) {
                hf.addClause(clause);
            } else {
                LOG.error("duplicate clause: {} in header", clause);
            }
            return;
        } else if (OboFormatTag.TAG_SUBSETDEF.getTag().equals(tagObject)) {
            String comment = "";
            for (OWLAnnotationAssertionAxiom axiom : getOWLOntology()
                    .getAnnotationAssertionAxioms(sub.getIRI())) {
                String tg = owlObjectToTag(axiom.getProperty());
                if (OboFormatTag.TAG_COMMENT.getTag().equals(tg)) {
                    comment = ((OWLLiteral) axiom.getValue()).getLiteral();
                    break;
                }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLAnnotationProperty

            Clause c2 = new Clause(OboFormatTag.TAG_DATA_VERSION.getTag());
            c2.setValue(vid);
            f.addClause(c2);
        }
        for (OWLAnnotation ann : ontology.getAnnotations()) {
            OWLAnnotationProperty property = ann.getProperty();
            String tagString = owlObjectToTag(property);
            if (OboFormatTag.TAG_COMMENT.getTag().equals(tagString)) {
                property = fac.getOWLAnnotationProperty(OWLAPIObo2Owl
                        .trTagToIRI(OboFormatTag.TAG_REMARK.getTag()));
            }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLAnnotationProperty

        } else if (entity instanceof OWLObjectProperty) {
            f = getTypedefFrame(entity.asOWLObjectProperty());
        } else if (entity instanceof OWLAnnotationProperty) {
            for (OWLAxiom a : set) {
                OWLAnnotationAssertionAxiom ax = (OWLAnnotationAssertionAxiom) a;
                OWLAnnotationProperty prop = ax.getProperty();
                String tag = owlObjectToTag(prop);
                if (OboFormatTag.TAG_IS_METADATA_TAG.getTag().equals(tag)) {
                    f = getTypedefFrame(entity);
                    break;
                }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLAnnotationProperty

            for (OWLOntology o : ontologies) {
                Set<OWLAnnotationAssertionAxiom> aas = o
                        .getAxioms(AxiomType.ANNOTATION_ASSERTION);
                for (OWLAnnotationAssertionAxiom aa : aas) {
                    OWLAnnotationValue v = aa.getValue();
                    OWLAnnotationProperty property = aa.getProperty();
                    if (isMatchingLabel(label, v, property)) {
                        OWLAnnotationSubject obj = aa.getSubject();
                        if (obj instanceof IRI) {
                            return (IRI) obj;
                        }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLAnnotationProperty

    protected OWLOntology getOntologyWithPunnedInvalidDeclarations()
            throws OWLOntologyCreationException {
        OWLOntology o = m.createOntology(IRI
                .create("urn:forbiddenPunningNotRedeclared"));
        OWLObjectProperty op = df.getOWLObjectProperty(iri("testProperty"));
        OWLAnnotationProperty ap = df
                .getOWLAnnotationProperty(iri("testProperty"));
        m.addAxiom(o, df.getOWLDeclarationAxiom(op));
        m.addAxiom(o, df.getOWLTransitiveObjectPropertyAxiom(op));
        OWLAnnotationAssertionAxiom assertion = df
                .getOWLAnnotationAssertionAxiom(iri("test"),
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLAnnotationProperty

    protected OWLOntology getOntologyWithMissingDeclarations()
            throws OWLOntologyCreationException {
        OWLOntology o = m.createOntology(IRI.create("urn:missingDeclarations"));
        OWLObjectProperty op = df
                .getOWLObjectProperty(iri("testObjectProperty"));
        OWLAnnotationProperty ap = df
                .getOWLAnnotationProperty(iri("testAnnotationProperty"));
        m.addAxiom(o, df.getOWLTransitiveObjectPropertyAxiom(op));
        OWLAnnotationAssertionAxiom assertion = df
                .getOWLAnnotationAssertionAxiom(iri("test"),
                        df.getOWLAnnotation(ap, iri("otherTest")));
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLAnnotationProperty

    @Test
    public void shouldNotAddDeclarationsForIllegalPunnings()
            throws OWLOntologyCreationException, OWLOntologyStorageException {
        OWLOntology o = getOntologyWithPunnedInvalidDeclarations();
        OWLOntology reloaded = roundTrip(o, format);
        OWLAnnotationProperty ap = df
                .getOWLAnnotationProperty(iri("testProperty"));
        OWLDeclarationAxiom ax = df.getOWLDeclarationAxiom(ap);
        assertFalse("ap testProperty should not have been declared",
                reloaded.containsAxiom(ax));
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLAnnotationProperty

            throws OWLOntologyCreationException, OWLOntologyStorageException {
        OWLOntology o = getOntologyWithMissingDeclarations();
        OWLOntology reloaded = roundTrip(o, format);
        OWLObjectProperty op = df
                .getOWLObjectProperty(iri("testObjectProperty"));
        OWLAnnotationProperty ap = df
                .getOWLAnnotationProperty(iri("testAnnotationProperty"));
        assertTrue(reloaded.containsAxiom(df.getOWLDeclarationAxiom(ap)));
        assertTrue(reloaded.containsAxiom(df.getOWLDeclarationAxiom(op)));
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLAnnotationProperty

        OWLOntology owlOnt = convertOBOFile("multiple_def_xref_test.obo");
        int n = 0;
        for (OWLAxiom ax : owlOnt.getAxioms()) {
            // System.out.println(ax);
            for (OWLAnnotation ann : ax.getAnnotations()) {
                OWLAnnotationProperty p = ann.getProperty();
                if (p.getIRI()
                        .equals(IRI
                                .create("http://www.geneontology.org/formats/oboInOwl#hasDbXref"))) {
                    OWLLiteral v = (OWLLiteral) ann.getValue();
                    // expect this twice, as we have annotations on synonyms
                    if (v.getLiteral().equals("BTO:0001750")) {
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLAnnotationProperty

                OWLClass subClass = (OWLClass) subClassCE;
                if (superClass.getIRI().equals(t1)
                        && subClass.getIRI().equals(t3)) {
                    Set<OWLAnnotation> annotations = axiom.getAnnotations();
                    for (OWLAnnotation owlAnnotation : annotations) {
                        OWLAnnotationProperty property = owlAnnotation
                                .getProperty();
                        if (property.getIRI().equals(isInferredIRI)) {
                            OWLAnnotationValue value = owlAnnotation.getValue();
                            if (value instanceof OWLLiteral) {
                                OWLLiteral literal = (OWLLiteral) value;
                                assertEquals("true", literal.getLiteral());
                            } else {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.