Package com.hp.hpl.jena.ontology

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


 
    assertIteratorValues( model.listStatements(a, null, (RDFNode) null), stmts );
   
    ((PelletInfGraph) model.getGraph()).setSkipBuiltinPredicates(true);
   
    assertIteratorValues( model.listStatements(a, null, (RDFNode) null), stmts[0], stmts[1], stmts[2] );   
 
 
  @Test
  public void testAutoRealizeEnabled() {
    testAutoRealize(true);
View Full Code Here


    model.add(s1);
    model.add(new StatementImpl(p2, RDF.type, OWL.DatatypeProperty));
    model.add(new StatementImpl(p2, OWL.equivalentProperty, p1));

    StmtIterator iter = model.listStatements(c, null, l);

    List<Statement> results = new ArrayList<Statement>();
    while(iter.hasNext()) {
          results.add(iter.next());
        }
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

    assertIteratorValues( model.listObjectsOfProperty( hasFather ), new Object[] { Dad } );

    assertIteratorValues( model.listObjectsOfProperty( hasMother ), new Object[] { Mom } );

    assertIteratorValues( model.listStatements( null, hasParent, (Resource) null ),
        new Statement[] {
            ResourceFactory.createStatement( Bob, hasParent, Mom ),
            ResourceFactory.createStatement( Bob, hasParent, Dad ) } );

    assertIteratorValues( model.listStatements( Bob, null, Dad ), new Statement[] {
View Full Code Here

    assertIteratorValues( model.listStatements( null, hasParent, (Resource) null ),
        new Statement[] {
            ResourceFactory.createStatement( Bob, hasParent, Mom ),
            ResourceFactory.createStatement( Bob, hasParent, Dad ) } );

    assertIteratorValues( model.listStatements( Bob, null, Dad ), new Statement[] {
        ResourceFactory.createStatement( Bob, topObjProp, Dad ),
        ResourceFactory.createStatement( Bob, hasParent, Dad ),
        ResourceFactory.createStatement( Bob, hasFather, Dad ) } );

    assertIteratorValues( model.listObjectsOfProperty( Bob, hasFather ), new Resource[] { Dad } );
View Full Code Here

    model.add(s1);
    model.add(new StatementImpl(p2, RDF.type, OWL.DatatypeProperty));
    model.add(new StatementImpl(p2, OWL.equivalentProperty, p1));

    StmtIterator iter = model.listStatements(c, null, l);

    List<Statement> results = new ArrayList<Statement>();
    while(iter.hasNext()) {
          results.add(iter.next());
        }
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

    Individual anon = model.createIndividual( c );
    Individual x = model.createIndividual( ns + "x", c );

    model.contains( OWL.Nothing, RDF.type, OWL.Class );
   
    assertIteratorValues( model.listStatements( x, RDF.type, (Resource) null ), new Object[] {
      model.createStatement( x, RDF.type, OWL.Thing ),
      model.createStatement( x, RDF.type, c )
     
    });
   
View Full Code Here

      model.createStatement( x, RDF.type, OWL.Thing ),
      model.createStatement( x, RDF.type, c )
     
    });
   
    assertIteratorValues( model.listStatements( anon, RDF.type, (Resource) null ), new Object[] {
      model.createStatement( anon, RDF.type, OWL.Thing ),
      model.createStatement( anon, RDF.type, c )
     
    });
   
View Full Code Here

      model.createStatement( anon, RDF.type, OWL.Thing ),
      model.createStatement( anon, RDF.type, c )
     
    });
   
    assertIteratorValues( model.listStatements( null, RDF.type, OWL.Thing ), new Object[] {
      model.createStatement( anon, RDF.type, OWL.Thing ),
      model.createStatement( x, RDF.type, OWL.Thing )
     
    });
   
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.