Examples of Literal


Examples of aima.core.logic.fol.kb.data.Literal

  // Note: To support FOL-FC-Ask
  public Set<Map<Variable, Term>> fetch(List<Literal> literals) {
    Set<Map<Variable, Term>> possibleSubstitutions = new LinkedHashSet<Map<Variable, Term>>();

    if (literals.size() > 0) {
      Literal first = literals.get(0);
      List<Literal> rest = literals.subList(1, literals.size());

      recursiveFetch(new LinkedHashMap<Variable, Term>(), first, rest,
          possibleSubstitutions);
    }
View Full Code Here

Examples of au.csiro.ontology.model.Literal

            String type = featureType.get(datatype[0]);

            String operatorId = datatype[1];
            String unitId = datatype[3];

            Literal value;
            if (type.equals("int")) {
                value = new IntegerLiteral(Integer.parseInt(datatype[2]));
            } else if (type.equals("float")) {
                value = new DecimalLiteral(new BigDecimal(datatype[2]));
            } else {
View Full Code Here

Examples of client.net.sf.saxon.ce.expr.Literal

        ResultDocument inst = new ResultDocument(href, methodExpression, getBaseURI(), this);

        Expression b = compileSequenceConstructor(exec, decl, iterateAxis(Axis.CHILD));
        if (b == null) {
            b = new Literal(EmptySequence.getInstance());
        }
        inst.setContentExpression(b);
        return inst;
    }
View Full Code Here

Examples of com.bacoder.parser.java.api.Literal

      }
    }

    LiteralContext literalContext = getChild(context, LiteralContext.class);
    if (literalContext != null) {
      Literal literal = createNode(context, Literal.class);

      TerminalNode terminal = getChild(literalContext, TerminalNode.class);
      if (terminal != null && LITERAL_TYPE_MAP.containsKey(terminal.getSymbol().getType())) {
        literal.setType(LITERAL_TYPE_MAP.get(terminal.getSymbol().getType()));
        literal.setText(terminal.getText());
      }

      return literal;
    }
View Full Code Here

Examples of com.bpodgursky.jbool_expressions.Literal

  @Override
  public Expression<K> applyInternal(Not<K> input) {
    Expression<K> e = input.getE();

      if(e instanceof Literal){
        Literal l = (Literal) e;
        return Literal.of(!l.getValue());
      }

      if(e instanceof Not){
        Not<K> internal = (Not<K>) e;
        return internal.getE();
View Full Code Here

Examples of com.damnhandy.uri.template.Literal

         }
         // in the case that we have back to back expressions ({foo}{?bar}), we can get into a state
         // we started capturing a literal but never actually collected anything yet.
         if(buffer != null)
         {
            components.add(new Literal(buffer.toString(), startPosition));
            literalCaptureOn = false;
            buffer = null;
         }
        
      }
View Full Code Here

Examples of com.facebook.presto.sql.tree.Literal

            QualifiedNameReference reference = extractReference(comparison);
            Symbol symbol = Symbol.fromQualifiedName(reference.getName());

            ConnectorColumnHandle column = symbolToColumnName.get(symbol);
            if (column != null) {
                Literal literal = extractLiteral(comparison);

                Object value;
                if (literal instanceof DoubleLiteral) {
                    value = ((DoubleLiteral) literal).getValue();
                }
                else if (literal instanceof LongLiteral) {
                    value = ((LongLiteral) literal).getValue();
                }
                else if (literal instanceof StringLiteral) {
                    value = ((StringLiteral) literal).getValue();
                }
                else if (literal instanceof BooleanLiteral) {
                    value = ((BooleanLiteral) literal).getValue();
                }
                else {
                    throw new AssertionError(String.format("Literal type (%s) not currently handled", literal.getClass().getName()));
                }

                // if there is a different constant value already bound for this column, the expression will always be false
                Object previous = bindings.get(column);
                if (previous != null && !previous.equals(value)) {
View Full Code Here

Examples of com.google.caja.parser.js.Literal

  private static class LitVal {
    final Object canonValue;
    final List<AncestorChain<Literal>> uses = Lists.newArrayList();

    LitVal(AncestorChain<Literal> useAc) {
      Literal use = useAc.node;
      canonValue = use instanceof StringLiteral
          ? ((StringLiteral) use).getUnquotedValue() : use.getValue();
    }
View Full Code Here

Examples of com.google.eclipse.protobuf.protobuf.Literal

  // enum Status {
  //   DRAFT = 0;
  //   READY = 1;
  // }
  @Test public void should_find_closest_type_possible() {
    Literal active = xtext.find("ACTIVE", " = 0", Literal.class);
    MessageField field = xtext.find("status", MessageField.class);
    ComplexTypeLink link = (ComplexTypeLink) field.getType();
    IScope scope = scopeProvider.scope_ComplexTypeLink_target(link, reference);
    EObject status = descriptionsIn(scope).objectDescribedAs("Status");
    assertSame(active.eContainer(), status);
  }
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.Literal

    Resource assertion = metaModel.createResource();
    assertion.addProperty(METAMODEL.asserter, metaModel
        .createResource(source.getURIRef()));
    Calendar calendar = Calendar.getInstance();
    calendar.setTime(moment);
    Literal momentLit = metaModel.createTypedLiteral(new XSDDateTime(
        calendar));
    /*
     * Literal momentLit = metaModel.createTypedLiteral( new
     * MillisDateFormat().format(moment), XSDDatatype.XSDdateTime);
     */
 
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.