Package com.hp.hpl.jena.ontology

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


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

    Individual c = model.getIndividual( ns + "c" );
    Individual d = model.getIndividual( ns + "d" );

    OntProperty higher = model.getOntProperty( ns + "higher" );

    assertIteratorValues( model.listStatements( null, higher, (RDFNode) null ),
        new Statement[] {
            model.createStatement( a, higher, b ),
            model.createStatement( b, higher, c ),
            model.createStatement( b, higher, d ),
            model.createStatement( c, higher, a ),
View Full Code Here

    assertTrue( ir.hasRDFType( OWL2.IrreflexiveProperty ) );
    assertTrue( as.hasRDFType( OWL2.AsymmetricProperty ) );

    OntClass union = factory.createUnionClass( null, factory.createList( new RDFNode[] {
        D1, D2, D3 } ) );
    assertTrue( model.listStatements( D, OWL.equivalentClass, union, factory ).hasNext() );
    assertTrue( model.contains( D, OWL.equivalentClass, test1 ) );
    assertTrue( D1.isDisjointWith( D2 ) );
    assertTrue( D1.isDisjointWith( D3 ) );
    assertTrue( D2.isDisjointWith( D3 ) );
View Full Code Here

    Resource b = model.getResource( ns + "b" );
    Resource c = model.getResource( ns + "c" );

    OntProperty higher = model.getOntProperty( ns + "higher" );

    assertIteratorValues( model.listStatements( null, higher, (RDFNode) null ),
        new Statement[] {
            model.createStatement( a, higher, b ),
            model.createStatement( b, higher, c ),
            model.createStatement( c, higher, a ), } );
  }
View Full Code Here

    s3.addProperty( p3, o3 );

    Statement stmt = ont.createStatement( o1, p3, s1 );
    assertIteratorContains( o1.listPropertyValues( p3 ), s1 );
    assertTrue( ont.contains( stmt ) );
    assertIteratorContains( ont.listStatements( null, p3, (RDFNode) null ), stmt );
    assertIteratorContains( ont.listStatements( o1, null, (RDFNode) null ), stmt );
    assertIteratorContains( ont.listStatements(), stmt );
    assertFalse( ont.contains( o3, p1, s3 ) );

    assertTrue( p2.isInverseOf( p3 ) );
View Full Code Here

    Statement stmt = ont.createStatement( o1, p3, s1 );
    assertIteratorContains( o1.listPropertyValues( p3 ), s1 );
    assertTrue( ont.contains( stmt ) );
    assertIteratorContains( ont.listStatements( null, p3, (RDFNode) null ), stmt );
    assertIteratorContains( ont.listStatements( o1, null, (RDFNode) null ), stmt );
    assertIteratorContains( ont.listStatements(), stmt );
    assertFalse( ont.contains( o3, p1, s3 ) );

    assertTrue( p2.isInverseOf( p3 ) );
    assertIteratorValues( p2.listInverseOf(), new Property[] { p3 } );
View Full Code Here

    Statement stmt = ont.createStatement( o1, p3, s1 );
    assertIteratorContains( o1.listPropertyValues( p3 ), s1 );
    assertTrue( ont.contains( stmt ) );
    assertIteratorContains( ont.listStatements( null, p3, (RDFNode) null ), stmt );
    assertIteratorContains( ont.listStatements( o1, null, (RDFNode) null ), stmt );
    assertIteratorContains( ont.listStatements(), stmt );
    assertFalse( ont.contains( o3, p1, s3 ) );

    assertTrue( p2.isInverseOf( p3 ) );
    assertIteratorValues( p2.listInverseOf(), new Property[] { p3 } );
    assertTrue( p3.isInverseOf( p2 ) );
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

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.