Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLObject


     * @param ax
     *        the ax
     */
    @SuppressWarnings("null")
    protected void tr(@Nonnull OWLClassAssertionAxiom ax) {
        OWLObject cls = ax.getClassExpression();
        if (!(cls instanceof OWLClass)) {
            return;
        }
        String clsIRI = ((OWLClass) cls).getIRI().toString();
        if (IRI_CLASS_SYNONYMTYPEDEF.equals(clsIRI)) {
View Full Code Here


                for (OWLAxiom ax : ontology.filterAxioms(Filters.annotations,
                        entity.getIRI(), INCLUDED)) {
                    ax.accept(checker);
                }
            }
            OWLObject match = checker.getMatch();
            if (match != null) {
                return getRendering(match);
            }
        }
        return alternateShortFormProvider.getShortForm(entity);
View Full Code Here

            return alternateShortFormProvider.getShortForm(entity);
        }
        OWLIndividual individual = (OWLIndividual) entity;
        // The candidate value to be rendered, we select this based on
        // ranking of annotation URI and ranking of lang (if present)
        OWLObject candidateValue = null;
        int lastURIMatchIndex = Integer.MAX_VALUE;
        int lastLangMatchIndex = Integer.MAX_VALUE;
        for (OWLOntology ontology : ontologySetProvider.getOntologies()) {
            for (OWLObjectPropertyAssertionAxiom ax : ontology
                    .getObjectPropertyAssertionAxioms(individual)) {
                int index = properties.indexOf(ax.getProperty());
                if (index == -1) {
                    continue;
                }
                if (index < lastURIMatchIndex) {
                    candidateValue = ax.getObject();
                }
            }
            for (OWLDataPropertyAssertionAxiom ax : ontology
                    .getDataPropertyAssertionAxioms(individual)) {
                int index = properties.indexOf(ax.getProperty());
                if (index == -1) {
                    continue;
                }
                if (index == lastURIMatchIndex) {
                    // Different property value but same prop, as previous
                    // candidate - look at lang tag for that URI
                    // and see if we take priority over the previous one
                    OWLObject obj = ax.getObject();
                    if (obj instanceof OWLLiteral) {
                        List<String> langList = preferredLanguageMap.get(ax
                                .getProperty());
                        if (langList != null) {
                            // There is no need to check if lang is null. It may
View Full Code Here

    public void shouldBuildAnnotation() {
        // given
        OWLAnnotation expected = df.getOWLAnnotation(ap, lit);
        BuilderAnnotation builder = new BuilderAnnotation(expected, df);
        // when
        OWLObject built = builder.buildObject();
        // then
        assertEquals(expected, built);
    }
View Full Code Here

        OWLAnnotationAssertionAxiom expected = df
                .getOWLAnnotationAssertionAxiom(ap, iri, lit, annotations);
        BuilderAnnotationAssertion builder = new BuilderAnnotationAssertion(
                expected, df);
        // when
        OWLObject built = builder.buildObject();
        // then
        assertEquals(expected, built);
    }
View Full Code Here

        // given
        OWLAnnotationProperty expected = df.getOWLAnnotationProperty(iri);
        BuilderAnnotationProperty builder = new BuilderAnnotationProperty(
                expected, df);
        // when
        OWLObject built = builder.buildObject();
        // then
        assertEquals(expected, built);
    }
View Full Code Here

        OWLAnnotationPropertyDomainAxiom expected = df
                .getOWLAnnotationPropertyDomainAxiom(ap, iri, annotations);
        BuilderAnnotationPropertyDomain builder = new BuilderAnnotationPropertyDomain(
                expected, df);
        // when
        OWLObject built = builder.buildObject();
        // then
        assertEquals(expected, built);
    }
View Full Code Here

        OWLAnnotationPropertyRangeAxiom expected = df
                .getOWLAnnotationPropertyRangeAxiom(ap, iri, annotations);
        BuilderAnnotationPropertyRange builder = new BuilderAnnotationPropertyRange(
                expected, df);
        // when
        OWLObject built = builder.buildObject();
        // then
        assertEquals(expected, built);
    }
View Full Code Here

        // given
        OWLAnonymousIndividual expected = df.getOWLAnonymousIndividual("id");
        BuilderAnonymousIndividual builder = new BuilderAnonymousIndividual(
                expected, df);
        // when
        OWLObject built = builder.buildObject();
        // then
        assertEquals(expected, built);
    }
View Full Code Here

        OWLAsymmetricObjectPropertyAxiom expected = df
                .getOWLAsymmetricObjectPropertyAxiom(op, annotations);
        BuilderAsymmetricObjectProperty builder = new BuilderAsymmetricObjectProperty(
                expected, df);
        // when
        OWLObject built = builder.buildObject();
        // then
        assertEquals(expected, built);
    }
View Full Code Here

TOP

Related Classes of org.semanticweb.owlapi.model.OWLObject

Copyright © 2018 www.massapicom. 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.