Package com.hp.hpl.jena.reasoner.rulesys

Examples of com.hp.hpl.jena.reasoner.rulesys.Functor$FunctorDatatype


        java.util.List<Node> nodes = new ArrayList<Node>();

        nodes.add(arg1Node);
        nodes.add(arg2Node);

        return (T) new Functor("regex", nodes, BuiltinRegistry.theRegistry);

    }
View Full Code Here


        nodes.add(arg1Node);
        nodes.add(arg2Node);
        nodes.add(arg3Node);

        ClauseEntry clauseEntry = new Functor("sum", nodes, BuiltinRegistry.theRegistry);

        clauseEntries.add(clauseEntry);

        return (T) new HigherOrderClauseEntry(arg3Node, clauseEntries);
View Full Code Here

        java.util.List<Node> nodes = new ArrayList<Node>();

        nodes.add(argNode);

        return (T) new Functor("isBNode", nodes, BuiltinRegistry.theRegistry);

    }
View Full Code Here

       
        System.out.println("Class: " + f.getClass().getCanonicalName());
        System.out.println("Arg1: " + arg1Node.getClass().getCanonicalName());
        System.out.println("Arg2: " + arg2Node.getClass().getCanonicalName());
       
        Functor functor = new Functor("greaterThan", nodes, BuiltinRegistry.theRegistry);

        clauseEntries.add(functor);

        return (T) new HigherOrderClauseEntry(arg1Node, clauseEntries);
View Full Code Here

        java.util.List<Node> nodes = new ArrayList<Node>();

        nodes.add(variableNode);
        nodes.add(parameterNode);

        ClauseEntry clauseEntry = new Functor("makeSkolem", nodes, BuiltinRegistry.theRegistry);

        clauseEntries.add(clauseEntry);

        return (T) new HigherOrderClauseEntry(variableNode, clauseEntries);
View Full Code Here

        nodes.add(arg1Node);
        nodes.add(arg2Node);
        nodes.add(resultNode);

        return (T) new Functor("strConcat", nodes, new BuiltinRegistry());

    }
View Full Code Here

        java.util.List<Node> nodes = new ArrayList<Node>();

        nodes.add(arg1Node);
        nodes.add(arg2Node);

        Functor functor = new Functor("le", nodes, BuiltinRegistry.theRegistry);

        clauseEntries.add(functor);

        return (T) new HigherOrderClauseEntry(arg1Node, clauseEntries);
View Full Code Here

                            engine.deleteTriple(t, true);
                        }
                    }
              // }
            } else if (hClause instanceof Functor && isAdd) {
                Functor f = (Functor)hClause;
                Builtin imp = f.getImplementor();
                if (imp != null) {
                    imp.headAction(f.getBoundArgs(env), f.getArgLength(), context);
                } else {
                    throw new ReasonerException("Invoking undefined Functor " + f.getName() +" in " + rule.toShortString());
                }
            } else if (hClause instanceof Rule) {
                Rule r = (Rule)hClause;
                if (r.isBackward()) {
                    if (isAdd) {
View Full Code Here

        if (node instanceof Node_RuleVariable) {
            return environment[((Node_RuleVariable)node).getIndex()];
        } else if (node instanceof Node_ANY) {
            return null;
        } else if (Functor.isFunctor(node)) {
            Functor functor = (Functor)node.getLiteralValue();
            if (functor.isGround()) return node;
            Node[] args = functor.getArgs();
            List<Node> boundargs = new ArrayList<>(args.length);
            for ( Node arg : args )
            {
                Node binding = getBinding( arg );
                if ( binding == null )
                {
                    // Not sufficent bound to instantiate functor yet
                    return null;
                }
                boundargs.add( binding );
            }
            Functor newf = new Functor(functor.getName(), boundargs);
            return Functor.makeFunctorNode( newf );
        } else {
            return node;
        }
    }
View Full Code Here

        ok =  predicate.isVariable() || pattern.predicate.isVariable() || predicate.equals(pattern.predicate);
        if (!ok) return false;
        if (object.isVariable() || pattern.object.isVariable()) return true;
        // Left with checking compatibility of ground literals
        if (Functor.isFunctor(object) && Functor.isFunctor(pattern.object)) {
            Functor functor = (Functor)object.getLiteralValue();
            Functor pFunctor = (Functor)pattern.object.getLiteralValue();
            return (functor.getName().equals(pFunctor.getName())
                            && functor.getArgs().length == pFunctor.getArgs().length);
        } else {
            return object.sameValueAs(pattern.object);
        }
    }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.reasoner.rulesys.Functor$FunctorDatatype

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.