Package com.hp.hpl.jena.sparql.expr

Examples of com.hp.hpl.jena.sparql.expr.E_LangMatches


   
    NodeRelation label_fr_be = search("table1", "label_fr_be", rels);
    NodeRelation label_en = search("table1", "label_en", rels);
    NodeRelation label = search("table1", "label", rels);
   
    Expr filterFR    = new E_LangMatches(new E_Lang(new ExprVar("o")), NodeValue.makeString("fr"));
    Expr filterEN    = new E_LangMatches(new E_Lang(new ExprVar("o")), NodeValue.makeString("en"));
    Expr filterFR_BE = new E_LangMatches(new E_Lang(new ExprVar("o")), NodeValue.makeString("fr-BE"));
    Expr filterALL   = new E_LangMatches(new E_Lang(new ExprVar("o")), NodeValue.makeString("*"));
   
    assertEquals("LANGMATCHES(LANG(label_fr_be), \"fr\") should be TRUE",   Expression.TRUE,  TransformExprToSQLApplyer.convert(filterFR, label_fr_be));
    assertEquals("LANGMATCHES(LANG(label_en), \"fr\") should be FALSE",     Expression.FALSE, TransformExprToSQLApplyer.convert(filterFR, label_en));
    assertEquals("LANGMATCHES(LANG(label_en), \"en\") should be TRUE",      Expression.TRUE,  TransformExprToSQLApplyer.convert(filterEN, label_en));
    assertEquals("LANGMATCHES(LANG(label_fr_BE, \"fr_BE\") should be TRUE", Expression.TRUE , TransformExprToSQLApplyer.convert(filterFR_BE, label_fr_be));
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.sparql.expr.E_LangMatches

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.