Examples of OWLClass


Examples of org.semanticweb.owlapi.model.OWLClass

        for (OWLSubClassOfAxiom sca : scas) {
            OWLClassExpression sup = sca.getSuperClass();
            if (sup instanceof OWLObjectSomeValuesFrom) {
                OWLObjectProperty p = (OWLObjectProperty) ((OWLObjectSomeValuesFrom) sup)
                        .getProperty();
                OWLClass v = (OWLClass) ((OWLObjectSomeValuesFrom) sup)
                        .getFiller();
                if (p.getIRI().toString()
                        .equals("http://purl.obolibrary.org/obo/BFO_0000051")
                        && v.getIRI()
                                .toString()
                                .equals("http://purl.obolibrary.org/obo/GO_0004055")) {
                    ok = true;
                }
            }
        }
        assertTrue(ok);
        scas = ontology.getAxioms(AxiomType.SUBCLASS_OF);
        ok = false;
        for (OWLSubClassOfAxiom sca : scas) {
            OWLClassExpression sup = sca.getSuperClass();
            if (sup instanceof OWLObjectSomeValuesFrom) {
                OWLObjectProperty p = (OWLObjectProperty) ((OWLObjectSomeValuesFrom) sup)
                        .getProperty();
                OWLClass v = (OWLClass) ((OWLObjectSomeValuesFrom) sup)
                        .getFiller();
                if (p.getIRI().toString()
                        .equals("http://purl.obolibrary.org/obo/BFO_0000050")
                        && v.getIRI()
                                .toString()
                                .equals("http://purl.obolibrary.org/obo/XX_0000001")) {
                    ok = true;
                }
            }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLClass

        return ruleBuiltIns.containsKey(name);
    }

    @Nonnull
    private OWLClass getOWLClass(@Nonnull String name) {
        OWLClass cls = owlEntityChecker.getOWLClass(name);
        if (cls == null && classNames.contains(name)) {
            cls = dataFactory.getOWLClass(getIRI(name));
        }
        if (cls == null) {
            throw new ExceptionBuilder().withKeyword(potentialKeywords)
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLClass

        Set<OntologyAxiomPair> axioms = new HashSet<>();
        if (!CLASS.matches(tok)) {
            throw new ExceptionBuilder().withKeyword(CLASS).build();
        }
        String subj = consumeToken();
        OWLClass cls = getOWLClass(subj);
        axioms.add(new OntologyAxiomPair(defaultOntology, dataFactory
                .getOWLDeclarationAxiom(cls)));
        parseFrameSections(eof, axioms, cls, classFrameSections);
        return axioms;
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLClass

        OWLObjectPropertyExpression prop = parseObjectPropertyExpression(false);
        String clsName = consumeToken();
        if (eof(clsName)) {
            throw new ExceptionBuilder().withObject().build();
        }
        OWLClass cls = getOWLClass(clsName);
        Set<OntologyAxiomPair> axioms = new HashSet<>();
        axioms.addAll(parseValuePartitionValues(onts, cls));
        for (OWLOntology ont : onts) {
            assert ont != null;
            axioms.add(new OntologyAxiomPair(ont, dataFactory
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLClass

        Set<OWLClass> siblings = new HashSet<>();
        consumeToken(OPENBRACKET.keyword());
        String sep = COMMA.keyword();
        while (COMMA.matches(sep)) {
            String clsName = consumeToken();
            OWLClass cls = getOWLClass(clsName);
            siblings.add(cls);
            OWLSubClassOfAxiom ax = dataFactory.getOWLSubClassOfAxiom(cls,
                    superclass);
            for (OWLOntology ont : onts) {
                assert ont != null;
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLClass

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

    final public OWLClass Class() throws ParseException {
        OWLClass cls;
        jj_consume_token(CLASS);
        jj_consume_token(OPENPAR);
        cls = ClassIRI();
        jj_consume_token(CLOSEPAR);
        {
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLClass

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

    final public OWLClassAxiom DisjointUnion() throws ParseException {
        OWLClass cls;
        Set<OWLClassExpression> classExpressions;
        Set<OWLAnnotation> axiomAnnos;
        jj_consume_token(DISJOINTUNION);
        jj_consume_token(OPENPAR);
        axiomAnnos = AxiomAnnotationSet();
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLClass

    }

    @Test
    public void shouldBuildClass() {
        // given
        OWLClass expected = df.getOWLClass(iri);
        BuilderClass builder = new BuilderClass(expected, df);
        // when
        OWLObject built = builder.buildObject();
        // then
        assertEquals(expected, built);
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLClass

    }

    @Test
    public void shouldBuildEntity() {
        // given
        OWLClass expected = df.getOWLClass(iri);
        BuilderEntity builder = new BuilderEntity(expected, df);
        // when
        OWLObject built = builder.buildObject();
        // then
        assertEquals(expected, built);
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLClass

        AbstractFileRoundTrippingTestCase {

    @Test
    public void testCorrectAxioms() {
        Set<OWLAxiom> axioms = new HashSet<>();
        OWLClass clsA = Class(iri("A"));
        OWLClass clsB = Class(iri("B"));
        OWLObjectProperty prop = ObjectProperty(iri("p"));
        axioms.add(Declaration(prop));
        axioms.add(SubClassOf(clsA, ObjectExactCardinality(3, prop, clsB)));
        assertEquals(getOnt().getAxioms(), axioms);
    }
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.