}\r
writer.println();\r
writer.println("L0 = <http://www.simantics.org/Layer0-1.1>");\r
+ writer.println("XML = <http://www.simantics.org/XML-1.0>");\r
writer.println();\r
writer.println(ontRoot + " = <" + ontologyName +"-"+ version+"> : L0.Ontology");\r
writer.println(" @L0.new");\r
\r
ontRoot += ".";\r
// TODO : these could be created in separate base ontology.\r
- writer.println(commentTag + " Built-in types");\r
- writer.println();\r
- writer.println(ontRoot+"XML : L0.Library");\r
- writer.println(ontRoot+"XML.hasAttribute <R L0.HasProperty");\r
- writer.println(ontRoot+"XML.hasID <R "+ontRoot+"XML.hasAttribute : L0.FunctionalRelation");\r
- writer.println(" --> L0.String");\r
- writer.println(ontRoot+"XML.ComplexType <T L0.Entity");\r
- writer.println(ontRoot+"XML.hasComplexType <R L0.IsComposedOf");\r
- writer.println(ontRoot+"XML.AttributeGroup <T L0.Entity");\r
- writer.println(ontRoot+"XML.Element <T L0.Entity");\r
- writer.println(ontRoot+"XML.hasElement <R L0.IsComposedOf");\r
- writer.println(ontRoot+"XML.ElementList <T L0.List");\r
- writer.println(ontRoot+"XML.hasElementList <R L0.IsComposedOf");\r
- writer.println(ontRoot+"XML.hasOriginalElementList <R " + ontRoot+"XML.hasElementList");\r
- writer.println(ontRoot+"XML.hasReference <R L0.IsRelatedTo");\r
- writer.println(ontRoot+"XML.hasExternalReference <R L0.IsRelatedTo");\r
- writer.println(" L0.InverseOf " + ontRoot+"XML.externalReferenceOf <R L0.IsRelatedTo");\r
- writer.println();\r
+// writer.println(commentTag + " Built-in types");\r
+// writer.println();\r
+// writer.println(ontRoot+"XML : L0.Library");\r
+// writer.println(ontRoot+"XML.hasAttribute <R L0.HasProperty");\r
+// writer.println(ontRoot+"XML.hasID <R "+ontRoot+"XML.hasAttribute : L0.FunctionalRelation");\r
+// writer.println(" --> L0.String");\r
+// writer.println(ontRoot+"XML.ComplexType <T L0.Entity");\r
+// writer.println(ontRoot+"XML.hasComplexType <R L0.IsComposedOf");\r
+// writer.println(ontRoot+"XML.AttributeGroup <T L0.Entity");\r
+// writer.println(ontRoot+"XML.Element <T L0.Entity");\r
+// writer.println(ontRoot+"XML.hasElement <R L0.IsComposedOf");\r
+// writer.println(ontRoot+"XML.ElementList <T L0.List");\r
+// writer.println(ontRoot+"XML.hasElementList <R L0.IsComposedOf");\r
+// writer.println(ontRoot+"XML.hasOriginalElementList <R " + ontRoot+"XML.hasElementList");\r
+// writer.println(ontRoot+"XML.hasReference <R L0.IsRelatedTo");\r
+// writer.println(ontRoot+"XML.hasExternalReference <R L0.IsRelatedTo");\r
+// writer.println(" L0.InverseOf " + ontRoot+"XML.externalReferenceOf <R L0.IsRelatedTo");\r
+// writer.println();\r
writer.println(ontRoot+"ComplexTypes : L0.Library");\r
writer.println(ontRoot+"AttributeGroups : L0.Library");\r
writer.println();\r
writer.print(" <R " + type);\r
}\r
} else {\r
- writer.print(" <R " + ontRoot+"XML.hasElement");\r
+ writer.print(" <R XML.hasElement");\r
}\r
\r
writer.println();\r
}\r
}\r
if (!single) {\r
- writer.println(ontRoot+name+ "List <T "+ontRoot+"XML.ElementList");\r
+ writer.println(ontRoot+name+ "List <T XML.ElementList");\r
if (types.size() == 0) {\r
- writer.println(relationName+ "List <R "+ontRoot+"XML.hasElementList : L0.FunctionalRelation");\r
+ writer.println(relationName+ "List <R XML.hasElementList : L0.FunctionalRelation");\r
} else {\r
writer.print(relationName+ "List");\r
for (String type : types) {\r
writer.println(ontRoot+getName(parent)+".has"+refName + " <R " + ontRoot+ getName(obj,"has"));\r
writer.println(" --> " + ontRoot+getName(obj));\r
} else {\r
- writer.println(ontRoot+getName(parent)+".has"+refName + " <R " + ontRoot+"XML.hasElement");\r
+ writer.println(ontRoot+getName(parent)+".has"+refName + " <R XML.hasElement");\r
writer.println(" --> " + getType(refType));\r
}\r
\r
if (useElementList(parent, indicator,element, reference, refName, refType)) {\r
\r
if (type == null) {\r
- writer.println(ontRoot+getName(parent)+"."+refName + "List <T " + ontRoot+"XML.ElementList");\r
+ writer.println(ontRoot+getName(parent)+"."+refName + "List <T XML.ElementList");\r
writer.println(ontRoot+getName(parent)+".has"+refName + "List <R " + ontRoot+getName(obj,"has")+"List : L0.FunctionalRelation");\r
} else {\r
- writer.println(ontRoot+getName(parent)+"."+refName + "List <T " + ontRoot+"XML.ElementList");\r
- writer.println(ontRoot+getName(parent)+".has"+refName + "List <R " + ontRoot+"XML.hasElementList : L0.FunctionalRelation"); \r
+ writer.println(ontRoot+getName(parent)+"."+refName + "List <T XML.ElementList");\r
+ writer.println(ontRoot+getName(parent)+".has"+refName + "List <R XML.hasElementList : L0.FunctionalRelation"); \r
}\r
}\r
}\r
writer.println(ontRoot+getName(parent)+".has"+refName + " <R " + ontRoot+ getName(obj,"has"));\r
writer.println(" --> " + ontRoot+getName(obj));\r
if (useElementList(parent, indicator,element, reference, refName, new QName(obj.getName()))) {\r
- writer.println(ontRoot+getName(parent)+"."+refName + "List <T " + ontRoot+"XML.ElementList");\r
+ writer.println(ontRoot+getName(parent)+"."+refName + "List <T XML.ElementList");\r
writer.println(ontRoot+getName(parent)+".has"+refName + "List <R " + ontRoot+getName(obj,"has")+"List : L0.FunctionalRelation");\r
}\r
}\r
relationName = ontRoot+"has"+name;\r
if (parent != null)\r
relationName = ontRoot+getName(parent)+".has"+name;\r
- relationType = ontRoot+"XML.hasAttribute";\r
+ relationType = "XML.hasAttribute";\r
}\r
else if (ref != null && parent != null) {\r
relationName = ontRoot+getName(parent)+".has"+ref.getLocalPart();\r
if (ontType != null) {\r
id = getTypeEntry(primitiveType).id;\r
if (id)\r
- relationType = ontRoot+"XML.hasID";\r
+ relationType = "XML.hasID";\r
} else {\r
\r
}\r
protected void handle(SchemaObject parent, AttributeGroup attributeGroup) {\r
if (parent == null) {\r
NamedAttributeGroup group = (NamedAttributeGroup)attributeGroup;\r
- writer.println(ontRoot+getAttributeGroupPrefix()+group.getName()+ " <T " + ontRoot +"XML.AttributeGroup");\r
+ writer.println(ontRoot+getAttributeGroupPrefix()+group.getName()+ " <T XML.AttributeGroup");\r
SchemaObject obj = new SchemaObject(parent,attributeGroup);\r
for (Annotated annotated : group.getAttributeOrAttributeGroup()) {\r
if (annotated instanceof Attribute) {\r
if (parent != null)\r
relationName = ontRoot+getName(parent)+".has"+name;\r
\r
- writer.println(relationName+ " <R "+ontRoot+"XML.hasAttribute : L0.FunctionalRelation");\r
+ writer.println(relationName+ " <R XML.hasAttribute : L0.FunctionalRelation");\r
\r
String ontType = getL0Type(base);\r
writer.println(" --> " + ontType);\r
\r
String relationName = ontRoot+getName(topLevelComplexType,"has");//ontRoot+"has"+name;\r
\r
- writer.println(relationName+ " <R "+ontRoot+"XML.hasComplexType");\r
- writer.println(relationName+ "List <R "+ontRoot+"XML.hasElementList");\r
+ writer.println(relationName+ " <R XML.hasComplexType");\r
+ writer.println(relationName+ "List <R XML.hasElementList");\r
//writer.println(" --> " + ontRoot+getComplexTypePrefix()+name);\r
writer.println(" --> " + ontRoot+name);\r
writer.println();\r
- String baseType = ontRoot+"XML.ComplexType";\r
+ String baseType = "XML.ComplexType";\r
\r
QName base = getComplexTypeBase(topLevelComplexType.getComplexType());\r
if (base != null) {\r
// if (parent != null)\r
// name = parent +"_"+name;\r
\r
- String type = ontRoot+"XML.Element";\r
+ String type = "XML.Element";\r
Set<String> types = new LinkedHashSet<String>();\r
if (element.getType() != null) {\r
types.add(getType(element.getType()));\r
// //relationName = ontRoot+getComplexTypePrefix()+"has"+name.substring(getComplexTypePrefix().length());\r
// relationName = ontRoot+getName(elementObj.getParent()) + "has"+element.getName();\r
// }\r
- writer.println(relationName+ " <R "+ontRoot+"XML.hasElement");\r
- writer.println(relationName+ "List <R "+ontRoot+"XML.hasElementList");\r
+ writer.println(relationName+ " <R XML.hasElement");\r
+ writer.println(relationName+ "List <R XML.hasElementList");\r
\r
writer.println(ontRoot+name+ " <T "+type);\r
\r
List<IDReference> references = getIDReferences(element);\r
\r
for (IDReference ref : references) {\r
- writer.println(ontRoot+name+"."+ref.getReference().getName()+ " <R " +ontRoot+"XML.hasReference");\r
+ writer.println(ontRoot+name+"."+ref.getReference().getName()+ " <R XML.hasReference");\r
}\r
\r
writer.println();\r