Package com.hp.hpl.jena.ontology

Examples of com.hp.hpl.jena.ontology.OntModel.validate()


    Literal val1 = model.createLiteral( "val1" );
    x.addProperty( prop, val1 );
    Literal val2 = model.createLiteral( "val2" );
    x.addProperty( sub, val2 );

    assertTrue( model.validate().isValid() );

    assertPropertyValues( model, x, prop, val1, val2 );
  }

  @Test
View Full Code Here


    OntModel model = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC );
    model.read( base + "float_test.owl" );

    model.prepare();

    assertTrue( model.validate().isValid() );

    OntClass ThingWithFloatValue = model.getOntClass( ns + "ThingWithFloatValue" );
    OntClass ThingWithFloatProbability = model.getOntClass( ns + "ThingWithProbabilityValue" );

    Individual exampleThingWithFloatValue = model.getIndividual( ns
View Full Code Here

    OntModel model = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC );
    model.read( base + "decimal_test.owl" );

    model.prepare();

    assertTrue( model.validate().isValid() );

    OntClass ThingWithDecimalValue = model.getOntClass( ns + "ThingWithDecimalValue" );
    OntClass ThingWithDecimalProbability = model.getOntClass( ns
        + "ThingWithDecimalProbability" );
    OntClass ThingWithIntegerValue = model.getOntClass( ns + "ThingWithIntegerValue" );
View Full Code Here

      }
    }

    model.prepare();

    assertTrue( model.validate().isValid() );
  }

  @Test
  public void testBuiltinDatatypesWithInvalidValues() {
    String ns = "urn:test:";
View Full Code Here

          Literal value = model.createTypedLiteral( (String) datatypes[i], datatype
              .getURI() );
          ind.addProperty( p, value );

          assertFalse( value.getLexicalForm() + " should not belong to "
              + datatype.getLocalName(), model.validate().isValid() );
          i++;
        }
      }
    }
  }
View Full Code Here

    model.prepare();
    long e = System.currentTimeMillis();
   
    //print time and validation report
    System.out.println( "Total time " + (e - s) + " ms)" );
    JenaReasoner.printIterator( model.validate().getReports(), "Validation Results" );

    // perform ABox addition which results in a consistent KB
    Resource concept = model.getResource( mindswap + "GraduateStudent" );
    Individual individual = model.createIndividual( mindswappers + "JohnDoe", concept );
View Full Code Here

    model.prepare();
    e = System.currentTimeMillis();

    //print time and validation report
    System.out.println( "Total time " + (e - s) + " ms)" );
    JenaReasoner.printIterator( model.validate().getReports(), "Validation Results" );

    // perform ABox addition which results in an inconsistent KB
    Property role = model.getProperty( foaf + "mbox" );
    individual = model.getIndividual( mindswappers + "Christian.Halaschek" );
    RDFNode mbox = model.getIndividual( "mailto:kolovski@cs.umd.edu" );
View Full Code Here

    model.prepare();
    e = System.currentTimeMillis();

    //print time and validation report
    System.out.println( "Total time " + (e - s) + " ms)" );
    JenaReasoner.printIterator( model.validate().getReports(), "Validation Results" );
  }

 
}
View Full Code Here

  public void testTicket96() {
    OntModel pellet = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC );

    pellet.read( base + "ticket-96-test-case.rdf" );

    assertTrue( pellet.validate().isValid() );
  }

  @Test
  public void testNaryDisjointness() {
    // tests whether owl:Alldifferent, owl:AllDisjointClasses,
View Full Code Here

    DatatypeProperty email = model.createDatatypeProperty( ns + "email", false );

    john.addProperty( email, "john.doe@unknown.org" );
    john.addProperty( email, "jdoe@unknown.org" );

    assertTrue( model.validate().isValid() );

    assertIteratorValues( model.listSubjectsWithProperty( email, "john.doe@unknown.org" ),
        new Resource[] { john } );

    assertTrue( model.contains( null, email, "john.doe@unknown.org" ) );
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.