Package org.semanticweb.owl.model

Examples of org.semanticweb.owl.model.OWLOntology


    return ontology;
  }

  public void writePretty(OutputStream out, RDFModel model) throws IOException {
    OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
    OWLOntology ontology = null;
    try {
      ontology = convert( model, manager );
    } catch( OWLOntologyCreationException e ) {
      throw new RuntimeException( e );
    } catch( SAXException e ) {
View Full Code Here


    try {
      URI uri = URI.create( ns + "ont" );

      manager.removeOntology( uri );

      OWLOntology ont = manager.createOntology( uri );

      manager.applyChange( new AddAxiom( ont, axiom ) );

      Reasoner reasoner = new Reasoner( manager );
      reasoner.getKB().setDoExplanation( true );
View Full Code Here

    return reasoner.isConsistent();
  }

  public void testEntailment(String entailmentFileURI, boolean positiveEntailment) {
    try {
      OWLOntology ont = manager.loadOntology( getInputSource( entailmentFileURI ) );
      for( OWLAxiom axiom : ont.getLogicalAxioms() ) {
        if( !reasoner.isEntailed( axiom ) ) {
          assertFalse( "Entailment failed for " + axiom, positiveEntailment );
          return;
        }
      }
View Full Code Here

  }

  public void setInputOntology(String inputFileURI) {
    try {
      manager.addURIMapper( mapper );
      OWLOntology ont = manager.loadOntology( getInputSource( inputFileURI ) );
      reasoner = new Reasoner( manager );
      reasoner.setOntology( ont );
    } catch( OWLException e ) {
      throw new RuntimeException( e );
    }
View Full Code Here

  private void testOWLAPI(String premiseURI, String conclusionURI) {
    OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
    Reasoner reasoner = new Reasoner(manager);
   
    try {
      OWLOntology premise = manager.loadOntology(URI.create(premiseURI));
      OWLOntology conclusion = manager.loadOntology(URI
          .create(conclusionURI));

      reasoner.loadOntology(premise);
     
      assertTrue(reasoner.isEntailed(conclusion));
View Full Code Here

  @Test
  public void testIsClass5() throws OWLException {
    OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
    OWLDataFactory factory = manager.getOWLDataFactory();
    OWLOntology ontology = manager.createOntology(URI
        .create("http://example.org"));
   
    OWLDataRange dataRange = factory.getOWLDataType(XSDVocabulary.INTEGER
        .getURI());
    OWLDataRangeFacetRestriction dataRangeFacetRestriction = factory
View Full Code Here

TOP

Related Classes of org.semanticweb.owl.model.OWLOntology

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.