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

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


   
    NodeRelation label_fr_be  = search("table1", "label_fr_be", rels);
    NodeRelation label_en     = search("table1", "label_en", rels);
    NodeRelation label_noLang = search("table1", "label", rels);
   
    Expr filterFR    = new E_Equals(new E_Lang(new ExprVar("o")), NodeValue.makeString("fr"));
    Expr filterEN_TAG_EN = new E_Equals(new E_Lang(new ExprVar("o")), NodeValue.makeNode("en", "en", (String) null));
    Expr filterFR_BE = new E_Equals(new E_Lang(new ExprVar("o")), NodeValue.makeString("fr-BE"));
    Expr filter      = new E_Equals(new E_Lang(new ExprVar("o")), NodeValue.makeString(""));
   
    assertEquals("LANG(label_fr_be) = \"fr\" should be FALSE",   Expression.FALSE, TransformExprToSQLApplyer.convert(filterFR, label_fr_be));
    assertEquals("LANG(label_en) = \"fr\" should be FALSE",      Expression.FALSE, TransformExprToSQLApplyer.convert(filterFR, label_en));
    assertEquals("LANG(label_fr_be) = \"fr_be\" should be TRUE", Expression.TRUE,  TransformExprToSQLApplyer.convert(filterFR_BE, label_fr_be));
    assertEquals("LANG(label_en) = \"en\"@en should be FALSE",   Expression.FALSE, TransformExprToSQLApplyer.convert(filterEN_TAG_EN, label_en));
View Full Code Here


   
    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_Lang

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.