Package com.hp.hpl.jena.ontology

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


    // add one instance relation
    OntClass cls = model.createClass( ns + "C" );
    Individual a = model.createIndividual( ns + "a", cls );

    // load everything and check consistency
    assertTrue( model.validate().isValid() );

    // add a type relation for an existing individual
    a.addRDFType( cls );

    // verify instance relation
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

    DatatypeProperty name1 = model.createDatatypeProperty( ns + "name1", true );

    john.addProperty( name1, "Name", "en" );
    john.addProperty( name1, "Nom", "fr" );

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

    DatatypeProperty name2 = model.createDatatypeProperty( ns + "name2", true );

    john.addProperty( name2, "Name" );
    john.addProperty( name2, "Nom" );
View Full Code Here

    DatatypeProperty name2 = model.createDatatypeProperty( ns + "name2", true );

    john.addProperty( name2, "Name" );
    john.addProperty( name2, "Nom" );

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

  @Test
  public void testDatatypeHierarchy() {
    OntModel model = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC );
View Full Code Here

    Individual x = model.createIndividual( ns + "x", C );
    x.addProperty( prop, "literal1" );
    x.addProperty( prop, "literal2" );
    x.addProperty( prop, "literal3" );

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

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

    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

  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

    model.prepare();

    model.add( a, r, model.createLiteral( "l" ) );
    model.add( a, r, model.createResource() );

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

    model.prepare();

    model.add( p, RDF.type, OWL.FunctionalProperty );
    model.add( b, OWL.differentFrom, c );
View Full Code Here

    model.add( p, RDF.type, OWL.FunctionalProperty );
    model.add( b, OWL.differentFrom, c );

    model.prepare();

    assertFalse( model.validate().isValid() );

    model.remove( b, OWL.differentFrom, c );

    assertTrue( model.validate().isValid() );
View Full Code Here

    assertFalse( model.validate().isValid() );

    model.remove( b, OWL.differentFrom, c );

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

    model.prepare();

    model.add( p, RDF.type, OWL.InverseFunctionalProperty );
    model.add( a, OWL.differentFrom, d );
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.