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

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


    @Test public void testToBothConsumesToBoth()
        {
        LogBindings L = new LogBindings(), R = new LogBindings();
        BindingSink both = BindingSink.toBoth( L, R );
        Node [] binding = new Node[] {null, GraphTestBase.node( "A" )};
        both.consume( binding );
        assertEquals( Utils.bindings( "A" ), L.bindings );
        assertEquals( Utils.bindings( "A" ), R.bindings );
        assertFalse( L.startCalled );
        assertFalse( L.finishCalled );
        assertFalse( R.startCalled );
View Full Code Here


        {
        LogBindings sink = new LogBindings();
        String rules = "RULE { ?x <eh:/P> ?y } => { ?x a <eh:/PD>. ?y a <eh:/PR> }";
        BindingSink in = Utils.rulesToDeployment( sink, rules );
    //
        in.consume( GraphTestBase.nodeArray( "X S P O" ) );
        assertEquals( Utils.bindings( "S rdf:type PD; O rdf:type PR" ), sink.bindings );
        }

    }
View Full Code Here

        LogBindings sink = new LogBindings();
        String rules =
            "RULE { ?x ?P ?x } => { ?P <eh:/is> <eh:/Reflexed> }";
        BindingSink in = Utils.rulesToDeployment( sink, rules );
    //
        in.consume( GraphTestBase.nodeArray( "X x P x" ) );
        in.consume( GraphTestBase.nodeArray( "X x Q y" ) );
        assertEquals( Utils.bindings( "P is Reflexed" ), sink.bindings );
        }
    }
View Full Code Here

        String rules =
            "RULE { ?x ?P ?x } => { ?P <eh:/is> <eh:/Reflexed> }";
        BindingSink in = Utils.rulesToDeployment( sink, rules );
    //
        in.consume( GraphTestBase.nodeArray( "X x P x" ) );
        in.consume( GraphTestBase.nodeArray( "X x Q y" ) );
        assertEquals( Utils.bindings( "P is Reflexed" ), sink.bindings );
        }
    }

View Full Code Here

        {
        LogBindings sink = new LogBindings();
        String rules = "RULE { ?x ?P ?y FILTER ?x = ?y } => { ?P <eh:/is> <eh:/Reflexed> }";
        BindingSink in = Utils.rulesToDeployment( sink, rules );
    //
        in.consume( GraphTestBase.nodeArray( "X x P x" ) );
        assertEquals( Utils.bindings( "P is Reflexed" ), sink.bindings );
        }

    }
View Full Code Here

    @Test public void testYmrisBlankNodeWithOnePropertyInPremise()
        {
        LogBindings sink = new LogBindings();
        String rules = "RULE { [] <eh:/P> ?y } => { ?y a <eh:/Presented> }";
        BindingSink in = Utils.rulesToDeployment( sink, rules );
        in.consume( nodeArray( "X a P b" ) );
        assertEquals( bindings( "b rdf:type Presented" ), sink.bindings );
        }
   
    @Test public void testYmrisBlankNodeWithMultiplePropertiesInPremise()
        {
View Full Code Here

    @Test public void testYmrisBlankNodeWithMultiplePropertiesInPremise()
        {
        LogBindings sink = new LogBindings();
        String rules = "RULE { [<eh:/P> ?x] <eh:/Q> ?y } => { ?x <eh:/PQ> ?y }";
        BindingSink in = Utils.rulesToDeployment( sink, rules );
        in.consume( nodeArray( "X a P x" ) );
        in.consume( nodeArray( "X a Q y" ) );
        in.consume( nodeArray( "X b P x" ) );
        assertEquals( bindings( "x PQ y" ), sink.bindings );
        }
    }
View Full Code Here

            {           
            @Override public void consume( Node[] item )
                {
                if (deductions.add( new Binding( item ) ) )
                    {
                    sink.consume( item );
                    queue.add( item );
                    }
                }
            };
        PrefixMapping pm = createPrefixMapping().withDefaultMappings( PrefixMapping.Standard );
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.