protected void handleSimpleType(SchemaObject parent, SchemaObject simpleTypeObj) {\r
SimpleType simpleType = simpleTypeObj.getSimpleType();\r
String name = simpleType.getName();\r
- Restriction restriction = simpleType.getRestriction();\r
- if (restriction == null || simpleType.getUnion() != null || simpleType.getId() != null)\r
- throw new RuntimeException();\r
- QName base = restriction.getBase();\r
- \r
- String relationName = ontRoot+"has"+name;\r
- if (parent != null)\r
- relationName = ontRoot+getName(parent)+".has"+name;\r
- \r
- writer.println(relationName+ " <R XML.hasAttribute : L0.FunctionalRelation");\r
\r
- String ontType = getL0Type(base);\r
- writer.println(" --> " + ontType);\r
+ org.w3._2001.xmlschema.List list = simpleType.getList();\r
+ if (list != null) {\r
+ // TODO : process restriction in lists\r
+ String relationName = ontRoot+"has"+name;\r
+ if (parent != null)\r
+ relationName = ontRoot+getName(parent)+".has"+name;\r
+ writer.println(relationName+ " <R XML.hasAttribute : L0.FunctionalRelation");\r
+ \r
+ String ontType = getL0Type(new QName(SCHEMA_NS, "string"));\r
+ writer.println(" --> " + ontType);\r
+ } else {\r
+ Restriction restriction = simpleType.getRestriction();\r
+ if (restriction == null || simpleType.getUnion() != null || simpleType.getId() != null)\r
+ throw new RuntimeException(simpleType.getName() + " restriction error");\r
+ QName base = restriction.getBase();\r
+ \r
+ String relationName = ontRoot+"has"+name;\r
+ if (parent != null)\r
+ relationName = ontRoot+getName(parent)+".has"+name;\r
+ \r
+ writer.println(relationName+ " <R XML.hasAttribute : L0.FunctionalRelation");\r
+ \r
+ String ontType = getL0Type(base);\r
+ writer.println(" --> " + ontType);\r
+ }\r
}\r
\r
@Override\r