Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLEntity


        IRI p11IRI = prefixOWLOntologyFormat.getIRI(propertyName);
        Set<OWLEntity> hadParticipant = cidocOntology
                .getEntitiesInSignature(p11IRI);
        assertEquals("should have found " + propertyName, 1,
                hadParticipant.size());
        OWLEntity entity = hadParticipant.iterator().next();
        assertTrue("EntityType",
                OWLProperty.class.isAssignableFrom(entity.getClass()));
        if (entity instanceof OWLObjectProperty) {
            testProperty((OWLObjectProperty) entity, expectedDomain,
                    expectedRange, expectedSuperProperty);
        }
        if (entity instanceof OWLDataProperty) {
View Full Code Here


public class ClassDeclarationWithAnnotationsTestCase extends
        AbstractAnnotatedAxiomRoundTrippingTestCase {

    @Override
    protected OWLAxiom getMainAxiom(Set<OWLAnnotation> annos) {
        OWLEntity ent = Class(iri("A"));
        return df.getOWLDeclarationAxiom(ent, annos);
    }
View Full Code Here

public class AnnotationPropertyDeclarationWithAnnotationsTestCase extends
        AbstractAnnotatedAxiomRoundTrippingTestCase {

    @Override
    protected OWLAxiom getMainAxiom(Set<OWLAnnotation> annos) {
        OWLEntity ent = AnnotationProperty(iri("propA"));
        return df.getOWLDeclarationAxiom(ent, annos);
    }
View Full Code Here

public class ObjectPropertyDeclarationWithAnnotationsTestCase extends
        AbstractAnnotatedAxiomRoundTrippingTestCase {

    @Override
    protected OWLAxiom getMainAxiom(Set<OWLAnnotation> annos) {
        OWLEntity ent = ObjectProperty(iri("propP"));
        return Declaration(ent, annos);
    }
View Full Code Here

            @Nonnull Set<OWLAxiom> axioms) {
        currentExplanation = new HashSet<>(axioms);
        buildIndices();
        ExplanationTree root = new EntailedAxiomTree(entailment);
        insertChildren(seedExtractor.getSource(entailment), root);
        OWLEntity currentTarget = seedExtractor.getTarget(entailment);
        Set<OWLAxiom> axs = root.getUserObjectClosure();
        List<OWLAxiom> rootAxioms = new ArrayList<>();
        for (OWLAxiom ax : axioms) {
            if (!axs.contains(ax)) {
                rootAxioms.add(ax);
View Full Code Here

        Set<OWLAnnotation> annotations = new HashSet<>();
        for (int i = 0; i < 2; i++) {
            OWLLiteral lit = Literal("Annotation " + (i + 1));
            annotations.add(df.getOWLAnnotation(RDFSLabel(), lit));
        }
        OWLEntity entity = NamedIndividual(IRI("http://www.another.com/ont#peter"));
        addAxiom(ont, Declaration(entity));
        OWLAnnotationAssertionAxiom ax = df.getOWLAnnotationAssertionAxiom(
                prop, entity.getIRI(), Literal("X", "en"), annotations);
        addAxiom(ont, ax);
        return ont;
    }
View Full Code Here

public class DataPropertyDeclarationWithAnnotationsTestCase extends
        AbstractAnnotatedAxiomRoundTrippingTestCase {

    @Override
    protected OWLAxiom getMainAxiom(Set<OWLAnnotation> annos) {
        OWLEntity ent = DataProperty(iri("propD"));
        return Declaration(ent, annos);
    }
View Full Code Here

            annotationValue = getUnquotedString(value);
        }
        IRI propertyIRI = getTagIRI(getTagName());
        OWLAnnotationProperty property = df
                .getOWLAnnotationProperty(propertyIRI);
        OWLEntity currentEntity = getConsumer().getCurrentEntity();
        OWLLiteral literal = df.getOWLLiteral(annotationValue);
        OWLAnnotationAssertionAxiom ax = df.getOWLAnnotationAssertionAxiom(
                property, currentEntity.getIRI(), literal, xrefAnnotations);
        applyChange(new AddAxiom(getOntology(), ax));
    }
View Full Code Here

    @Override
    public void handle(String currentId, String value, String qualifierBlock,
            String comment) {
        getConsumer().setCurrentId(value);
        final OWLEntity entity = getConsumer().getCurrentEntity();
        if (entity != null) {
            applyChange(new AddAxiom(getOntology(), getDataFactory()
                    .getOWLDeclarationAxiom(entity)));
        }
    }
View Full Code Here

    @Override
    public void handle(String currentId, @Nonnull String value,
            String qualifierBlock, String comment) {
        // This is an annotation - but add as a label
        OWLEntity ent;
        if (getConsumer().isTerm()) {
            ent = getDataFactory().getOWLClass(getIRIFromOBOId(currentId));
        } else if (getConsumer().isTypedef()) {
            ent = getDataFactory().getOWLObjectProperty(
                    getIRIFromOBOId(currentId));
        } else {
            ent = getDataFactory().getOWLNamedIndividual(
                    getIRIFromOBOId(currentId));
        }
        OWLLiteral con = getDataFactory().getOWLLiteral(value);
        OWLAxiom ax = getDataFactory().getOWLAnnotationAssertionAxiom(
                getDataFactory().getOWLAnnotationProperty(
                        OWLRDFVocabulary.RDFS_LABEL.getIRI()), ent.getIRI(),
                con);
        applyChange(new AddAxiom(getOntology(), ax));
    }
View Full Code Here

TOP

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

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.