Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLIndividual


    public void shouldRoundTrip() throws Exception {
        OWLClass c = Class(IRI("urn:test#C"));
        OWLClass d = Class(IRI("urn:test#D"));
        OWLObjectProperty p = ObjectProperty(IRI("urn:test#p"));
        OWLDataProperty q = DataProperty(IRI("urn:test#q"));
        OWLIndividual i = AnonymousIndividual();
        OWLOntology ontology = m.createOntology();
        List<OWLOntologyChange> changes = new ArrayList<>();
        changes.add(new AddAxiom(ontology, SubClassOf(c, ObjectHasValue(p, i))));
        changes.add(new AddAxiom(ontology, ClassAssertion(d, i)));
        changes.add(new AddAxiom(ontology, DataPropertyAssertion(q, i,
View Full Code Here


        IRI ont = IRI.create(ns + "ontology.owl");
        OWLNamedIndividual i = df.getOWLNamedIndividual(IRI.create(ns, "i"));
        OWLObjectProperty p = df.getOWLObjectProperty(IRI.create(ns, "p"));
        OWLDataProperty q = df.getOWLDataProperty(IRI.create(ns, "q"));
        OWLOntology ontology = m.createOntology(ont);
        OWLIndividual ind = df.getOWLAnonymousIndividual();
        OWLObjectPropertyAssertionAxiom ax1 = df
                .getOWLObjectPropertyAssertionAxiom(p, i, ind);
        OWLDataPropertyAssertionAxiom ax2 = df
                .getOWLDataPropertyAssertionAxiom(q, ind, df.getOWLLiteral(5));
        m.addAxiom(ontology, ax1);
View Full Code Here

    @Nonnull
    @Override
    protected Set<? extends OWLAxiom> createAxioms() {
        Set<OWLAxiom> axioms = new HashSet<>();
        OWLObjectProperty prop = ObjectProperty(iri("prop"));
        OWLIndividual subject = NamedIndividual(iri("iA"));
        OWLIndividual object = NamedIndividual(iri("iB"));
        axioms.add(NegativeObjectPropertyAssertion(prop, subject, object));
        return axioms;
    }
View Full Code Here

    @Nonnull
    @Override
    protected Set<OWLAxiom> getAxioms() {
        Set<OWLAxiom> axioms = new HashSet<>();
        OWLClassExpression desc = df.getOWLObjectComplementOf(createClass());
        OWLIndividual ind = createIndividual();
        axioms.add(df.getOWLClassAssertionAxiom(desc, ind));
        return axioms;
    }
View Full Code Here

    public void shouldRoundTrip() throws Exception {
        OWLClass c = Class(IRI(NS + "#C"));
        OWLClass d = Class(IRI(NS + "#D"));
        OWLObjectProperty p = ObjectProperty(IRI(NS + "#p"));
        OWLDataProperty q = DataProperty(IRI(NS + "#q"));
        OWLIndividual i = AnonymousIndividual();
        OWLOntology ontology = m.createOntology(IRI(NS));
        List<AddAxiom> changes = new ArrayList<>();
        changes.add(new AddAxiom(ontology, SubClassOf(c, ObjectHasValue(p, i))));
        changes.add(new AddAxiom(ontology, ClassAssertion(d, i)));
        changes.add(new AddAxiom(ontology, DataPropertyAssertion(q, i,
View Full Code Here

        OWLAxiom annAss = df.getOWLAnnotationAssertionAxiom(df.getRDFSLabel(),
                i, lit);
        m.addAxiom(ontology, annAss);
        OWLAxiom classAss = df.getOWLClassAssertionAxiom(cheesy, i);
        m.addAxiom(ontology, classAss);
        OWLIndividual j = df.getOWLAnonymousIndividual();
        OWLAxiom classAssj = df.getOWLClassAssertionAxiom(cheese, j);
        m.addAxiom(ontology, classAssj);
        OWLAxiom objAss = df.getOWLObjectPropertyAssertionAxiom(hasTopping, i,
                j);
        m.addAxiom(ontology, objAss);
View Full Code Here

    @Test
    public void testCorrectAxioms() {
        Set<OWLAxiom> axioms = new HashSet<>();
        OWLClass clsA = Class(iri("A"));
        OWLIndividual ind = NamedIndividual(iri("a"));
        OWLObjectProperty propP = ObjectProperty(iri("p"));
        axioms.add(SubClassOf(clsA, ObjectHasValue(propP, ind)));
        axioms.add(Declaration(propP));
        assertEquals(getOnt().getAxioms(), axioms);
    }
View Full Code Here

    @Override
    public Set<OWLSameIndividualAxiom> asPairwiseAxioms() {
        List<OWLIndividual> inds = getIndividualsAsList();
        Set<OWLSameIndividualAxiom> result = new HashSet<>();
        for (int i = 0; i < inds.size() - 1; i++) {
            OWLIndividual indI = inds.get(i);
            OWLIndividual indJ = inds.get(i + 1);
            result.add(new OWLSameIndividualAxiomImpl(new HashSet<>(Arrays
                    .asList(indI, indJ)), NO_ANNOTATIONS));
        }
        return result;
    }
View Full Code Here

        if (individuals.size() == 2) {
            return Collections.<OWLSameIndividualAxiom> singleton(this);
        }
        Set<OWLSameIndividualAxiom> result = new HashSet<>();
        for (int i = 0; i < individuals.size() - 1; i++) {
            OWLIndividual indI = individuals.get(i);
            OWLIndividual indJ = individuals.get(i + 1);
            result.add(new OWLSameIndividualAxiomImpl(new HashSet<>(Arrays
                    .asList(indI, indJ)), getAnnotations()));
        }
        return result;
    }
View Full Code Here

        throw new Error("Missing return statement in function");
    }

    final public OWLIndividualAxiom ObjectPropertyAssertion()
            throws ParseException {
        OWLIndividual subj;
        OWLObjectPropertyExpression prop;
        OWLIndividual obj;
        Set<OWLAnnotation> axiomAnnos;
        jj_consume_token(OBJECTPROPERTYASSERTION);
        jj_consume_token(OPENPAR);
        axiomAnnos = AxiomAnnotationSet();
        prop = ObjectPropertyExpression();
View Full Code Here

TOP

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

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.