From NeOn Wiki
|Developed by||Michael Gesmann|
|Current Version||[[current version:= <ask format="template" template="CurrentVersion" limit="1" searchlabel="" sort="version number" order="descending" default="no version available"> 1.x/XML Mapping *</ask>]]|
The plugin allows users of the Neon Toolkit
- to translate XML schema constructs into ontology classes, attributes and properties.
During import of XML schemas the user can choose between the two following modes:
- the order of XML elements within a parent element will not be preserved (simpler case with potential loss of information)
- the order of XML elements within a parent element will be preserved (more complex case, although order is preserved in the ontology, it might not be visualized on the basic Studio, because this requires extended functionality)
- to access data that is stored in XML documents
- statically during import process
- dynamically from a rule using the XML documents URL (only supported in the extended version where rules can be executed)
The following constraints need to be considered:
- XML schema distinguishes between attribute, element and type namesets. Within a set all names are unique, but names are not unique across these sets. For the ontology it is necessary to have different names for attribute/elements/types with the same name. Therefore, the mapping process transforms names as described below.
- Mapping attributes
- XML attributes will be mapped to datatype properties.
- XML attribute names receive a '@' character as prefix in the generated datatype property name.
- Facets of XML type definitions will not be mapped.
- FLogic does not support the full set of XML schema types, thus the appropriate more general FLogic type will be used.
- Mapping elements
- XML simple typed elements will be mapped to datatype properties.
- Globally defined elements that need to be mapped will be mapped to classes.
- Mapping types
- Complex types will be mapped to classes.
- Generated class names will have "_type" postfix for mapped type names.
- For anonymous XML types, a unique name is generated that contains the name that had been generated for the surrounding type.
- Each XML schema addresses exactly one target namespace. When making use of other namespaces, these can be imported. The XML importer creates separate ontologies for each of these target namespaces. The target namespace serves as ontology name. However, namespace imports can only be resolved when import statements in the XML schema specify the schemaLocation attribute.
- With many globally defined and referenced elements and types the resulting ontology may become extremly large. Therefore, the import wizard asks for a starting point, i.e. a globally defined element. XML documents to be imported need to have a root element of the select start element.
Basically, the XML import works like any other ontology import. Choose "Import..." from File menu or context menu. From dialog choose "OntoStudio" folder and there select the "XML import" node.
Next dialog asks for the XML schema file to be imported and offers a checkbox where user can select that ordering of XML nodes shall be represented. Please note, that representation of node orders can be expressed in the ontology, but cannot yet be fully visualized in studio because it makes use of parameterized properties. Users can proceed when clicking on the "Next" button.
Next dialog step asks for the project, where the generated ontologies are assigned to. Further, it asks for a root element, where the generation process shall start.
At this stage, the generation can be started when clicking on the "Finish" button. Optionally users can click on the "Next" button. In that case they can select an XML document to be imported.