Examples of RDFValue


Examples of net.fortytwo.ripple.model.RDFValue

            }

            Sink<Value> valueSink = new Sink<Value>() {
                public void put(final Value val) throws RippleException {
                    //System.out.println("got value: " + val);
                    sink.put(canonicalValue(new RDFValue(val)));
                }
            };

            try {
                sesameQuery.getValues(sailConnection, valueSink);
View Full Code Here

Examples of net.fortytwo.ripple.model.RDFValue

                try {
                    CloseableIteration<? extends Resource, SailException> iter
                            = sailConnection.getContextIDs();

                    while (iter.hasNext()) {
                        sink.put(new RDFValue(iter.next()));
                    }

                    iter.close();
                } catch (SailException e) {
                    throw new RippleException(e);
View Full Code Here

Examples of net.fortytwo.ripple.model.RDFValue

        // TODO: handle list containment cycles (e.g. list containing a list containing the original list) as well.
        // These are actually more likely than circular lists.
        Set<RDFValue> alreadyInterned = new HashSet<RDFValue>();

        RippleList cur = list;
        RDFValue id = cur.toRDF(this);
        while (!cur.isNil()) {
            if (alreadyInterned.contains(id)) {
                break;
            } else {
                alreadyInterned.add(id);
            }

            RDFValue firstRdf = cur.getFirst().toRDF(this);

            if (null == firstRdf) {
                System.err.println("list item has no RDF identity: " + cur.getFirst());
                return false;
            }

            if (cur.getFirst() instanceof RippleList) {
                internalize((RippleList) cur.getFirst());
            }

            RippleList rest = cur.getRest();
            RDFValue restRdf = rest.toRDF(this);

            buffer.put(
                    valueFactory.createStatement((Resource) id.sesameValue(), RDF.TYPE, RDF.LIST));
            buffer.put(
                    valueFactory.createStatement((Resource) id.sesameValue(), RDF.FIRST, firstRdf.sesameValue()));
            buffer.put(
                    valueFactory.createStatement((Resource) id.sesameValue(), RDF.REST, restRdf.sesameValue()));

            cur = rest;
            id = restRdf;
        }
View Full Code Here

Examples of net.fortytwo.ripple.model.RDFValue

    private SesameList() {
        super(null, null);
        // Note: this is a trick to avoid null pointer exceptions in the list memoizer.
        first = this;

        rdfEquivalent = new RDFValue(RDF.NIL);
    }
View Full Code Here

Examples of net.fortytwo.ripple.model.RDFValue

    }

    @Override
    public RippleValue getValue(final String key,
                                final ModelConnection mc) throws RippleException {
        return mc.canonicalValue(new RDFValue(pairs.get(key)));
    }
View Full Code Here

Examples of net.fortytwo.ripple.model.RDFValue

                p.print(", ");
            }

            p.print(key);
            p.print(":");
            p.print(new RDFValue(pairs.get(key)));
        }
    }
View Full Code Here

Examples of net.fortytwo.ripple.model.RDFValue

            Sink<Statement> stSink = new Sink<Statement>() {
                public void put(final Statement st) throws RippleException {
                    Resource context = st.getContext();

                    RippleValue pred = mc.canonicalValue(new RDFValue(st.getPredicate()));
                    RippleValue obj = mc.canonicalValue(new RDFValue(st.getObject()));
                    RippleValue ctx = (null == context) ? mc.list() : mc.canonicalValue(new RDFValue(context));

                    solutions.put(stack.push(pred).push(obj).push(ctx));
                }
            };
View Full Code Here

Examples of net.fortytwo.ripple.model.RDFValue

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

        RDFValue uri = mc.valueOf(URI.create(mc.toString(arg.getFirst())));
        //stack = stack.getRest();

        try {
            play(uri);
        } catch (RippleException e) {
View Full Code Here

Examples of net.fortytwo.ripple.model.RDFValue

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

        RDFValue uri = mc.valueOf(URI.create(mc.toString(arg.getFirst())));
        //stack = stack.getRest();

        ImagePanel panel;

        try {
View Full Code Here

Examples of net.fortytwo.ripple.model.RDFValue

    }

    public void testValueOf() throws Exception {
        String s = "http://example.org/foo";
        java.net.URI u = java.net.URI.create(s);
        RDFValue v = modelConnection.valueOf(u);
        assertEquals(s, v.sesameValue().stringValue());
    }
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.