Examples of RippleValue


Examples of net.fortytwo.ripple.model.RippleValue

    public void evaluate(final Sink<RippleList> sink,
                         final QueryEngine qe,
                         final ModelConnection mc)
            throws RippleException {
        RippleValue v = (null == language)
                ? mc.valueOf(value)
                : mc.valueOf(value, language);
        sink.put(mc.list().push(v));
    }
View Full Code Here

Examples of net.fortytwo.ripple.model.RippleValue

                         final QueryEngine qe,
                         final ModelConnection mc)
            throws RippleException {
        Sink<RippleList> typeSink = new Sink<RippleList>() {
            public void put(final RippleList l) throws RippleException {
                RippleValue type = l.getFirst();
                Value t = (URI) type.toRDF(mc).sesameValue();
                if (t instanceof URI) {
                    sink.put(mc.list().push(mc.valueOf(value, (URI) t)));
                } else {
                    qe.getErrorPrintStream().println("datatype does not map to a URI reference: " + type);
                }
            }
        };

        type.evaluate(typeSink, qe, mc);
    }
View Full Code Here

Examples of net.fortytwo.ripple.model.RippleValue

    private double compare(final String expr1, final String expr2) throws Exception {
        Collection<RippleList> results = reduce(expr1 + " " + expr2 + " compare.");
        assertEquals(1, results.size());
        RippleList l = results.iterator().next();
        assertEquals(1, l.length());
        RippleValue v = l.getFirst();
        assertTrue(v instanceof NumericValue);
        return ((NumericValue) v).doubleValue();
    }
View Full Code Here

Examples of net.fortytwo.ripple.model.RippleValue

    public void apply(final RippleList arg,
                      final Sink<RippleList> solutions,
                      final ModelConnection mc) throws RippleException {

        RippleList stack = arg;
        RippleValue first = stack.getFirst();
        stack = stack.getRest();

        if (first instanceof KeyValueValue) {
            for (String key : ((KeyValueValue) first).getKeys()) {
                RippleValue value = ((KeyValueValue) first).getValue(key, mc);
                solutions.put(stack.push(mc.valueOf(key)).push(value));
            }
        }
    }
View Full Code Here

Examples of net.fortytwo.ripple.model.RippleValue

    public void apply(final RippleList arg,
                      final Sink<RippleList> solutions,
                      final ModelConnection mc) throws RippleException {

        RippleList stack = arg;
        RippleValue first = stack.getFirst();
        final RippleList rest = stack.getRest();

        Sink<Operator> opSink = new Sink<Operator>() {
            public void put(final Operator op) throws RippleException {
                solutions.put(rest.push(
View Full Code Here

Examples of net.fortytwo.ripple.model.RippleValue

                      final ModelConnection mc) throws RippleException {
        RippleList stack = arg;

        final int index = mc.toNumericValue(stack.getFirst()).intValue();
        stack = stack.getRest();
        RippleValue l = stack.getFirst();
        final RippleList rest = stack.getRest();

        Sink<RippleList> listSink = new Sink<RippleList>() {
            public void put(RippleList list) throws RippleException {
                if (list.isNil()) {
View Full Code Here

Examples of net.fortytwo.ripple.model.RippleValue

    public void apply(final RippleList arg,
                      final Sink<RippleList> solutions,
                      final ModelConnection mc) throws RippleException {
        RippleList stack = arg;
        RippleValue l;

        l = stack.getFirst();
        stack = stack.getRest();
        final RippleValue x = stack.getFirst();
        final RippleList rest = stack.getRest();

        Sink<RippleList> listSink = new Sink<RippleList>() {
            public void put(final RippleList list) throws RippleException {
                solutions.put(
View Full Code Here

Examples of net.fortytwo.ripple.model.RippleValue

                      final Sink<RippleList> solutions,
                      final ModelConnection mc) throws RippleException {
        RippleList stack = arg;

        int begin, end;
        RippleValue s;
        String result;

        end = mc.toNumericValue(stack.getFirst()).intValue();
        stack = stack.getRest();
        begin = mc.toNumericValue(stack.getFirst()).intValue();
View Full Code Here

Examples of net.fortytwo.ripple.model.RippleValue

    public void apply(final RippleList arg,
                      final Sink<RippleList> solutions,
                      final ModelConnection mc) throws RippleException {

        RippleList stack = arg;
        RippleValue mapping = stack.getFirst();
        final RippleList rest = stack.getRest();

        Sink<Operator> opSink = new Sink<Operator>() {
            public void put(final Operator op) throws RippleException {
                CriterionApplicator applicator = new CriterionApplicator(op);
View Full Code Here

Examples of net.fortytwo.ripple.model.RippleValue

        if (0 > n) {
            return;
        }

        stack = stack.getRest();
        final RippleValue l = stack.getFirst();
        final RippleList rest = stack.getRest();

        Sink<RippleList> listSink = new Sink<RippleList>() {
            public void put(final RippleList list) throws RippleException {
                RippleList result = drop(list, n);
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.