Examples of OWLObjectProperty


Examples of org.semanticweb.owlapi.model.OWLObjectProperty

        }

        @Nullable
        @Override
        public OWLObjectProperty getOWLObjectProperty(@Nonnull String name) {
            OWLObjectProperty owlObjectProperty = defaultInstance
                    .getOWLObjectProperty(name);
            if (owlObjectProperty == null) {
                IRI iri = getIRI(name);
                if (iri != null) {
                    owlObjectProperty = getOWLObjectProperty(iri);
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLObjectProperty

         * @return {@link OWLObjectProperty} or null
         */
        @Nullable
        OWLObjectProperty getOWLObjectProperty(@Nonnull IRI iri) {
            for (OWLOntology o : ontologies) {
                OWLObjectProperty p = o.getOWLOntologyManager()
                        .getOWLDataFactory().getOWLObjectProperty(iri);
                if (!o.getDeclarationAxioms(p).isEmpty()) {
                    return p;
                }
            }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLObjectProperty

        return cls;
    }

    @Nonnull
    private OWLObjectProperty getOWLObjectProperty(@Nonnull String name) {
        OWLObjectProperty prop = owlEntityChecker.getOWLObjectProperty(name);
        if (prop == null && objectPropertyNames.contains(name)) {
            prop = dataFactory.getOWLObjectProperty(getIRI(name));
        }
        if (prop == null) {
            throw new ExceptionBuilder().withObject().build();
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLObjectProperty

    @Nonnull
    private Set<OntologyAxiomPair> parseObjectPropertyFrame(boolean eof) {
        Set<OntologyAxiomPair> axioms = new HashSet<>();
        consumeToken(OBJECT_PROPERTY);
        String token = consumeToken();
        OWLObjectProperty prop = getOWLObjectProperty(token);
        if (!prop.isAnonymous()) {
            axioms.add(new OntologyAxiomPair(defaultOntology, dataFactory
                    .getOWLDeclarationAxiom(prop.asOWLObjectProperty())));
        }
        parseFrameSections(eof, axioms, prop, objectPropertyFrameSections);
        return axioms;
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLObjectProperty

    @Nonnull
    protected OWLOntology getOntologyWithPunnedInvalidDeclarations()
            throws OWLOntologyCreationException {
        OWLOntology o = m.createOntology(IRI
                .create("urn:forbiddenPunningNotRedeclared"));
        OWLObjectProperty op = df.getOWLObjectProperty(iri("testProperty"));
        OWLAnnotationProperty ap = df
                .getOWLAnnotationProperty(iri("testProperty"));
        m.addAxiom(o, df.getOWLDeclarationAxiom(op));
        m.addAxiom(o, df.getOWLTransitiveObjectPropertyAxiom(op));
        OWLAnnotationAssertionAxiom assertion = df
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLObjectProperty

    @Nonnull
    protected OWLOntology getOntologyWithMissingDeclarations()
            throws OWLOntologyCreationException {
        OWLOntology o = m.createOntology(IRI.create("urn:missingDeclarations"));
        OWLObjectProperty op = df
                .getOWLObjectProperty(iri("testObjectProperty"));
        OWLAnnotationProperty ap = df
                .getOWLAnnotationProperty(iri("testAnnotationProperty"));
        m.addAxiom(o, df.getOWLTransitiveObjectPropertyAxiom(op));
        OWLAnnotationAssertionAxiom assertion = df
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLObjectProperty

    @Test
    public void shouldDeclareMissingEntities()
            throws OWLOntologyCreationException, OWLOntologyStorageException {
        OWLOntology o = getOntologyWithMissingDeclarations();
        OWLOntology reloaded = roundTrip(o, format);
        OWLObjectProperty op = df
                .getOWLObjectProperty(iri("testObjectProperty"));
        OWLAnnotationProperty ap = df
                .getOWLAnnotationProperty(iri("testAnnotationProperty"));
        assertTrue(reloaded.containsAxiom(df.getOWLDeclarationAxiom(ap)));
        assertTrue(reloaded.containsAxiom(df.getOWLDeclarationAxiom(op)));
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLObjectProperty

        boolean ok = false;
        // test that transitive over is translated to a property chain
        Set<OWLSubPropertyChainOfAxiom> axioms = ontology
                .getAxioms(AxiomType.SUB_PROPERTY_CHAIN_OF);
        for (OWLSubPropertyChainOfAxiom axiom : axioms) {
            OWLObjectProperty p = (OWLObjectProperty) axiom.getSuperProperty();
            if (regulatesIRI.equals(p.getIRI())) {
                List<OWLObjectPropertyExpression> chain = axiom
                        .getPropertyChain();
                assertEquals(2, chain.size());
                assertEquals(p, chain.get(0));
                assertEquals("http://purl.obolibrary.org/obo/BFO_0000050",
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLObjectProperty

                .getAxioms(AxiomType.SUBCLASS_OF);
        boolean 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_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.OWLObjectProperty

    @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.