Examples of OWLNamedIndividual


Examples of org.semanticweb.owlapi.model.OWLNamedIndividual

    @Test
    public void testNegativeObjectPropertyAxiomAccessors() {
        OWLOntology ont = getOWLOntology("ont");
        OWLObjectProperty prop = ObjectProperty(iri("prop"));
        OWLNamedIndividual indA = NamedIndividual(iri("indA"));
        OWLNamedIndividual indB = NamedIndividual(iri("indB"));
        OWLOntologyManager man = ont.getOWLOntologyManager();
        OWLNegativeObjectPropertyAssertionAxiom ax = NegativeObjectPropertyAssertion(
                prop, indA, indB);
        man.addAxiom(ont, ax);
        performAxiomTests(ont, ax);
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLNamedIndividual

    @Test
    public void testDataPropertyAxiomAccessors() {
        OWLOntology ont = getOWLOntology("ont");
        OWLDataProperty prop = DataProperty(iri("prop"));
        OWLNamedIndividual indA = NamedIndividual(iri("indA"));
        OWLLiteral lit = Literal(3);
        OWLOntologyManager man = ont.getOWLOntologyManager();
        OWLDataPropertyAssertionAxiom ax = DataPropertyAssertion(prop, indA,
                lit);
        man.addAxiom(ont, ax);
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLNamedIndividual

    @Test
    public void testNegativeDataPropertyAxiomAccessors() {
        OWLOntology ont = getOWLOntology("ont");
        OWLDataProperty prop = DataProperty(iri("prop"));
        OWLNamedIndividual indA = NamedIndividual(iri("indA"));
        OWLLiteral lit = Literal(3);
        OWLOntologyManager man = ont.getOWLOntologyManager();
        OWLNegativeDataPropertyAssertionAxiom ax = NegativeDataPropertyAssertion(
                prop, indA, lit);
        man.addAxiom(ont, ax);
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLNamedIndividual

    }

    @Test
    public void testSameIndividualAxiomAccessors() {
        OWLOntology ont = getOWLOntology("ont");
        OWLNamedIndividual indA = NamedIndividual(iri("indA"));
        OWLNamedIndividual indB = NamedIndividual(iri("indB"));
        OWLNamedIndividual indC = NamedIndividual(iri("indC"));
        OWLOntologyManager man = ont.getOWLOntologyManager();
        OWLSameIndividualAxiom ax = SameIndividual(indA, indB, indC);
        man.addAxiom(ont, ax);
        performAxiomTests(ont, ax);
        assertTrue(ont.getSameIndividualAxioms(indA).contains(ax));
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLNamedIndividual

    @Nonnull
    private OWLOntology createTestOntology()
            throws OWLOntologyCreationException {
        OWLOntology o = m.createOntology();
        OWLNamedIndividual i = df.getOWLNamedIndividual(IRI(Namespaces.RDF
                .getPrefixIRI()));
        m.addAxiom(o, df.getOWLDeclarationAxiom(i));
        i = df.getOWLNamedIndividual(OWLRDFVocabulary.RDF_TYPE.getIRI());
        m.addAxiom(o, df.getOWLDeclarationAxiom(i));
        return o;
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLNamedIndividual

    }

    @Test
    public void testDifferentIndividualsAxiomAccessors() {
        OWLOntology ont = getOWLOntology("ont");
        OWLNamedIndividual indA = NamedIndividual(iri("indA"));
        OWLNamedIndividual indB = NamedIndividual(iri("indB"));
        OWLNamedIndividual indC = NamedIndividual(iri("indC"));
        OWLOntologyManager man = ont.getOWLOntologyManager();
        OWLDifferentIndividualsAxiom ax = DifferentIndividuals(indA, indB, indC);
        man.addAxiom(ont, ax);
        performAxiomTests(ont, ax);
        assertTrue(ont.getDifferentIndividualAxioms(indA).contains(ax));
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLNamedIndividual

    public boolean hasObjectPropertyRelationship(OWLNamedIndividual subject,OWLObjectPropertyExpression propertyExpression,OWLNamedIndividual object) {
        checkPreConditions(subject,propertyExpression,object);
        if (!m_isConsistent) return true;
        OWLObjectProperty property=propertyExpression.getNamedProperty();
        if (propertyExpression.getSimplified().isAnonymous()) {
            OWLNamedIndividual tmp=subject;
            subject=object;
            object=tmp;
        }
        OWLDataFactory factory=getDataFactory();
        AtomicRole role=H(property);
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLNamedIndividual

            if (i.isAnonymous()) {
                throw new IllegalArgumentException("OWLDifferentIndividualsAxiom axioms are not allowed to be used "+"with anonymous individuals (see OWL 2 Syntax Sec 11.2) but the axiom "+axiom+" cotains an anonymous individual. ");
            }
        }
        for (int i=0;i<list.size()-1;i++) {
            OWLNamedIndividual head=list.get(i).asOWLNamedIndividual();
            for (int j=i+1;j<list.size();j++) {
                OWLNamedIndividual next=list.get(j).asOWLNamedIndividual();
                if (!reasoner.hasType(head,factory.getOWLObjectComplementOf(factory.getOWLObjectOneOf(next)),false))
                    return Boolean.FALSE;
            }
        }
        return Boolean.TRUE;
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLNamedIndividual

                throw new IllegalArgumentException("OWLSameIndividualAxiom axioms are not allowed to be used "+"with anonymous individuals (see OWL 2 Syntax Sec 11.2) but the axiom "+axiom+" cotains an anonymous individual. ");
            }
        }
        Iterator<OWLIndividual> i=axiom.getIndividuals().iterator();
        if (i.hasNext()) {
            OWLNamedIndividual first=i.next().asOWLNamedIndividual();
            while (i.hasNext()) {
                OWLNamedIndividual next=i.next().asOWLNamedIndividual();
                if (!reasoner.hasType(first,factory.getOWLObjectOneOf(next),false))
                    return Boolean.FALSE;
            }
        }
        return Boolean.TRUE;
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLNamedIndividual

                    // We now that the set of object properties is a singleton set since otherwise this would
                    // not be a valid root and the map should have one single entry, but lets double-check.
                    if (ind2OP.size()!=1) {
                        throw new RuntimeException("Internal error: HermiT decided that the anonymous individuals form a valid forest, but actually they do not. ");
                    }
                    OWLNamedIndividual subject=ind2OP.keySet().iterator().next();
                    Set<OWLObjectPropertyExpression> ops=ind2OP.get(subject);
                    if (ops.size()!=1) {
                        throw new RuntimeException("Internal error: HermiT decided that the anonymous individuals form a valid forest, but actually they do not. ");
                    }
                    OWLObjectPropertyExpression op=ops.iterator().next().getInverseProperty().getSimplified();
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.