Examples of Literal


Examples of org.teiid.language.Literal

        return Arrays.asList(langFactory.createSearchedCaseExpression(cases, function, TypeFacility.RUNTIME_TYPES.STRING));
    }
   
    public static boolean isNotNull(Expression expr) {
      if (expr instanceof Literal) {
        Literal literal = (Literal)expr;
        return literal.getValue() != null;
      }
      if (expr instanceof Function) {
        Function function = (Function)expr;
        if (function.getName().equalsIgnoreCase("NVL") || function.getName().equalsIgnoreCase(SourceSystemFunctions.IFNULL)) { //$NON-NLS-1$
          return isNotNull(function.getParameters().get(1));
View Full Code Here

Examples of org.wikier.trioo.jtrioo.annotations.Literal

      } else {
        DynamicRdfProperty dynPropertyResource = annotatedElement.getAnnotation(DynamicRdfProperty.class);
        if (dynPropertyResource != null) {
          extractProperty(resource, field.getName(), TypeHelper.getType(field), dynPropertyResource);
        } else {
          Literal literal = annotatedElement.getAnnotation(Literal.class);
          if (literal != null) {
            extractLiteral(resource, field.getName(), TypeHelper.getType(field), literal);
          } else {
            //nothing to do...?
          }
        }
      }
    }
   
    //properties on methods
    for (Method method : resourceClass.getMethods()) {
      AnnotatedElement annotatedMethod = (AnnotatedElement) method;
      RdfProperty propertyResource = annotatedMethod.getAnnotation(RdfProperty.class);
      if (propertyResource != null) {
        extractProperty(resource, IntrospectionHelper.getAffectedAttribute(method), TypeHelper.getType(method), propertyResource);
      } else {
        DynamicRdfProperty dynPropertyResource = annotatedMethod.getAnnotation(DynamicRdfProperty.class);
        if (dynPropertyResource != null) {
          extractProperty(resource, IntrospectionHelper.getAffectedAttribute(method),  TypeHelper.getType(method), dynPropertyResource);
        } else {
          Literal literal = annotatedMethod.getAnnotation(Literal.class);
          if (literal != null) {
            extractLiteral(resource, IntrospectionHelper.getAffectedAttribute(method), TypeHelper.getType(method), literal);
          } else {
            //nothing to do...
          }
View Full Code Here

Examples of org.wikier.trioo.jtrioo.rdf.Literal

      //FIXME: cascade
    } else {
      if (obj.toString().startsWith("http://") || obj.toString().startsWith("mailto:")) {
        this.query.addTriplePattern(new TriplePattern(subject, arc.getProperty(), new URIRef(obj.toString())));
      } else {
        this.query.addTriplePattern(new TriplePattern(subject, arc.getProperty(), new Literal(obj, arc.getLang(), arc.getDatatype())));
      }
    }
  }
View Full Code Here

Examples of pddl4j.exp.Literal

      logger.finest("\n--> Init\n");
     
      for(InitEl init: this.pddlObject.getInit()){
        logger.finest(init.toString());
        boolean negated = false;
        Literal p = null;

        if(init instanceof NotAtomicFormula){
          p = (NotAtomicFormula) init;
          negated = true;
        } else p = (AtomicFormula) init;
        PropositionImpl proposition = new PropositionImpl(!negated, p.getPredicate());
        Iterator variables = p.iterator();
       
        List<Term> terms = new ArrayList<Term>();
        while(variables.hasNext()){
          Constant var = (Constant) variables.next();
          Atom term = new Atom(var.getImage());
View Full Code Here

Examples of prefuse.data.expression.Literal

        // determine minimum and maximum values
        Object min = DataLib.min(m_tuples, m_field).get(m_field);
        Object max = DataLib.max(m_tuples, m_field).get(m_field);
       
        // set up predicate
        Literal left = Literal.getLiteral(min, m_type);
        Literal right = Literal.getLiteral(max, m_type);
        ColumnExpression ce = new ColumnExpression(m_field);
        RangePredicate rp = new RangePredicate(ce, left, right);
        setPredicate(rp);
    }
View Full Code Here

Examples of railo.transformer.bytecode.Literal

   */
  public String getHint() {
    if(hint==null) {
      Attribute attr = params.remove("hint");
      if(attr!=null) {
        Literal lit=(Literal) attr.getValue();
        hint=lit.getString().trim();
      }
      else {
        hint=DocCommentTransformer.unwrap(tmpHint.toString());
      }
    }
View Full Code Here

Examples of spark.api.rdf.Literal

      sl.add(new HashMap<String,RDFNode>());
    }
   
    NamedNode uriRef = new NamedNodeImpl(URI.create("http://example.org/test"));
    BlankNode bn = new BlankNodeImpl("1");
    Literal lit = new PlainLiteralImpl("foo");
   
    sl.get(0).put(var, uriRef);
    sl.get(1).put(var, bn);
    sl.get(2).put(var, lit);
    sl.get(3).put(var, new PlainLiteralImpl(A_DATE_TIME));
View Full Code Here

Examples of steal.examples.expression.model.Literal

    result.setOperand(e);
    return result;
  }

  protected Literal L(double value) {
    Literal result=f.createLiteral();
    result.setValue(value);
    return result;
   
  }
View Full Code Here

Examples of weka.associations.tertius.Literal

  private Predicate buildPredicate(Instances instances,
           Attribute attr, boolean isClass)
    throws Exception {

    Predicate predicate; /* The result. */
    Literal lit;
    Literal negation;
    boolean missingValues; /* Missing values for this attribute ? */
    boolean individual = (m_parts != null); /* Individual-based learning ? */
    int type = (instances == m_parts)
      ? IndividualLiteral.PART_PROPERTY
      : IndividualLiteral.INDIVIDUAL_PROPERTY; /* Type of property. */

    if (attr.isNumeric()) {
      throw new Exception("Can't handle numeric attributes!");
    }
 
    missingValues = instances.attributeStats(attr.index()).missingCount > 0;

    /* Build predicate. */
    if (individual) {
      predicate = new Predicate(instances.relationName() + "." + attr.name(),
        attr.index(), isClass);
    } else {
      predicate = new Predicate(attr.name(), attr.index(), isClass);
    }
 
    if (attr.numValues() == 2
  && (!missingValues || m_missing == EXPLICIT)) {
      /* Case of two values.
       * If there are missing values, this case is treated like other cases.
       */
      if (individual) {
  lit = new IndividualLiteral(predicate, attr.value(0), 0,
            Literal.POS, m_missing, type);
  negation = new IndividualLiteral(predicate, attr.value(1), 1,
           Literal.POS, m_missing, type);
      } else {
  lit = new AttributeValueLiteral(predicate, attr.value(0), 0,
          Literal.POS, m_missing);
  negation = new AttributeValueLiteral(predicate, attr.value(1), 1,
               Literal.POS, m_missing);
      }
      lit.setNegation(negation);
      negation.setNegation(lit);
      predicate.addLiteral(lit);     
    } else {
      /* Case of several values. */
      for (int i = 0; i < attr.numValues(); i++) {
  if (individual) {
    lit = new IndividualLiteral(predicate, attr.value(i), i,
              Literal.POS, m_missing, type);
  } else {
    lit = new AttributeValueLiteral(predicate, attr.value(i), i,
            Literal.POS, m_missing);
  }
  if (m_negation != NONE) {
    if (individual) {
      negation = new IndividualLiteral(predicate, attr.value(i), i,
               Literal.NEG, m_missing, type);
    } else {
      negation = new AttributeValueLiteral(predicate, attr.value(i), i,
             Literal.NEG, m_missing);
    }
    lit.setNegation(negation);
    negation.setNegation(lit);
  }
  predicate.addLiteral(lit);
      }

      /* One more value if missing is significant. */
      if (missingValues && m_missing == SIGNIFICANT) {
  if (individual) {
    lit = new IndividualLiteral(predicate, "?", -1,
              Literal.POS, m_missing, type);
  } else {
    lit = new AttributeValueLiteral(predicate, "?", -1,
            Literal.POS, m_missing);
  }
  if (m_negation != NONE) {
    if (individual) {
      negation = new IndividualLiteral(predicate, "?", -1,
               Literal.NEG, m_missing, type);
    } else {
      negation = new AttributeValueLiteral(predicate, "?", -1,
             Literal.NEG, m_missing);
    }
    lit.setNegation(negation);
    negation.setNegation(lit);
  }
  predicate.addLiteral(lit);
      }
    }
    return predicate;
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.