Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLAnonymousIndividual


    }

    @Test
    public void shouldBuildAnonymousIndividual() {
        // given
        OWLAnonymousIndividual expected = df.getOWLAnonymousIndividual("id");
        BuilderAnonymousIndividual builder = new BuilderAnonymousIndividual(
                expected, df);
        // when
        OWLObject built = builder.buildObject();
        // then
View Full Code Here


            OWLDataFactory df) {
        if (!reasoner
                .isEntailmentCheckingSupported(AxiomType.OBJECT_PROPERTY_ASSERTION)) {
            return true;
        }
        OWLAnonymousIndividual a = df.getOWLAnonymousIndividual();
        OWLAnonymousIndividual b = df.getOWLAnonymousIndividual();
        OWLAnonymousIndividual c = df.getOWLAnonymousIndividual();
        Set<OWLAxiom> trivialityCheckAxioms = new HashSet<>(
                Arrays.<OWLAxiom> asList(
                        df.getOWLObjectPropertyAssertionAxiom(property, a, b),
                        df.getOWLObjectPropertyAssertionAxiom(property, b, c)));
        return !reasoner.isEntailed(trivialityCheckAxioms);
View Full Code Here

        Set<OWLSubClassOfAxiom> axioms = o.getAxioms(AxiomType.SUBCLASS_OF);
        assertEquals(1, axioms.size());
        OWLAnnotation next = axioms.iterator().next().getAnnotations()
                .iterator().next();
        assertTrue(next.getValue() instanceof OWLAnonymousIndividual);
        OWLAnonymousIndividual ind = (OWLAnonymousIndividual) next.getValue();
        Set<OWLAxiom> anns = new HashSet<>();
        for (OWLAxiom ax : o.getAxioms()) {
            if (ax.getAnonymousIndividuals().contains(ind)) {
                anns.add(ax);
            }
View Full Code Here

        Set<OWLAxiom> axioms = new HashSet<>();
        IRI annoPropIRI = IRI("http://owlapi.sourceforge.net/ontology#annoProp");
        OWLAnnotationProperty property = AnnotationProperty(annoPropIRI);
        IRI subject = IRI("http://owlapi.sourceforge.net/ontology#subject");
        axioms.add(Declaration(NamedIndividual(subject)));
        OWLAnonymousIndividual individual1 = AnonymousIndividual();
        OWLAnonymousIndividual individual2 = AnonymousIndividual();
        OWLAnonymousIndividual individual3 = AnonymousIndividual();
        OWLAnnotationAssertionAxiom annoAssertion1 = AnnotationAssertion(
                property, subject, individual1);
        OWLAnnotationAssertionAxiom annoAssertion2 = AnnotationAssertion(
                property, individual1, individual2);
        OWLAnnotationAssertionAxiom annoAssertion3 = AnnotationAssertion(
View Full Code Here

        // Originally submitted by Timothy Redmond
        String ns = "http://another.com/ont";
        OWLClass a = Class(IRI(ns + "#A"));
        OWLAnnotationProperty p = AnnotationProperty(IRI(ns + "#p"));
        OWLObjectProperty q = ObjectProperty(IRI(ns + "#q"));
        OWLAnonymousIndividual h = AnonymousIndividual();
        OWLAnonymousIndividual i = AnonymousIndividual();
        Set<OWLAxiom> axioms = new HashSet<>();
        axioms.add(AnnotationAssertion(p, a.getIRI(), h));
        axioms.add(ClassAssertion(a, h));
        axioms.add(ObjectPropertyAssertion(q, h, i));
        axioms.add(AnnotationAssertion(RDFSLabel(), h, Literal("Second", "en")));
View Full Code Here

    @Test
    public void testRoundTrip() throws Exception {
        String ns = "http://smi-protege.stanford.edu/ontologies/AnonymousIndividuals.owl";
        OWLClass a = Class(IRI(ns + "#A"));
        OWLAnonymousIndividual h = AnonymousIndividual();
        OWLAnonymousIndividual i = AnonymousIndividual();
        OWLAnnotationProperty p = AnnotationProperty(IRI(ns + "#p"));
        OWLObjectProperty q = ObjectProperty(IRI(ns + "#q"));
        OWLOntology ontology = m.createOntology(IRI(ns));
        OWLAnnotation annotation1 = df.getOWLAnnotation(p, h);
        m.addAxiom(ontology,
View Full Code Here

        return normalised;
    }

    @Override
    public void visit(OWLAnonymousIndividual individual) {
        OWLAnonymousIndividual ind = renamingMap.get(individual);
        if (ind == null) {
            counter++;
            ind = AnonymousIndividual("anon-ind-" + counter);
            renamingMap.put(individual, ind);
        }
View Full Code Here

    @Nonnull
    @Override
    protected Set<? extends OWLAxiom> createAxioms() {
        Set<OWLAxiom> axioms = new HashSet<>();
        OWLAnonymousIndividual ind = AnonymousIndividual();
        OWLClass cls = Class(iri("A"));
        OWLAnnotationProperty prop = AnnotationProperty(iri("prop"));
        OWLAnnotationAssertionAxiom ax = AnnotationAssertion(prop,
                cls.getIRI(), ind);
        axioms.add(ax);
View Full Code Here

    @Test
    public void testAnonAccessor() {
        OWLOntology ont = getOWLOntology("ontology");
        OWLAnnotationProperty prop = AnnotationProperty(iri("prop"));
        OWLAnnotationValue value = Literal("value");
        OWLAnonymousIndividual a = AnonymousIndividual();
        OWLAnnotationAssertionAxiom ax = AnnotationAssertion(prop, a, value);
        ont.getOWLOntologyManager().addAxiom(ont, ax);
        assertTrue(ont.getAnnotationAssertionAxioms(a).contains(ax));
    }
View Full Code Here

        OWLOntology ontology = m.createOntology(IRI(NS));
        OWLClass cheesy = Class(IRI(NS + "#CheeseyPizza"));
        OWLClass cheese = Class(IRI(NS + "#CheeseTopping"));
        OWLObjectProperty hasTopping = df.getOWLObjectProperty(IRI(NS
                + "#hasTopping"));
        OWLAnonymousIndividual i = df.getOWLAnonymousIndividual();
        OWLLiteral lit = df.getOWLLiteral(ANONYMOUS_INDIVIDUAL_ANNOTATION);
        OWLAxiom annAss = df.getOWLAnnotationAssertionAxiom(df.getRDFSLabel(),
                i, lit);
        m.addAxiom(ontology, annAss);
        OWLAxiom classAss = df.getOWLClassAssertionAxiom(cheesy, i);
View Full Code Here

TOP

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

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.