Package com.hp.jena.ymris.deploy.local

Examples of com.hp.jena.ymris.deploy.local.BindingSink.consume()


        BindingSink in = Utils.rulesToDeployment( sink, rules );
    //
        in.consume( nodeArray( "X x P z" ) );
        in.consume( nodeArray( "X z Q y" ) );
        in.consume( nodeArray( "X x R y" ) );
        in.consume( nodeArray( "X z S z" ) );
        assertEquals( bindings( "P is xory; Q is xory; R is xory" ), sink.bindings );
        }
    }

View Full Code Here


        LogBindings sink = new LogBindings();
        Graph given = GraphTestBase.graphWith( "b Q c" );
        String rules = "RULE { ?a <eh:/P> ?b UNLESS ?b <eh:/Q> ?c } => { ?a a <eh:/UnQed-b> }";
        BindingSink in = Utils.rulesToDeployment( sink, rules, new MyHowTo( given ) );
    //
        in.consume( GraphTestBase.nodeArray( "X a P b" ) );
        in.consume( GraphTestBase.nodeArray( "X b Q c" ) );
        in.consume( GraphTestBase.nodeArray( "X x P y" ) );
        assertEquals( Utils.bindings( "x rdf:type UnQed-b" ), sink.bindings );
        }
       
View Full Code Here

        Graph given = GraphTestBase.graphWith( "b Q c" );
        String rules = "RULE { ?a <eh:/P> ?b UNLESS ?b <eh:/Q> ?c } => { ?a a <eh:/UnQed-b> }";
        BindingSink in = Utils.rulesToDeployment( sink, rules, new MyHowTo( given ) );
    //
        in.consume( GraphTestBase.nodeArray( "X a P b" ) );
        in.consume( GraphTestBase.nodeArray( "X b Q c" ) );
        in.consume( GraphTestBase.nodeArray( "X x P y" ) );
        assertEquals( Utils.bindings( "x rdf:type UnQed-b" ), sink.bindings );
        }
       
    @Test public void testUnlessWithFilter()
View Full Code Here

        String rules = "RULE { ?a <eh:/P> ?b UNLESS ?b <eh:/Q> ?c } => { ?a a <eh:/UnQed-b> }";
        BindingSink in = Utils.rulesToDeployment( sink, rules, new MyHowTo( given ) );
    //
        in.consume( GraphTestBase.nodeArray( "X a P b" ) );
        in.consume( GraphTestBase.nodeArray( "X b Q c" ) );
        in.consume( GraphTestBase.nodeArray( "X x P y" ) );
        assertEquals( Utils.bindings( "x rdf:type UnQed-b" ), sink.bindings );
        }
       
    @Test public void testUnlessWithFilter()
        {
View Full Code Here

        LogBindings sink = new LogBindings();
        Graph given = GraphTestBase.graphWith( "b Q 1; y Q 2" );
        String rules = "RULE { ?a <eh:/P> ?b UNLESS GIVEN { ?b <eh:/Q> ?c FILTER ?c = 1 } } => { ?a a <eh:/UnQed-b> }";
        BindingSink in = Utils.rulesToDeployment( sink, rules, new MyHowTo( given ) );
    //
        in.consume( GraphTestBase.nodeArray( "X a P b" ) );
        in.consume( GraphTestBase.nodeArray( "X x P y" ) );
        assertEquals( Utils.bindings( "x rdf:type UnQed-b" ), sink.bindings );
        }
    }
View Full Code Here

        Graph given = GraphTestBase.graphWith( "b Q 1; y Q 2" );
        String rules = "RULE { ?a <eh:/P> ?b UNLESS GIVEN { ?b <eh:/Q> ?c FILTER ?c = 1 } } => { ?a a <eh:/UnQed-b> }";
        BindingSink in = Utils.rulesToDeployment( sink, rules, new MyHowTo( given ) );
    //
        in.consume( GraphTestBase.nodeArray( "X a P b" ) );
        in.consume( GraphTestBase.nodeArray( "X x P y" ) );
        assertEquals( Utils.bindings( "x rdf:type UnQed-b" ), sink.bindings );
        }
    }

/*
 
View Full Code Here

    @Test public void testYmrisBlankNodeInConclusion()
        {
        LogBindings sink = new LogBindings();
        String rules = "RULE {?x a <eh:/HasP> } => { ?x <eh:/P> [] }";
        BindingSink in = Utils.rulesToDeployment( sink, rules );
        in.consume( nodeArray( "X x rdf:type HasP" ) );
        assertEquals( 1, sink.bindings.size() );
        List<Node> bound = sink.bindings.get(0);
        assertEquals( node( "x" ), bound.get(1) );
        assertEquals( node( "P" ), bound.get(2) );
        assertTrue( bound.get(3).isBlank() );
View Full Code Here

    @Test public void testDifferentBindingsGenerateDifferentBNodes()
        {
        LogBindings sink = new LogBindings();
        String rules = "RULE {?x a <eh:/HasP> } => { ?x <eh:/P> [] }";
        BindingSink in = Utils.rulesToDeployment( sink, rules );
        in.consume( nodeArray( "X x rdf:type HasP" ) );
        in.consume( nodeArray( "X y rdf:type HasP" ) );
        assertEquals( 2, sink.bindings.size() );
        Node blankA = sink.bindings.get(0).get(3);
        Node blankB = sink.bindings.get(1).get(3);
        assertTrue( blankA.isBlank() );
View Full Code Here

        {
        LogBindings sink = new LogBindings();
        String rules = "RULE {?x a <eh:/HasP> } => { ?x <eh:/P> [] }";
        BindingSink in = Utils.rulesToDeployment( sink, rules );
        in.consume( nodeArray( "X x rdf:type HasP" ) );
        in.consume( nodeArray( "X y rdf:type HasP" ) );
        assertEquals( 2, sink.bindings.size() );
        Node blankA = sink.bindings.get(0).get(3);
        Node blankB = sink.bindings.get(1).get(3);
        assertTrue( blankA.isBlank() );
        assertTrue( blankB.isBlank() );
View Full Code Here

    @Test public void testSameBindingsGenerateSameBNodes()
        {
        LogBindings sink = new LogBindings();
        String rules = "RULE {?x a <eh:/HasP> } => { ?x <eh:/P> [] }";
        BindingSink in = Utils.rulesToDeployment( sink, rules );
        in.consume( nodeArray( "X x rdf:type HasP" ) );
        in.consume( nodeArray( "X x rdf:type HasP" ) );
        assertEquals( 1, sink.bindings.size() );
        Node blankA = sink.bindings.get(0).get(3);
        assertTrue( blankA.isBlank() );
        }
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.