|
|
@@ -1,127 +0,0 @@
|
|
|
-// Warning: Generated code! Do not edit!
|
|
|
-// Input file: '{{file.filename}}'
|
|
|
-// Generator: https://msdl.uantwerpen.be/git/rparedis/DrawioConvert/src/library
|
|
|
-
|
|
|
-{%- macro point(p) -%}
|
|
|
-drawio:hasX {{p.x}}
|
|
|
-drawio:hasY {{p.y}}
|
|
|
-{%- endmacro -%}
|
|
|
-
|
|
|
-{%- macro write_cell(page_index, cell) %}
|
|
|
- {%- set cell_iri = "p"+(page_index|string)+"_cell_"+(cell.id|string) -%}
|
|
|
- ci {{cell_iri}} : drawio:{{cell.__class__.__name__}} [
|
|
|
- drawio:hasDrawioId {{cell.id|to_oml_string_literal}}
|
|
|
- {%- if cell.value != "" %}
|
|
|
- drawio:hasValue {{cell.value|to_oml_string_literal}}
|
|
|
- {%- endif %}
|
|
|
- {%- if cell.parent != None %}
|
|
|
- drawio:hasParent p{{page_index}}_cell_{{cell.parent.id}}
|
|
|
- {%- else %}
|
|
|
- drawio:isRootOf p{{page_index}}
|
|
|
- {%- endif %}
|
|
|
- object_diagram:inModel model
|
|
|
-
|
|
|
- {%- if cell.__class__.__name__ == "Vertex" %}
|
|
|
- drawio:hasVertexGeometry drawio:VertexGeometry [
|
|
|
- {{ point(cell.geometry)|indent(6) }}
|
|
|
- drawio:hasWidth {{cell.geometry.width}}
|
|
|
- drawio:hasHeight {{cell.geometry.height}}
|
|
|
- ]
|
|
|
- {% endif -%}
|
|
|
-
|
|
|
- {%- if cell.__class__.__name__ == "Edge" %}
|
|
|
- drawio:hasEdgeGeometry drawio:EdgeGeometry [
|
|
|
- {%- for p in cell.geometry.points -%}
|
|
|
- drawio:hasPoint drawio:PointListItem [
|
|
|
- drawio:hasListIndex {{loop.index0}}
|
|
|
- {{ point(p)|indent(8) }}
|
|
|
- ]
|
|
|
- {%- endfor %}
|
|
|
- {%- if cell.geometry.source_point != None %}
|
|
|
- drawio:hasSourcePoint drawio:Point [
|
|
|
- {{ point(cell.geometry.source_point)|indent(8) }}
|
|
|
- ]
|
|
|
- {%- endif %}
|
|
|
- {%- if cell.geometry.target_point != None %}
|
|
|
- drawio:hasTargetPoint drawio:Point [
|
|
|
- {{ point(cell.geometry.target_point)|indent(8) }}
|
|
|
- ]
|
|
|
- {%- endif %}
|
|
|
- ]
|
|
|
- {%- if cell.source %}
|
|
|
- drawio:hasSource p{{page_index}}_cell_{{cell.source.id}}
|
|
|
- {%- endif -%}
|
|
|
- {%- if cell.target %}
|
|
|
- drawio:hasTarget p{{page_index}}_cell_{{cell.target.id}}
|
|
|
- {%- endif -%}
|
|
|
- {%- endif %}
|
|
|
- ]
|
|
|
- {# Cell properties #}
|
|
|
- {%-for prop_key,prop_val in cell.properties.items() %}
|
|
|
- ci {{cell_iri}}_prop_{{prop_key}} : drawio:CellProperty [
|
|
|
- dict:hasKey {{prop_key|to_oml_string_literal}}
|
|
|
- dict:hasValue {{prop_val|to_oml_string_literal}}
|
|
|
- drawio:propertyOf {{cell_iri}}
|
|
|
- object_diagram:inModel model
|
|
|
- ]
|
|
|
- {%- endfor %}
|
|
|
- {# Cell style #}
|
|
|
- {%- for style_key,style_val in cell.style.data.items() %}
|
|
|
- ci {{cell_iri}}_sty_{{style_key}} : drawio:CellStyleEntry [
|
|
|
- dict:hasKey {{style_key|to_oml_string_literal}}
|
|
|
- dict:hasValue {{style_val|to_oml_string_literal}}
|
|
|
- drawio:styleEntryOf {{cell_iri}}
|
|
|
- object_diagram:inModel model
|
|
|
- ]
|
|
|
- {%- endfor %}
|
|
|
- {# Cell attributes #}
|
|
|
- {%- for attr_key,attr_val in cell.attributes.items() %}
|
|
|
- ci {{cell_iri}}_attr_{{attr_key}} : drawio:CellAttribute [
|
|
|
- dict:hasKey {{attr_key|to_oml_string_literal}}
|
|
|
- dict:hasValue {{attr_val|to_oml_string_literal}}
|
|
|
- drawio:attributeOf {{cell_iri}}
|
|
|
- object_diagram:inModel model
|
|
|
- ]
|
|
|
- {%- endfor %}
|
|
|
-
|
|
|
- {# Recursively write out children #}
|
|
|
- {%- for child in cell.children %}
|
|
|
- {{ write_cell(page_index, child) }}
|
|
|
- {%- endfor -%}
|
|
|
-{%- endmacro %}
|
|
|
-
|
|
|
-description <{{namespaces.description}}#> as {{namespaces.shorthand}} {
|
|
|
-
|
|
|
- uses <{{namespaces.drawio}}#> as drawio
|
|
|
- uses <{{namespaces.object_diagram}}#> as object_diagram
|
|
|
- uses <{{namespaces.dict}}#> as dict
|
|
|
-
|
|
|
- ci model : drawio:Model [
|
|
|
- drawio:isCompressed {{ "true" if file.compressed else "false"}}
|
|
|
- drawio:hasDrawioVersion {{file.version|to_oml_string_literal}}
|
|
|
- ]
|
|
|
-
|
|
|
- {# Pages #}
|
|
|
- {%- for page_index, page in enumerate(file.pages) %}
|
|
|
- ci p{{page_index}} : drawio:Page [
|
|
|
- drawio:ofModel model
|
|
|
- drawio:hasDrawioId {{page.id|to_oml_string_literal}}
|
|
|
- drawio:hasName {{page.name|to_oml_string_literal}}
|
|
|
- object_diagram:inModel model
|
|
|
- ]
|
|
|
-
|
|
|
- {%- for attr_key, attr_val in page.attributes.items() %}
|
|
|
- ci p{{page_index}}_a_{{attr_key}} : drawio:PageAttribute [
|
|
|
- dict:hasKey {{attr_key|to_oml_string_literal}}
|
|
|
- dict:hasValue {{attr_val|to_oml_string_literal}}
|
|
|
- drawio:ofPage p{{page_index}}
|
|
|
- object_diagram:inModel model
|
|
|
- ]
|
|
|
- {%- endfor %}
|
|
|
-
|
|
|
- {# Cells #}
|
|
|
- {{ write_cell(page_index, page.root) }}
|
|
|
-
|
|
|
- {%- endfor %}
|
|
|
-
|
|
|
-}
|