Package net.fortytwo.ripple.model

Examples of net.fortytwo.ripple.model.Model


        URIMap uriMap = new URIMap();
        SailConfiguration sailConfig = new SailConfiguration(uriMap);
        Sail sail = sailConfig.getSail();

        // Attach a Ripple model to the repository.
        Model model = new SesameModel(sail);

        // Attach a query engine to the model.
        StackEvaluator evaluator = new LazyStackEvaluator();
        QueryEngine qe
                = new QueryEngine(model, evaluator, out, err);

        // Attach an interpreter to the query engine and let it query from
        // standard input.
        RippleCommandLine r = new RippleCommandLine(qe, in);
        r.run();

        // Shut down.
        model.shutDown();
    }
View Full Code Here


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

        Model model = mc.getModel();
        if (model instanceof SesameModel) {
            RippleList stack = arg;

            RippleValue head = stack.getFirst();
            final RippleList rest = stack.getRest();
View Full Code Here

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

        Model model = mc.getModel();
        if (model instanceof SesameModel) {
            final RippleList stack = arg;

            final RippleValue obj = stack.getFirst();
            final RippleList rest = stack.getRest();
View Full Code Here

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

        Model model = mc.getModel();
        if (model instanceof SesameModel) {
            final RippleList stack = arg;

            RippleValue subj;
View Full Code Here

/**
* @author Joshua Shinavier (http://fortytwo.net)
*/
public class RipplePrintStreamTest extends RippleTestCase {
    public void testLiterals() throws Exception {
        Model model = getTestModel();
        ModelConnection mc = model.createConnection();
        QueryEngine qe = new QueryEngine(model, null, System.out, System.err);
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        RipplePrintStream ps = new RipplePrintStream(new PrintStream(bos), qe.getLexicon());

        mc.setNamespace("xsd", "http://www.w3.org/2001/XMLSchema#", true);
View Full Code Here

            MIN_EXPR_LENGTH = 0,
            MAX_EXPR_LENGTH = 50;
    private Random rand = new Random();

    public void testQueries() throws Exception {
        Model model = getTestModel();
        StackEvaluator eval = new LazyStackEvaluator();
        QueryEngine qe = new QueryEngine(model, eval, System.out, System.err);
        Collector<RippleList> expected = new Collector<RippleList>();
        Collector<RippleList> results = new Collector<RippleList>();
        QueryPipe qp = new QueryPipe(qe, results);
View Full Code Here

        qp.close();
        //mc.close();
    }

    public void testFuzz() throws Exception {
        Model model = getTestModel();
        StackEvaluator eval = new LazyStackEvaluator();

        // Discard error output (of which there will be a lot).
        PrintStream errStream = new PrintStream(new NullOutputStream());
View Full Code Here

                    + "    rdf:first \"2\";\n"
                    + "    rdf:rest rdf:nil ];\n"
                    + ".";

    public void testCreateOperator() throws Exception {
        Model model = getTestModel();
        ModelConnection mc = model.createConnection();

        InputStream is = new ByteArrayInputStream(TEST_1.getBytes());
        RDFImporter importer = new RDFImporter(mc);
        SesameInputAdapter.parse(is, importer, "", RDFFormat.TURTLE);
        mc.commit();
View Full Code Here

/**
* @author Joshua Shinavier (http://fortytwo.net)
*/
public class NumericValueTest extends RippleTestCase {
    public void testValues() throws Exception {
        Model model = getTestModel();
        ModelConnection mc = model.createConnection();
        NumericValue l;

        // Create an integer literal.
        l = mc.valueOf(42);
        assertTrue(l instanceof NumericValue);
View Full Code Here

TOP

Related Classes of net.fortytwo.ripple.model.Model

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.