Package com.hp.hpl.jena.ontology

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


    Resource C2 = model.getResource( ns + "76-80" );
   
    Resource i1 = model.getResource( ns + "mark1" );
    Resource i2 = model.getResource( ns + "mark2" );

    assertIteratorValues(model.listSubjectsWithProperty(RDF.type, C1), i1);
    assertIteratorValues(model.listSubjectsWithProperty(RDF.type, C2), i2);
  }

 
  @Test
View Full Code Here


   
    Resource i1 = model.getResource( ns + "mark1" );
    Resource i2 = model.getResource( ns + "mark2" );

    assertIteratorValues(model.listSubjectsWithProperty(RDF.type, C1), i1);
    assertIteratorValues(model.listSubjectsWithProperty(RDF.type, C2), i2);
  }

 
  @Test
  public void testExtractor() {
View Full Code Here

      Resource x = model.createResource( ns + "x" );
      Resource y = model.createResource( ns + "y" );

      model.add( x, RDFS.seeAlso, y );

      assertIteratorValues( model.listSubjectsWithProperty( RDFS.seeAlso, y ),
          new Resource[] { x } );
    } finally {
      PelletOptions.USE_ANNOTATION_SUPPORT = oldUA;
    }
  }
View Full Code Here

    model.prepare();

    assertIteratorValues( a.listDifferentFrom(), new Resource[] { c, d } );

    assertIteratorValues( model.listSubjectsWithProperty( OWL.differentFrom, a ),
        new Resource[] { c, d } );

    assertIteratorValues( b.listDifferentFrom(), new Resource[] { c } );

    assertIteratorValues( model.listSubjectsWithProperty( OWL.differentFrom, b ),
View Full Code Here

    assertIteratorValues( model.listSubjectsWithProperty( OWL.differentFrom, a ),
        new Resource[] { c, d } );

    assertIteratorValues( b.listDifferentFrom(), new Resource[] { c } );

    assertIteratorValues( model.listSubjectsWithProperty( OWL.differentFrom, b ),
        new Resource[] { c } );
  }

  @Test
  public void testSameAs1() {
View Full Code Here

        comprises, Executive ) );

    assertIteratorValues( model.listObjectsOfProperty( Forest_Service, comprises ),
        new Resource[] { USDA, Executive } );

    assertIteratorValues( model.listSubjectsWithProperty( comprises, Executive ),
        new Resource[] {
            model.getIndividual( ns + "USDA" ),
            model.getIndividual( ns + "DOE" ),
            model.getIndividual( ns + "DHS" ),
            model.getIndividual( ns + "HHS" ),
View Full Code Here

    assertIteratorValues( model.listObjectsOfProperty( a, knows ),
        new Resource[] { b, c, d, f } );

    assertIteratorValues( model.listObjectsOfProperty( b, knows ), new Resource[] { c, e, f } );

    assertIteratorValues( model.listSubjectsWithProperty( knows, e ), new Resource[] { b, d } );

    assertIteratorValues( model.listSubjectsWithProperty( hasRelative, f ), new Resource[] {
        a, b, c } );
  }
View Full Code Here

    assertIteratorValues( model.listObjectsOfProperty( b, knows ), new Resource[] { c, e, f } );

    assertIteratorValues( model.listSubjectsWithProperty( knows, e ), new Resource[] { b, d } );

    assertIteratorValues( model.listSubjectsWithProperty( hasRelative, f ), new Resource[] {
        a, b, c } );
  }

  @Test
  public void testTransitiveSubProperty2() {
View Full Code Here

    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" ) );

    assertTrue( !model.contains( null, email, john ) );
View Full Code Here

      Resource x = model.createResource( ns + "x" );
      Resource y = model.createResource( ns + "y" );

      model.add( x, RDFS.seeAlso, y );

      assertIteratorValues( model.listSubjectsWithProperty( RDFS.seeAlso, y ),
          new Resource[] { x } );
    } finally {
      PelletOptions.USE_ANNOTATION_SUPPORT = oldUA;
    }
  }
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.