Examples of OWLDeclarationAxiom


Examples of org.semanticweb.owl.model.OWLDeclarationAxiom

            OWLAxiom a = j.next();
            referenced = a.isLogicalAxiom() || (a instanceof OWLDeclarationAxiom);
          }
        }
        if( !referenced ) {
          OWLDeclarationAxiom declaration = getOntologyManager().getOWLDataFactory().getOWLDeclarationAxiom( e );
          temporaryDeclarations.add( declaration );
        }
      }
      for( OWLDeclarationAxiom decl : temporaryDeclarations ) {
        OntologyUtils.addAxiom( decl, getReasoner().getLoadedOntologies(),
View Full Code Here

Examples of org.semanticweb.owl.model.OWLDeclarationAxiom

      manager.applyChanges( changes );

      changes = new ArrayList<OWLOntologyChange>();
      for( OWLEntity entity : referencedEntities ) {
        if( !ontology.containsEntityReference( entity ) ) {
          OWLDeclarationAxiom declaration = manager.getOWLDataFactory()
              .getOWLDeclarationAxiom( entity );
          changes.add( new AddAxiom( ontology, declaration ) );
        }
      }
     
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLDeclarationAxiom

            throws OWLOntologyCreationException, OWLOntologyStorageException {
        OWLOntology o = getOntologyWithPunnedInvalidDeclarations();
        OWLOntology reloaded = roundTrip(o, format);
        OWLAnnotationProperty ap = df
                .getOWLAnnotationProperty(iri("testProperty"));
        OWLDeclarationAxiom ax = df.getOWLDeclarationAxiom(ap);
        assertFalse("ap testProperty should not have been declared",
                reloaded.containsAxiom(ax));
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLDeclarationAxiom

    }

    @Test
    public void shouldBuildDeclaration() {
        // given
        OWLDeclarationAxiom expected = df.getOWLDeclarationAxiom(ce,
                annotations);
        BuilderDeclaration builder = new BuilderDeclaration(expected, df);
        // when
        OWLObject built = builder.buildObject();
        // then
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLDeclarationAxiom

        OWLOntology ontology = manager
                .createOntology(IRI
                        .create("http://www.semanticweb.org/owlapi/ontologies/ontology"));
        // We can add a declaration axiom to the ontology, that essentially adds
        // the class to the signature of our ontology.
        OWLDeclarationAxiom declarationAxiom = factory
                .getOWLDeclarationAxiom(clsAMethodA);
        manager.addAxiom(ontology, declarationAxiom);
        // Note that it isn't necessary to add declarations to an ontology in
        // order to use an entity. For some ontology formats (e.g. the
        // Manchester Syntax), declarations will automatically be added in the
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLDeclarationAxiom

                    OWLAnnotation anno = getDataFactory().getOWLAnnotation(
                            property, con);
                    OWLAnnotationAssertionAxiom ax = getDataFactory()
                            .getOWLAnnotationAssertionAxiom(subject, anno);
                    owlOntologyManager.addAxiom(ontology, ax);
                    OWLDeclarationAxiom annotationPropertyDeclaration = getDataFactory()
                            .getOWLDeclarationAxiom(property);
                    owlOntologyManager.addAxiom(ontology,
                            annotationPropertyDeclaration);
                }
            }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLDeclarationAxiom

     *        true if the axiom belongs to the parsed ones, false for the input
     * @return true if the axiom can be ignored
     */
    public boolean isIgnorableAxiom(OWLAxiom ax, boolean parse) {
        if (ax instanceof OWLDeclarationAxiom) {
            OWLDeclarationAxiom d = (OWLDeclarationAxiom) ax;
            if (parse) {
                // all extra declarations in the parsed ontology are fine
                return true;
            }
            // declarations of builtin and named individuals can be ignored
            return d.getEntity().isBuiltIn()
                    || d.getEntity().isOWLNamedIndividual();
        }
        return false;
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLDeclarationAxiom

    @Test
    public void testCorrectAxioms() throws OWLOntologyCreationException {
        OWLOntology ont = createOntology();
        IRI clsIRI = IRI("http://owlapi.sourceforge.net/ontology#ClsA");
        OWLClass cls = Class(clsIRI);
        OWLDeclarationAxiom ax = Declaration(cls);
        assertTrue(ont.containsAxiom(ax));
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLDeclarationAxiom

            // and the value may be not be explicitly declared. If it is not,
            // we assume it is a class
            IRI axValIRI = (IRI) ax.getValue();
            OWLClass axValClass = visitor.dataFactory.getOWLClass(axValIRI);
            if (inputOntology.getDeclarationAxioms(axValClass).isEmpty()) {
                OWLDeclarationAxiom newAx = visitor.dataFactory
                        .getOWLDeclarationAxiom(axValClass);
                manager.addAxiom(inputOntology, newAx);
                // we need to sync the MST entity checker with the new ontology
                // plus declarations;
                // we do this by creating a new MST - this is not particularly
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLDeclarationAxiom

        int totalAxioms = axioms.size();
        int workDone = 0;

        for (OWLAxiom axiom : axioms) {
            if (axiom instanceof OWLDeclarationAxiom) {
                OWLDeclarationAxiom a = (OWLDeclarationAxiom)axiom;
                OWLEntity ent = a.getEntity();
                if (ent.isOWLClass()) {
                    res.add(new ConceptInclusion(
                            new NamedConcept(ent.asOWLClass().toStringID()), NamedConcept.TOP_CONCEPT));
                } else if (ent.isOWLObjectProperty()) {
                    // Do nothing for now.
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.