Package com.hp.hpl.jena.reasoner

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


    "[rp4: (?X rdf:type all(?P, ?C)), (?X ?P ?Y) -> (?Y rdf:type ?C)]"
                          );       
        Reasoner reasoner =  createReasoner(rules);
        InfGraph infgraph = reasoner.bind(data);
        TestUtil.assertIteratorValues(this,
              infgraph.find(b, ty, c), new Object[] {
                  new Triple(b, ty, c)
              } );
    }
   
View Full Code Here


        "[restrictionSubclass2: unbound(?R), (?X rdf:type ?D), (?D owl:equivalentClass ?R) isFunctor(?R) -> (?X rdf:type ?R)]" +
                       ""  );       
        Reasoner reasoner =  createReasoner(rules);
        InfGraph infgraph = reasoner.bind(data);
        TestUtil.assertIteratorValues(this,
              infgraph.find(a, ty, C1), new Object[] {
                  new Triple(a, ty, C1)
              } );
        TestUtil.assertIteratorValues(this,
              infgraph.find(a, ty, c), new Object[] {
                  new Triple(a, ty, c)
View Full Code Here

        TestUtil.assertIteratorValues(this,
              infgraph.find(a, ty, C1), new Object[] {
                  new Triple(a, ty, C1)
              } );
        TestUtil.assertIteratorValues(this,
              infgraph.find(a, ty, c), new Object[] {
                  new Triple(a, ty, c)
              } );
    }

    /**
 
View Full Code Here

        "[restrictionProc4b: unbound(?Y), (?X rdf:type all(?P, ?C)), (?X ?P ?Y), notEqual(?P, rdf:type),-> (?Y rdf:type ?C)]" +
                       ""  );       
        Reasoner reasoner =  createReasoner(rules);
        InfGraph infgraph = reasoner.bind(data);
        TestUtil.assertIteratorValues(this,
              infgraph.find(null, ty, c), new Object[] {
              } );
    }

    /**
     * Test close and halt operation.
View Full Code Here

        "[rdfs7:  (?a rdf:type rdfs:Class) -> (?a rdfs:subClassOf ?a)]"
                        );       
        Reasoner reasoner =  createReasoner(rules);
        InfGraph infgraph = reasoner.bind(data);
        // Get just one result
        ExtendedIterator<Triple> it = infgraph.find(a, ty, null);
        Triple result = it.next();
        assertEquals(result.getSubject(), a);
        assertEquals(result.getPredicate(), ty);
        it.close();
        // Make sure if we start again we get the full listing.
View Full Code Here

        assertEquals(result.getSubject(), a);
        assertEquals(result.getPredicate(), ty);
        it.close();
        // Make sure if we start again we get the full listing.
        TestUtil.assertIteratorValues(this,
            infgraph.find(a, ty, null),
            new Object[] {
                new Triple(a, ty, C1),
                new Triple(a, ty, C2),
                new Triple(a, ty, C3)
            } );
View Full Code Here

        data.add(new Triple(a, p, b));
        List<Rule> rules = Rule.parseRules(Util.loadRuleParserFromResourceFile("testing/reasoners/bugs/rdfs-error1.brules"));
        Reasoner reasoner =  createReasoner(rules);
        InfGraph infgraph = reasoner.bind(data);
        TestUtil.assertIteratorValues(this,
            infgraph.find(b, ty, C1),
            new Object[] {
                new Triple(b, ty, C1)
            } );
       
    }
View Full Code Here

                                        a, Util.makeIntNode(0)  })));
        data.add(new Triple(n3, p, Functor.makeFunctorNode("f", new Node[] {
               a, NodeFactory.createLiteral( "0", "", XSDDatatype.XSDnonNegativeInteger ) } )));
        InfGraph infgraph = createInfGraph(rules, data);
       
        TestUtil.assertIteratorValues(this, infgraph.find(null, s, null),
            new Triple[] {
                new Triple(n2, s, res),
                new Triple(n3, s, res),
            });
    }
View Full Code Here

        data.add(new Triple(n1, q, Util.makeIntNode(2)) );
        data.add(new Triple(n2, q, Util.makeIntNode(2)) );
        data.add(new Triple(n3, q, Util.makeIntNode(3)) );
        InfGraph infgraph = createInfGraph(rules, data);
       
        TestUtil.assertIteratorValues(this, infgraph.find(n1, null, n2),
            new Triple[] {
                new Triple(n1, eq, n2),
                new Triple(n1, le, n2),
                new Triple(n1, ge, n2),
            });
View Full Code Here

            new Triple[] {
                new Triple(n1, eq, n2),
                new Triple(n1, le, n2),
                new Triple(n1, ge, n2),
            });
        TestUtil.assertIteratorValues(this, infgraph.find(n1, null, n3),
            new Triple[] {
                new Triple(n1, ne, n3),
                new Triple(n1, lt, n3),
                new Triple(n1, le, n3),
            });
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.