Package com.hp.hpl.jena.ontology

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


    Resource a = model.createResource( "a", OWL.Thing );
    Resource b = model.createResource( "b", OWL.Thing );
    Literal lit = model.createLiteral( "l" );

    Statement[] stats = new Statement[] {
      model.createStatement( a, OWL2.topObjectProperty, b ),
      model.createStatement( a, OWL2.topDataProperty, lit ),
      model.createStatement( a, OWL2.bottomObjectProperty, b ),
      model.createStatement( a, OWL2.bottomDataProperty, lit )
    };
   
View Full Code Here


    Resource b = model.createResource( "b", OWL.Thing );
    Literal lit = model.createLiteral( "l" );

    Statement[] stats = new Statement[] {
      model.createStatement( a, OWL2.topObjectProperty, b ),
      model.createStatement( a, OWL2.topDataProperty, lit ),
      model.createStatement( a, OWL2.bottomObjectProperty, b ),
      model.createStatement( a, OWL2.bottomDataProperty, lit )
    };
   
    for( int i = 0; i < stats.length; i++ ) {     
View Full Code Here

    Literal lit = model.createLiteral( "l" );

    Statement[] stats = new Statement[] {
      model.createStatement( a, OWL2.topObjectProperty, b ),
      model.createStatement( a, OWL2.topDataProperty, lit ),
      model.createStatement( a, OWL2.bottomObjectProperty, b ),
      model.createStatement( a, OWL2.bottomDataProperty, lit )
    };
   
    for( int i = 0; i < stats.length; i++ ) {     
      model.add( stats[i] );
View Full Code Here

    Statement[] stats = new Statement[] {
      model.createStatement( a, OWL2.topObjectProperty, b ),
      model.createStatement( a, OWL2.topDataProperty, lit ),
      model.createStatement( a, OWL2.bottomObjectProperty, b ),
      model.createStatement( a, OWL2.bottomDataProperty, lit )
    };
   
    for( int i = 0; i < stats.length; i++ ) {     
      model.add( stats[i] );
      model.prepare();
View Full Code Here

    Resource C = model.createResource( ns + "C" );
    Resource p = model.createResource( ns + "p" );
   
    model.add( p, RDFS.domain, C );
   
    assertIteratorContains(model.listStatements(p, null, (RDFNode) null), model.createStatement(p, RDF.type, OWL.ObjectProperty));
  }
 
  @Test
  public void closeModel() {
    // ticket #487
View Full Code Here

    // confirm that the property is there
    assertTrue( i1.hasProperty( prop, "test" ) );

    // confirm that the property is there when querying with a predicate
    assertIteratorContains( i1.listProperties(), model.createStatement( i1, prop, "test" ) );

    // confirm that the property is copied over when querying with a
    // predicate
    assertTrue( i2.hasProperty( prop, "test" ) );
View Full Code Here

    // predicate
    assertTrue( i2.hasProperty( prop, "test" ) );

    // confirm that the property is copied over when querying with a
    // predicate
    assertIteratorContains( i2.listProperties(), model.createStatement( i2, prop, "test" ) );
  }

  @Test
  public void testSameAs3() {
    OntModelSpec ontModelSpec = new OntModelSpec( OntModelSpec.OWL_DL_MEM_RULE_INF );
View Full Code Here

    Resource C = model.createResource( ns + "C" );
    Resource p = model.createResource( ns + "p" );
   
    model.add( p, RDFS.domain, C );
   
    assertIteratorContains(model.listStatements(p, null, (RDFNode) null), model.createStatement(p, RDF.type, OWL.ObjectProperty));
  }
 
  @Test
  public void closeModel() {
    // ticket #487
View Full Code Here

    Resource a = model.createResource( "a", OWL.Thing );
    Resource b = model.createResource( "b", OWL.Thing );
    Literal lit = model.createLiteral( "l" );

    Statement[] stats = new Statement[] {
      model.createStatement( a, OWL2.topObjectProperty, b ),
      model.createStatement( a, OWL2.topDataProperty, lit ),
      model.createStatement( a, OWL2.bottomObjectProperty, b ),
      model.createStatement( a, OWL2.bottomDataProperty, lit )
    };
   
View Full Code Here

    Resource b = model.createResource( "b", OWL.Thing );
    Literal lit = model.createLiteral( "l" );

    Statement[] stats = new Statement[] {
      model.createStatement( a, OWL2.topObjectProperty, b ),
      model.createStatement( a, OWL2.topDataProperty, lit ),
      model.createStatement( a, OWL2.bottomObjectProperty, b ),
      model.createStatement( a, OWL2.bottomDataProperty, lit )
    };
   
    for( int i = 0; i < stats.length; i++ ) {     
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.