Package com.hp.gloze

Examples of com.hp.gloze.XMLBean


  private XMLBean get_type(Context ctx) {
    populate();
    if (complexType != null) return complexType;
    if (simpleType != null) return simpleType;
    // is the type pre-resolved
    XMLBean b = ctx.getType(this);
    if (b!=null) return b;
    if (type!=null) {
      String uri = expandQName(ctx.getDefaultNS(),type,ctx.getModel());
      if (!uri.startsWith(schema.XSD_URI)) {
        b = ctx.getComplexType(uri);
View Full Code Here


        else stmt = schema.toRDFStatement(subject, elem, prop, value, type, ctx);
      }
    }

    // user defined simple type
    XMLBean t = def.get_type(ctx);
    if (t instanceof simpleType) {
      // an empty, as opposed to nil, element is null
      if (value==null) value = "";
      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

       && (rdf.equals(RDF.nil) || ((Resource)rdf).hasProperty(RDF.value,RDF.nil))) {
        e.setAttributeNS(schema.XSI, "xsi:nil", "true");
      }
    }
    String type = expandQName(ctx.getDefaultNS(),def.getType(),m);
    XMLBean t = def.get_type(ctx)
    if (type!=null && type.startsWith(schema.XSD_URI)) {
      try {
        if (type.endsWith("#ID") ||
          type.endsWith("#IDREF") ||
          type.endsWith("#IDREFS") ||
View Full Code Here

 
  public boolean needSeq(Set<String> names, Context ctx) {
    try {
      if (base!=null) {
        //complexType c = xsd.getGlobalComplexType(base, ctx);
        XMLBean b = get_baseType(ctx.getModel(),ctx); // extension of base
        if (b instanceof simpleType) return false;
        complexType c = (complexType) b;
        if (c!=null && c.needSeq(names,ctx)) return true
      }
      return super.needSeq(names,ctx);
View Full Code Here

    ctx.putBase(this,get_baseType(ctx.getModel(),ctx));
    super.resolve(model, ctx);
  }
 
  private XMLBean get_baseType(Model model,Context ctx) {
    XMLBean b = ctx.getBase(this);
    if (b!=null) return b;
    if (base!=null) {
      String uri = expandQName(ctx.getDefaultNS(),base,model);
      if (!uri.startsWith(schema.XSD_URI)) {
        b = ctx.getComplexType(uri);
View Full Code Here

  public void toOWLComplexContent(Resource cls, Restrictions rest, Context ctx) {   
    schema xs = (schema) this.get_owner();
    // tally restrictions in base type
    Resource range = null;
   
    XMLBean b = get_baseType(xs.ont,ctx);   
    if (b!=null && b instanceof complexType)
      range = ((complexType) b).toOWL(rest,false,ctx);
    else { // schema datatype
      String t = expandQName(ctx.getDefaultNS(),base, xs.ont);
      if (t!=null && rest!=null && schema.isValidDatatype(t)) {
View Full Code Here

  }

  public void toOWLSimpleContent(Resource cls, Restrictions rest, Context ctx) {   
    schema xs = (schema) this.get_owner();
    // tally restrictions in base type
    XMLBean b = get_baseType(xs.ont,ctx); // extension of base type
    Resource range = null;
   
    if (b!=null && b instanceof complexType)
      range = ((complexType) b).toOWL(rest,false,ctx);
   
View Full Code Here

   */
 
  public void subClass(Resource c, schema.type type, Context ctx) {
    OntModel ont = (OntModel) c.getModel();
    Resource superclass = null;
    XMLBean b = get_baseType(ont,ctx);
   
    if (b!=null && b instanceof simpleType)
      superclass = ((simpleType) b).toOWL(ctx);
    else if (b!=null && b instanceof complexType)
      superclass = ((complexType) b).toOWL(null,true,ctx);
View Full Code Here

        break;
      case Node.ELEMENT_NODE:
        // run through the choices
        for (int x=0; x < _any.size(); x++) {
          int i = index;
          XMLBean b = (XMLBean) _any.elementAt(x);
          index = b.toRDF(subject, node, index, seq, mixed, ctx);
          if (i<index) {
            occurs++;
            continue next;
          }
        }
View Full Code Here

    // consume mixed values, so this doesn't occur repeatedly in every branch
    while (occurs<max) {
      index = produceMixed(rdf.getModel().getSeq(rdf),index,element);
      int x = index;
      for (int i = 0; _any != null && i < _any.size() && x==index; i++) {
        XMLBean bean = (XMLBean) _any.elementAt(i);
        if (bean instanceof element) {
          index = ((element) bean).toXML(element, rdf, index, pending, ctx);
        } else if (bean instanceof any) { // any remaining
          index = ((any) bean).toXML(element, rdf, index, pending, ctx);
        } else if (bean instanceof choice) {
View Full Code Here

TOP

Related Classes of com.hp.gloze.XMLBean

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.