Package com.hp.hpl.jena.reasoner

Examples of com.hp.hpl.jena.reasoner.InfGraph.prepare()


            });
                   
        // Support for now(?x)
        rules = "[r1: now(?x) -> (a p ?x)]";
        infgraph = createInfGraph(rules);
        infgraph.prepare();
        Graph result = infgraph.getDeductionsGraph();
        assertEquals(1, result.size());
        Triple tr = result.find(null, null, null).next();
        Node nowN = tr.getObject();
        assertTrue(nowN.isLiteral());
View Full Code Here


            "[r2: (?x p ?y) regex(?y, '((Boys)|(Girls))(.*)', ?m1, ?m2, ?m3, ?m4) ->  (?x q ?m2) (?x r ?m3) (?x s ?m4) ] \n" +
            "";
        Graph data = Factory.createGraphMem();
        data.add(new Triple(n1, p, NodeFactory.createLiteral("Girls44")) );
        InfGraph infgraph = createInfGraph(rules, data);
        infgraph.prepare();
        TestUtil.assertIteratorValues(this, infgraph.getDeductionsGraph().find(null, null, null),
                new Triple[] {
            new Triple(n1, q, NodeFactory.createLiteral("")),
            new Triple(n1, r, NodeFactory.createLiteral("Girls")),
            new Triple(n1, s, NodeFactory.createLiteral("44")),
View Full Code Here

    addClasses( m_Names.getAllAnons() );
   
    Reasoner reasoner = new GenericRuleReasoner(new ArrayList<Rule>(m_Rules));
   
    InfGraph inf = reasoner.bind( m_Facts );
    inf.prepare();
   
    MultiValueMap<ATermAppl, ATermAppl> subsumers = getSubsumptions(inf);
    for( ATermAppl c : classes ) {
      subsumers.add( ATermUtils.BOTTOM, c );     
    }
View Full Code Here

    addClasses( m_Names.getAllAnons() );
   
    Reasoner reasoner = new GenericRuleReasoner(new ArrayList<Rule>(m_Rules));
   
    InfGraph inf = reasoner.bind( m_Facts );
    inf.prepare();
   
    MultiValueMap<ATermAppl, ATermAppl> subsumers = getSubsumptions(inf);
    for( ATermAppl c : classes ) {
      subsumers.add( ATermUtils.BOTTOM, 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.