Package org.semanticweb.owl.model

Examples of org.semanticweb.owl.model.OWLOntology


    axioms.add( equivalentClasses( c, oneOf( i1, i2 ) ) );

    axioms.add( classAssertion( i3, c ) );

    OWLOntology ont = getOntologyFromAxioms( axioms, ontURI );

    Reasoner reasoner = new Reasoner( OWL.manager );
    reasoner.loadOntology( ont );

    assertTrue( !reasoner.isSameAs( i1, i2 ) );
View Full Code Here


    ProgressMonitor monitor = new TimedProgressMonitor( 1 );

    Reasoner pellet = new Reasoner( OWL.manager );
    KnowledgeBase kb = pellet.getKB();

    OWLOntology ont = loadOntology( base + "food.owl" );
    pellet.loadOntology( ont );

    kb.classify();

    kb.getTaxonomyBuilder().setProgressMonitor( monitor );
View Full Code Here

    KnowledgeBase kb = pellet.getKB();

    Timer timer = kb.timers.createTimer( "classify" );
    timer.setTimeout( 1 );

    OWLOntology ont = loadOntology( base + "food.owl" );
    pellet.loadOntology( ont );

    try {
      kb.classify();
    } catch( TimeoutException e ) {
View Full Code Here

    KnowledgeBase kb = pellet.getKB();

    Timer timer = kb.timers.createTimer( "realize" );
    timer.setTimeout( 1 );

    OWLOntology ont = loadOntology( base + "food.owl" );
    pellet.loadOntology( ont );

    try {
      kb.classify();
    } catch( TimeoutException e ) {
View Full Code Here

        + "@prefix owl: <http://www.w3.org/2002/07/owl#> .\r\n" + "\r\n"
        + "ex:C rdfs:subClassOf ex:D .\r\n" + "[] a ex:C .";

    Reasoner pellet = new Reasoner( OWL.manager );

    OWLOntology ont = OWL.manager.loadOntology( new StringInputSource( src ) );
    pellet.loadOntology( ont );

    OWLClass D = OWL.Class( ns + "D" );

    assertTrue( pellet.getIndividuals( D, true ).size() == 0 );
View Full Code Here

        OWL.propertyAssertion( a, OWL.topObjectProperty, b ),
        OWL.propertyAssertion( a, OWL.topDataProperty, lit ),
        OWL.propertyAssertion( a, OWL.bottomObjectProperty, b ),
        OWL.propertyAssertion( a, OWL.bottomDataProperty, lit ) };
    for( int i = 0; i < axioms.length; i++ ) {
      OWLOntology ont = OntologyUtils.getOntologyFromAxioms( axioms[i] );
      pellet.setOntology( ont );
      assertEquals( i < 2, pellet.isConsistent() );
    }
  }
View Full Code Here

        OWL.classAssertion( c, C ),
        OWL.propertyAssertion( a, dp, lit )
    };
   
    Reasoner pellet = new Reasoner( OWL.manager );
    OWLOntology ont = OntologyUtils.getOntologyFromAxioms( axioms );
    pellet.setOntology( ont );

   
    assertTrue( pellet.isSubPropertyOf( p, OWL.topObjectProperty ) );
    assertTrue( pellet.isSubPropertyOf( OWL.bottomObjectProperty, p ) );
View Full Code Here

    return getOntologyFromAxioms( axioms, uri );
  }

  public static OWLOntology getOntologyFromAxioms(Collection<OWLAxiom> axioms, URI uri) {
    OWLOntology module;
    try {
      module = manager.createOntology( uri );
      List<OWLOntologyChange> changes = new ArrayList<OWLOntologyChange>();
      for( OWLAxiom axiom : axioms ) {
        changes.add( new AddAxiom( module, axiom ) );
View Full Code Here

   *            if <code>false</code> removes all annotation axioms from the
   *            ontology, otherwise leaves the ontology intact
   * @return the ontology
   */
  public static OWLOntology loadOntology( String uri, boolean withAnnotations ) {
    OWLOntology ont = loadOntology( uri );
   
    if( !withAnnotations )
      removeAllAnnotations( ont, manager );
   
    return ont;
View Full Code Here

      return ((Resource) v).getURI();
  }

  private static OWLOntology convert(RDFModel model, OWLOntologyManager manager)
      throws OWLOntologyCreationException, SAXException {
    OWLOntology ontology = manager.createOntology( TMP_URI );

    OWLRDFConsumer consumer = new OWLRDFConsumer( manager, ontology,
        new AnonymousNodeChecker() {
          public boolean isAnonymousNode(URI uri) {
            return isAnonymousNode( uri.toString() );
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.