Examples of createLiteral()


Examples of com.caucho.quercus.expr.ExprFactory.createLiteral()

              Optional opt = (Optional) ann;

              if (opt.value().equals(Optional.NOT_SET))
                _defaultExprs[i] = exprFactory.createDefault();
              else if (opt.value().equals("")) {
                _defaultExprs[i] = exprFactory.createLiteral(StringValue.EMPTY);
              }
              else {
                _defaultExprs[i] = QuercusParser.parseDefault(exprFactory, opt.value());
              }
            } else if (Reference.class.isAssignableFrom(ann.annotationType())) {
View Full Code Here

Examples of com.hp.hpl.jena.ontology.OntModel.createLiteral()

    OntModel model = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC );

    Resource C = model.createClass( ns + "C" );
    Resource i = model.createResource( ns + "i" );
    Resource j = model.createResource( ns + "j" );
    Literal k = model.createLiteral( "k" );
    Property p = model.createDatatypeProperty( ns + "p" );
    RDFList list = model.createList( new RDFNode[] { p } );

    model.add( C, OWL2.hasKey, list );
    model.add( i, RDF.type, C );
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.Model.createLiteral()

  public static void textToRDF(Resource subject, Seq seq, Node n, Context ctx) {
    String value = ((Text) n).getNodeValue();
    value = processWhitespace(n,value,null,ctx);
    if (!value.equals("")) {
      Model m = ctx.getModel();
      Literal lit = m.createLiteral(value);
      Statement stmt = m.createStatement(subject, RDF.value, lit);
      m.add(stmt);
      if (seq!=null) seq.add(stmt.createReifiedStatement());
    }
  }
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.Model.createLiteral()

    }
    else if (type!=null && type.equals(XSD_URI+"#anySimpleType")) {
      object = m.createTypedLiteral(value==null?"":value,dt);
    }
    else if (RDFS.Literal.getURI().equals(type)) {
      object = m.createLiteral(value==null?"":value);
    }
    else if (value!=null && dt!=null && dt.isValid(value)) object = m.createTypedLiteral(value, dt);
    else object = m.createLiteral(value==null?"":value);
   
    if (object==null) return false;
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.Model.createLiteral()

    }
    else if (RDFS.Literal.getURI().equals(type)) {
      object = m.createLiteral(value==null?"":value);
    }
    else if (value!=null && dt!=null && dt.isValid(value)) object = m.createTypedLiteral(value, dt);
    else object = m.createLiteral(value==null?"":value);
   
    if (object==null) return false;
    // if no property is supplied just add the value to the sequence/list
    if (prop==null && seq!=null) seq.add(object);
    else  {
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.Model.createLiteral()

        uri = resolveBase(node, new URI(value), ctx);
      if (uri!=null) object = m.createTypedLiteral(uri.toString(),dt);
      else return null;
    }
    else if (value!=null && dt!=null && dt.isValid(value)) object = m.createTypedLiteral(value, dt);
    else object = m.createLiteral(value==null?"":value);
   
    // add the value to the list
    if (list.isEmpty()) list = ctx.getModel().createList(new RDFNode[] {object});
    else list.add(object);
    return list;   
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.Model.createLiteral()

    if (restriction != null)
      return restriction.toRDF(subject, node, getValue(e), RDF.value, null, null, ctx);
    else if (extension != null)
      return extension.toRDF(subject, e, RDF.value, null, ctx);
    else {// otherwise just add plain literal
      Literal l = model.createLiteral(schema.processWhitespace(node,getValue(e),null,ctx));
      subject.addProperty(RDF.value, l);
      return true;
    }     
  }
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.Model.createLiteral()

      int index = ((complexType) t).toRDF(o, elem, 0, subSeq, null,true,ctx);
      // mop up remaining values in sequence
      produceMixed(subSeq, index, elem);
    }
    else if (value!=null && stmt==null){ // untyped!
      Literal l = m.createLiteral(schema.processWhitespace(elem,value,null,ctx));
      stmt = m.createStatement(subject,prop,l);     
    }
    else if (type==null){ // empty
      if (is_nillable() && elem.hasAttributeNS(schema.XSI,"nil") && elem.getAttributeNS(schema.XSI,"nil").equals("true"))
        stmt = m.createStatement(subject,prop,RDF.nil);
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.Model.createLiteral()

          break;
        case Node.TEXT_NODE:
          String value = ((Text) nl.item(i)).getNodeValue().trim();
          Literal lit = null;
          if (elem.hasAttributeNS(XML,"lang"))
            lit = m.createLiteral(value, elem.getAttributeNS(XML,"lang"));
          else
            lit = ctx.getModel().createLiteral(value);
         
          stmt = ctx.getModel().createStatement(obj,RDF.value,lit);
          if (!value.equals("")) {
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.Model.createLiteral()

    else { // looks like a simple type
      String value = XMLBean.getValue(elem);
      if (value!=null && ctx.isPreserved()) value = value.trim();
      if (value==null) value = "";
     
      Literal l =  m.createLiteral(value);
      stmt = m.createStatement(subject,prop,l);     
      m.add(stmt);
      if (seq != null && stmt!=null) seq.add(stmt.createReifiedStatement());     
      return true;
    }
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.