Package org.apache.clerezza.rdf.core.sparql.query

Examples of org.apache.clerezza.rdf.core.sparql.query.LiteralExpression


    SimpleBasicGraphPattern bgp = new SimpleBasicGraphPattern(triplePatterns);
    SimpleGroupGraphPattern queryPattern = new SimpleGroupGraphPattern();
    queryPattern.addGraphPattern(bgp);
    BinaryOperation constraint = new BinaryOperation("<",
        price, new LiteralExpression(LiteralFactory.getInstance().createTypedLiteral(30.5)));
    queryPattern.addConstraint(constraint);
    selectQuery.setQueryPattern(queryPattern);

    Assert.assertTrue(selectQuery.toString()
        .replaceAll("( |\n)+", " ").trim().equals(queryString));
View Full Code Here


    SimpleGroupGraphPattern queryPattern = new SimpleGroupGraphPattern();
    queryPattern.addGraphPattern(bgp);

    List<Expression> arguments = new ArrayList<Expression>();
    arguments.add(x);
    arguments.add(new LiteralExpression(LiteralFactory.getInstance().
        createTypedLiteral(".*uni.*")));
    BuiltInCall constraint = new BuiltInCall("REGEX", arguments);
    queryPattern.addConstraint(constraint);
    selectQuery.setQueryPattern(queryPattern);
    Assert.assertTrue(selectQuery.toString()
View Full Code Here

        }

        if (number.startsWith(Symbols.variablesPrefix)) {
            exp = new Variable(number.replace(Symbols.variablesPrefix, ""));
        } else {
            exp = new LiteralExpression(LiteralFactory.getInstance().createTypedLiteral(number));
        }

        return (T) new ClerezzaSparqlObject(exp);
    }
View Full Code Here

        }

        if (string.startsWith(Symbols.variablesPrefix)) {
            exp = new Variable(string.replace(Symbols.variablesPrefix, ""));
        } else {
            exp = new LiteralExpression(new PlainLiteralImpl(string));
        }

        return (T) new ClerezzaSparqlObject(exp);
    }
View Full Code Here

            literal = LiteralFactory.getInstance().createTypedLiteral(number);
        } else {
            throw new org.apache.stanbol.rules.base.api.RuleAtomCallExeption(getClass());
        }

        LiteralExpression literalExpression = new LiteralExpression(literal);

        return (T) new ClerezzaSparqlObject(literalExpression);

    }
View Full Code Here

        SimpleBasicGraphPattern bgp = new SimpleBasicGraphPattern(triplePatterns);
        SimpleGroupGraphPattern queryPattern = new SimpleGroupGraphPattern();
        queryPattern.addGraphPattern(bgp);
        BinaryOperation constraint = new BinaryOperation("<",
                price, new LiteralExpression(LiteralFactory.getInstance().createTypedLiteral(30.5)));
        queryPattern.addConstraint(constraint);
        selectQuery.setQueryPattern(queryPattern);

        Assert.assertTrue(selectQuery.toString()
                .replaceAll("( |\n)+", " ").trim().equals(queryString));
View Full Code Here

        SimpleGroupGraphPattern queryPattern = new SimpleGroupGraphPattern();
        queryPattern.addGraphPattern(bgp);

        List<Expression> arguments = new ArrayList<Expression>();
        arguments.add(x);
        arguments.add(new LiteralExpression(LiteralFactory.getInstance().
                createTypedLiteral(".*uni.*")));
        BuiltInCall constraint = new BuiltInCall("REGEX", arguments);
        queryPattern.addConstraint(constraint);
        selectQuery.setQueryPattern(queryPattern);
        Assert.assertTrue(selectQuery.toString()
View Full Code Here

TOP

Related Classes of org.apache.clerezza.rdf.core.sparql.query.LiteralExpression

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.