// include no more than cardinality restrictions for referenced attributes
if (!this.equals(def)) return;
OntProperty property = xs.ont.createOntProperty(uri);
Resource range = null;
simpleType s = def.simpleType;
if (s==null) s = ctx.getSimpleType(type);
if (s!=null) {
s.defineType(property,ctx);
range = s.toOWL(ctx);
}
else {
// default attribute type
if (type==null) type = schema.anySimpleType;
schema.defineType(property,type);
range = schema.toOWL(xs.ont,type);
// ecore extensions
if (ecore!=null) ecore.toOWL(getModel(), uri, rest, get_node(), type, ctx);
}
// remove all evidence of an ID attribute
if (range!=null && schema.isID(range)) property.remove();
// Don't bother to add a range restriction only for it to be cleaned up afterwards (noRest)
if (range!=null && rest!=null && !noRest && !schema.isID(range))
rest.addRange(uri, range);
// global attribute closure
if (property.getRange()==null && ctx.isGlobalAttribute(def)
&& ctx.isClosed() && range!=null && !schema.ID.equals(range.getURI())) {
property.setRange(range);
}
if (noRest) rest.cleanup(xs.ont,uri);