Package com.hp.hpl.jena.graph.compose

Examples of com.hp.hpl.jena.graph.compose.Intersection


     
  public void testIntersection()
    {
        Graph g1 = graphWith( "x R y; p R q" );
        Graph g2 = graphWith( "r A s; x R y" );
        Intersection i = new Intersection( g1, g2 );
        assertContains( "Intersection", "x R y", i );
     assertOmits( "Intersection", i, "p R q" );
    assertOmits( "Intersection", i, "r A s" );
        if (i.size() != 1)
            fail( "oops: size of intersection is not 1" );
        i.add( triple( "cats eat cheese" ) );
        assertContains( "Intersection.L", "cats eat cheese", g1 );
        assertContains( "Intersection.R", "cats eat cheese", g2 );
        }
View Full Code Here


   
    public void testDeleteDoesNotUpdateR()
        {
      Graph L = graphWith( "a pings b; b pings c; c pings a" );
      Graph R = graphWith( "c pings a; b pings c; x captures y" );
      Graph join = new Intersection( L, R );
        L.getBulkUpdateHandler().delete( join );
        assertIsomorphic( "R should not change", graphWith( "c pings a; b pings c; x captures y" ), R );
        assertIsomorphic( graphWith( "a pings b" ), L );
    }
View Full Code Here

  
  @Override
  public Graph getGraph()
  {
    Graph gBase = graphWith( "" ), g1 = graphWith( "" );
        return new Intersection( gBase, g1 );
  }
View Full Code Here

 
  public void testIntersection()
    {
        Graph g1 = graphWith( "x R y; p R q" );
        Graph g2 = graphWith( "r A s; x R y" );
        Intersection i = new Intersection( g1, g2 );
        assertContains( "Intersection", "x R y", i );
     assertOmits( "Intersection", i, "p R q" );
    assertOmits( "Intersection", i, "r A s" );
        if (i.size() != 1)
            fail( "oops: size of intersection is not 1" );
        i.add( triple( "cats eat cheese" ) );
        assertContains( "Intersection.L", "cats eat cheese", g1 );
        assertContains( "Intersection.R", "cats eat cheese", g2 );
        }
View Full Code Here

   
    public void testDeleteDoesNotUpdateR()
        {
      Graph L = graphWith( "a pings b; b pings c; c pings a" );
      Graph R = graphWith( "c pings a; b pings c; x captures y" );
      Graph join = new Intersection( L, R );
      GraphUtil.deleteFrom(L, R) ;
        assertIsomorphic( "R should not change", graphWith( "c pings a; b pings c; x captures y" ), R );
        assertIsomorphic( graphWith( "a pings b" ), L );
    }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.graph.compose.Intersection

Copyright © 2018 www.massapicom. 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.