diff --git a/CIMToolFeature/feature.xml b/CIMToolFeature/feature.xml index 85e93392..26bb082f 100644 --- a/CIMToolFeature/feature.xml +++ b/CIMToolFeature/feature.xml @@ -2,10 +2,10 @@ - + CIMTool is an open source tool for supporting the IEC Common Information Model (CIM) standards used in the electric power industry. @@ -69,7 +69,7 @@ info@healthmarketscience redistributed under the LGPL version 2.1. - + diff --git a/CIMToolHelp/META-INF/MANIFEST.MF b/CIMToolHelp/META-INF/MANIFEST.MF index 7a186a15..20806b44 100644 --- a/CIMToolHelp/META-INF/MANIFEST.MF +++ b/CIMToolHelp/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2 Automatic-Module-Name: au.com.langdale.cimtoole.help Bundle-Name: CIMTool Help Plug-in Bundle-SymbolicName: au.com.langdale.cimtoole.help;singleton:=true -Bundle-Version: 2.0.1 +Bundle-Version: 2.1.0 Bundle-ClassPath: CIMToolHelp Bundle-Vendor: Langdale Consultants Bundle-RequiredExecutionEnvironment: JavaSE-20 diff --git a/CIMToolHelp/html/CIMToolNamespaceSupport.html b/CIMToolHelp/html/CIMToolNamespaceSupport.html index c9708f70..4a773e64 100644 --- a/CIMToolHelp/html/CIMToolNamespaceSupport.html +++ b/CIMToolHelp/html/CIMToolNamespaceSupport.html @@ -80,7 +80,7 @@

Annotation File

The file can be edited with the eclipse text editor. (If an external text editor is used, the workspace must be manually refreshed afterwards.) -An example file to that can be used as a template is found here: http://files.cimtool.org/example.annotation.txt +An example file to that can be used as a template is found here: https://cimtool.ucaiug.io/how-to/example.annotation.txt

The file contains baseuri statements in the RDF TURTLE language. For example, the line: diff --git a/CIMToolPlugin/.classpath b/CIMToolPlugin/.classpath index 7c5fa1e7..a00f56f2 100644 --- a/CIMToolPlugin/.classpath +++ b/CIMToolPlugin/.classpath @@ -12,5 +12,6 @@ + diff --git a/CIMToolPlugin/META-INF/MANIFEST.MF b/CIMToolPlugin/META-INF/MANIFEST.MF index e2498d08..12fbba7c 100644 --- a/CIMToolPlugin/META-INF/MANIFEST.MF +++ b/CIMToolPlugin/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2 Automatic-Module-Name: au.com.langdale.cimtoole Bundle-Name: CIMTool Plug-in Bundle-SymbolicName: au.com.langdale.cimtoole;singleton:=true -Bundle-Version: 2.0.1 +Bundle-Version: 2.1.0 Bundle-RequiredExecutionEnvironment: JavaSE-20 Bundle-ClassPath: cimtoole.jar, lib/commons-logging-1.1.1.jar, diff --git a/CIMToolPlugin/build.properties b/CIMToolPlugin/build.properties index 9b88386f..1f347bee 100644 --- a/CIMToolPlugin/build.properties +++ b/CIMToolPlugin/build.properties @@ -7,7 +7,8 @@ bin.includes = builders/,\ lib/commons-io-2.5.jar,\ lib/commons-logging-1.1.1.jar,\ lib/joda-time-2.10.6.jar,\ - lib/gson-2.8.6.jar + lib/gson-2.8.6.jar,\ + native/ source.cimtoole.jar = src/ jars.compile.order = cimtoole.jar output.cimtoole.jar = bin/ diff --git a/CIMToolPlugin/builders/builders.json b/CIMToolPlugin/builders/builders.json index e6f7b30c..6980d19f 100644 --- a/CIMToolPlugin/builders/builders.json +++ b/CIMToolPlugin/builders/builders.json @@ -64,5 +64,23 @@ "style": "rdfs-2020", "datetime": "2024-01-30T00:00:00Z", "ext": "rdfs-2020.rdfs" + }, + "linkml": { + "type": "TRANSFORM", + "style": "linkml", + "datetime": "2024-07-29T00:00:00Z", + "ext": "linkml.yaml" + }, + "cimantic-graphs": { + "type": "TEXT", + "style": "cimantic-graphs", + "datetime": "2024-08-07T00:00:00Z", + "ext": "cimantic-graphs.py" + }, + "cimantic-graphs-init": { + "type": "TEXT", + "style": "cimantic-graphs-init", + "datetime": "2024-08-07T00:00:00Z", + "ext": "__init__.py" } } diff --git a/CIMToolPlugin/builders/cimantic-graphs-init.xsl b/CIMToolPlugin/builders/cimantic-graphs-init.xsl new file mode 100644 index 00000000..39fec54b --- /dev/null +++ b/CIMToolPlugin/builders/cimantic-graphs-init.xsl @@ -0,0 +1,68 @@ + + + + + + + + + Profile + au.com.langdale.cimtool.generated + + + + + + + Annotated CIMantic Graphs data profile init file for + + + Generated by CIMTool https://cimtool.ucaiug.io + + + from cimgraph.data_profile.. import ( + + + + + + , + + + ) + + + __all__ = [ + + + + + , + + + ] + + + diff --git a/CIMToolPlugin/builders/cimantic-graphs.xsl b/CIMToolPlugin/builders/cimantic-graphs.xsl new file mode 100644 index 00000000..b3839aa3 --- /dev/null +++ b/CIMToolPlugin/builders/cimantic-graphs.xsl @@ -0,0 +1,433 @@ + + + + + + + + + Profile + au.com.langdale.cimtool.generated + + + + + + + + + from __future__ import annotations + from dataclasses import dataclass, field + from typing import Optional + from enum import Enum + + Annotated CIMantic Graphs data profile for + Generated by CIMTool https://cimtool.ucaiug.io + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @dataclass + class (): + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @dataclass + + class (): + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + : Optional[ + | + ] = field( + + + default = None, + + + + metadata = { + + + + }) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + : Optional[ + ] = field( + + + default = None, + + + + metadata = { + + + + }) + + + + + + + + + + + + + + + + + + + + + + + + + : Optional[ str | + ] = field( + + + default = None, + + + + + + + + + + + + + + + : list[ str | + ] = field( + + + default_factory = list, + + + + + metadata = { + + + + }) + + + + + + + + + + + + + class ( Enum ): + + + + + + + + + + + + + + + + + + + + + + + @dataclass + class (): + + value: = field(default=None) + + + + + + + + + + + + + + + + + + + + + + 'type': '', + + + 'type': 'Attribute', + + 'minOccurs': '', + 'maxOccurs': '' + + + + + + + 'type': '', + + + 'type': 'Association', + + 'minOccurs': '', + 'maxOccurs': '', + 'inverse': '' + + + + + + + + + + + + + = '' + + + + + + + + + + + + + + str + int + float + float + bool + str + + + + + + + + + + _and + _as + _assert + _break + _class + _continue + _def + _del + _elif + _else + _except + _finally + _for + _from + _global + _if + _import + _in + _is + _lambda + _nonlocal + _not + _or + _pass + _raise + _return + _try + _while + _with + _yield + + + + diff --git a/CIMToolPlugin/builders/jpa.xsl b/CIMToolPlugin/builders/jpa.xsl index 414a03c2..40f439de 100644 --- a/CIMToolPlugin/builders/jpa.xsl +++ b/CIMToolPlugin/builders/jpa.xsl @@ -102,7 +102,7 @@ import javax.persistence.*; Annotated java for - Generated by CIMTool http://cimtool.org + Generated by CIMTool https://cimtool.ucaiug.io public class diff --git a/CIMToolPlugin/builders/linkml.xsl b/CIMToolPlugin/builders/linkml.xsl new file mode 100644 index 00000000..30a7706d --- /dev/null +++ b/CIMToolPlugin/builders/linkml.xsl @@ -0,0 +1,454 @@ + + + + + + + + + + + + id: + + name: + + title: Vocabulary + + + + description: "" + + + + + comments: "" + + + + annotations: + + copyright: "" + + + + + prefixes: + + + : + + + + imports: + + - linkml:types + + default_curi_maps: + + - semweb_context + + default_range: string + + default_prefix: this + + + + classes: + + + + + types: + + + + + enums: + + + + + + : + + + + description: "" + + + + + comments: "" + + + + + is_a: + + + + abstract: true + + + class_uri: + + attributes: + + + + + + + : + + uri: + + + + + + + + base: + + + + description: "" + + + + + comments: "" + + + annotations: + + cim_data_type: true + + uri: + + + + + + : + + + + description: "" + + + + + comments: "" + + + slot_uri: + + + + + + + + range: + + minimum_cardinality: + + + + maximum_cardinality: + + + + multivalued: true + + + + + + + : + + + + description: "" + + + + + comments: "" + + + slot_uri: + + range: + + minimum_cardinality: + + + + maximum_cardinality: + + + + multivalued: true + + + + + + + : + + + + description: "" + + + + + comments: "" + + + slot_uri: + + range: + + minimum_cardinality: + + + + maximum_cardinality: + + + + multivalued: true + + + + + + + + + + + description: "" + + + + + comments: "" + + + enum_uri: + + permissible_values: + + + + + + + + meaning: + + + + description: "" + + + + + comments: "" + + + + + + + + + Bool + XSDDate + XSDDateTime + Decimal + float + float + int + NCName + str + XSDTime + URIorCURIE + + + + + + + + + + string + string + string + string + uri + string + string + integer + double + float + decimal + boolean + datetime + date + time + string + string + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CIMToolPlugin/builders/profile-doc-osi-rtf.xsl b/CIMToolPlugin/builders/profile-doc-osi-rtf.xsl new file mode 100644 index 00000000..45dd6c19 --- /dev/null +++ b/CIMToolPlugin/builders/profile-doc-osi-rtf.xsl @@ -0,0 +1,530 @@ + + + + + +Profile +' +{\rtf1\ansi\ansicpg1252\deff0\deflang1033\deflangfe1033\fs20{\fonttbl{\f0\fswiss\fprq2\fcharset0 Arial;}{\f1\fswiss\fprq2\fcharset0{\*\fname Arial;}Arial CE;} +{\f23\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Arial;}}{\colortbl;\red0\green0\blue238;\red255\green0\blue0;\red25\green150\blue255;\red50\green255\blue50;\red226\green239\blue217;\red255\green242\blue204;\red222\green234\blue246} +\pard\plain \sb120\qj\fs20\lang1033 +{\par\b\fs28 Profile\par}Profile namespace: +\par\pard\plain \sb120\qj\fs20\lang1033 + +{\par\fs20 IEC Standards Legend:\par}\par +{ +\trowd \trgaph70 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx1230 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx9450 +{\pard \intbl \sb120\sa120\fs16\qc\b spec \cell} +{\pard \intbl \sb120\sa120\fs16\qc\b IEC published standard \cell} +\row +} +{ +\trowd \trgaph70 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx1230 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx9450 +{\pard \intbl \sb120\sa120\fs16 E2 (CIM16) \cell} +{\pard \intbl \sb120\sa120\fs16 IEC 61970-456 Ed. 2.0 \cell} +\row +} +{ +\trowd \trgaph70 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx1230 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx9450 +{\pard \intbl \sb120\sa120\fs16 E3 (CIM17) \cell} +{\pard \intbl \sb120\sa120\fs16 IEC 61970-456 Ed. 3.0 \cell} +\row +} +{ +\trowd \trgaph70 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx1230 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx9450 +{\pard \intbl \sb120\sa120\fs16 C2 (CIM16) \cell} +{\pard \intbl \sb120\sa120\fs16 IEC 61970-600-2 T.S. Ed. 1.0 (CGMES 2.4.15)\cell} +\row +} +{ +\trowd \trgaph70 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx1230 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx9450 +{\pard \intbl \sb120\sa120\fs16 C3 (CIM17) \cell} +{\pard \intbl \sb120\sa120\fs16 IEC 61970-600-2 I.S. Ed. 1.0 (CGMES 3.0.0)\cell} +\row +} + +{\par\fs20 Model Namespace Prefixes:\par}\par +{ +\trowd \trgaph70 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx1230 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx2030 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx9450 +{\pard \intbl \sb120\sa120\fs16\qc\b spec \cell} +{\pard \intbl \sb120\sa120\fs16\qc\b prefix \cell} +{\pard \intbl \sb120\sa120\fs16\qc\b namespace \cell} +\row +} +{ +\trowd \trgaph70 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx1230 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx2030 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx9450 +{\pard \intbl \sb120\sa120\fs16 E2|C2 (CIM16) \cell} +{\pard \intbl \sb120\sa120\fs16 {\cf2\b } \cell} +{\pard \intbl \sb120\sa120\fs16 \cell} +\row +} +{ +\trowd \trgaph70 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx1230 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx2030 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx9450 +{\pard \intbl \sb120\sa120\fs16 E3|C3 (CIM17) \cell} +{\pard \intbl \sb120\sa120\fs16 {\cf2\b } \cell} +{\pard \intbl \sb120\sa120\fs16 \cell} +\row +} +{ +\trowd \trgaph70 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx1230 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx2030 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx9450 +{\pard \intbl \sb120\sa120\fs16 C2 (CIM16) \cell} +{\pard \intbl \sb120\sa120\fs16 {\cf3\b } \cell} +{\pard \intbl \sb120\sa120\fs16 \cell} +\row +} +{ +\trowd \trgaph70 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx1230 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx2030 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx9450 +{\pard \intbl \sb120\sa120\fs16 C3 (CIM17) \cell} +{\pard \intbl \sb120\sa120\fs16 {\cf3\b } \cell} +{\pard \intbl \sb120\sa120\fs16 \cell} +\row +} + + +{\par\b\fs28 Concrete Classes \par} + + + + + + +{\par\b\fs28 Abstract Classes \par} + + + + + + +{\par\b\fs28 Compound Types \par} + + + + + + +{\par\b\fs28 Enumerations \par} + + + + + + +{\par\b\fs28 Datatypes \par} + + + + +\par}}}}}}}} + + + +{\par\b\fs24 {\*\bkmkstart }}{\fs24 {\*\bkmkend }} + + + +{\par\b\fs24 {\*\bkmkstart }}{\fs24 {\*\bkmkend }} + + +\par\fs20 Inheritance path = +\par\pard\plain \sb120\qj\fs20\lang1033 + + +{\par\b\fs20 Native Members\par} +\par +{ +\trowd \trgaph70 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx630 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx1980 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx2700 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx4140 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx6660 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx9450 +{\pard \intbl \sb120\sa120\fs16\qc\b spec \cell} +{\pard \intbl \sb120\sa120\fs16\qc\b name \cell} +{\pard \intbl \sb120\sa120\fs16\qc\b mult \cell} +{\pard \intbl \sb120\sa120\fs16\qc\b type \cell} +{\pard \intbl \sb120\sa120\fs16\qc\b description \cell} +{\pard \intbl \sb120\sa120\fs16\qc\b mapping \cell} +\row +} + + +{\par\b\fs20 Inherited Members\par}\par +{ +\trowd \trgaph70 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx630 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx1980 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx2700 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx4140 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx6660 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx9450 +{\pard \intbl \sb120\sa120\fs16\qc\b spec \cell} +{\pard \intbl \sb120\sa120\fs16\qc\b name \cell} +{\pard \intbl \sb120\sa120\fs16\qc\b mult \cell} +{\pard \intbl \sb120\sa120\fs16\qc\b type \cell} +{\pard \intbl \sb120\sa120\fs16\qc\b description \cell} +{\pard \intbl \sb120\sa120\fs16\qc\b mapping \cell} +\row +} + + + + +{\i This class is a placeholder for 'By Reference' associations defined within this profile. Such classes have no attributes or associations defined. Rather, 'By Reference' associations of this type reference a corresponding concrete type in external profiles that this one is dependent upon.} +\par + + + + +{\field{\*\fldinst {\fs20 HYPERLINK \\l ""}}{\fldrslt {\fs20\ul\cf1 }}} + :: + + + +{ +\trowd \trgaph70 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx630 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx1980 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\clcbpat5\cellx2700 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx4140 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx6660 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx9450 +{\pard \intbl \sb120\sa120\ql\fs16 \cell} +{\pard \intbl \sb120\sa120\ql\fs16 \cell} +{\pard \intbl \sb120\sa120\qc\fs16 ..* \cell} +{\pard \intbl \sb120\sa120\ql\fs16 {\field{\*\fldinst {\fs16 HYPERLINK \\l ""}}{\fldrslt {\fs16\ul\cf1 }}} \cell} +{\pard \intbl \sb120\sa120\ql\fs16 \cell} +{\pard \intbl \sb120\sa120\ql\fs16 \cell} +\row +} + + + +{ +\trowd \trgaph70 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx630 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx1980 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\clcbpat5\cellx2700 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx4140 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx6660 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx9450 +{\pard \intbl \sb120\sa120\ql\fs16 \cell} +{\pard \intbl \sb120\sa120\ql\fs16 \cell} +{\pard \intbl \sb120\sa120\qc\fs16 .. \cell} +{\pard \intbl \sb120\sa120\ql\fs16 \cell} +{\pard \intbl \sb120\sa120\ql\fs16 \cell} +{\pard \intbl \sb120\sa120\ql\fs16 \cell} +\row +} + + + + + + + + + + + + + +{ +\trowd \trgaph70 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx630 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx1980 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\clcbpat5\cellx2700 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx4140 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx6660 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx9450 +{\pard \intbl \sb120\sa120\ql\fs16 \cell} +{\pard \intbl \sb120\sa120\ql\fs16 \cell} +{\pard \intbl \sb120\sa120\qc\fs16 .. \cell} +{\pard \intbl \sb120\sa120\ql\fs16 {\field{\*\fldinst {\fs16 HYPERLINK \\l ""}}{\fldrslt {\fs16\ul\cf1 }}} \cell} +{\pard \intbl \sb120\sa120\ql\fs16 see {\field{\*\fldinst {\fs16 HYPERLINK \\l ""}}{\fldrslt {\fs16\ul\cf1 }}} \cell} +{\pard \intbl \sb120\sa120\ql\fs16 \cell} +\row +} + + + +{ +\trowd \trgaph70 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx630 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx1980 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\clcbpat5\cellx2700 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx4140 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx6660 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx9450 +{\pard \intbl \sb120\sa120\ql\fs16 \cell} +{\pard \intbl \sb120\sa120\ql\fs16 \cell} +{\pard \intbl \sb120\sa120\qc\fs16 .. \cell} +{\pard \intbl \sb120\sa120\ql\fs16 \cell} +{\pard \intbl \sb120\sa120\ql\fs16 see {\field{\*\fldinst {\fs16 HYPERLINK \\l ""}}{\fldrslt {\fs16\ul\cf1 }}} \cell} +{\pard \intbl \sb120\sa120\ql\fs16 Refer to the mapping description for this attribute in {\field{\*\fldinst {\fs16 HYPERLINK \\l ""}}{\fldrslt {\fs16\ul\cf1 }}}. \cell} +\row +} + + + +{\par\b\fs24 {\*\bkmkstart }}{\fs32 {\*\bkmkend }} + + + +{\par\b\fs24 {\*\bkmkstart }}{\fs32 {\*\bkmkend }} + +\par\pard\plain \sb120\qj\fs20\lang1033 +{\par\b\fs20 Members\par} +\par +{ +\trowd \trgaph70 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx630 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx1980 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx2700 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx4140 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx6660 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx9450 +{\pard \intbl \sb120\sa120\fs16\qc\b spec \cell} +{\pard \intbl \sb120\sa120\fs16\qc\b name \cell} +{\pard \intbl \sb120\sa120\fs16\qc\b mult \cell} +{\pard \intbl \sb120\sa120\fs16\qc\b type \cell} +{\pard \intbl \sb120\sa120\fs16\qc\b description \cell} +{\pard \intbl \sb120\sa120\fs16\qc\b mapping \cell} +\row +} + + + + +{\par\b\fs24 {\*\bkmkstart }}{\fs32 {\*\bkmkend } \par} + +\par\pard\plain \sb120\qj\fs20\lang1033 XSD type: {\b\cf3 xsd:} +\par\pard\plain \sb120\qj\fs20\lang1033 + + + +{\par\b\fs24 {\*\bkmkstart }}{\fs32 {\*\bkmkend } \par} + +\par\pard\plain \sb120\qj\fs20\lang1033 +\par +{ +\trowd \trgaph70 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx3750 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx9500 +{\pard \intbl \sb120\sa120\fs16\qc\b name \cell} +{\pard \intbl \sb120\sa120\fs16\qc\b description \cell} +\row +} + + + + +{ +\trowd \trgaph70 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx3750 +\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs +\cellx9500 +{\pard \intbl \sb120\sa120\fs16 \cell} +{\pard \intbl \sb120\sa120\fs16 \cell} +\row +} + + + + + + + + + () + + + +{\par\pard\plain \sb120\qj\fs20\lang1033 } + + + +{\par\pard\plain \sb120\qj\fs20\lang1033 } + + + + + + + +{\sb120\sa120 } + + + +{\sb120\sa120 } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {\cf2 } + {\cf3 } + {\cf4 } + + + + + + + + {\sb120\sa120\fs16\cf2\b } + {\sb120\sa120\fs16\cf3\b } + {\sb120\sa120\fs16\cf4\b } + + + + + + + !"#$%&'()*+,-./0123456789:;=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CIMToolPlugin/builders/rdfs-2020.xsl b/CIMToolPlugin/builders/rdfs-2020.xsl index 65b2e3a9..018f849a 100644 --- a/CIMToolPlugin/builders/rdfs-2020.xsl +++ b/CIMToolPlugin/builders/rdfs-2020.xsl @@ -152,7 +152,7 @@ - + @@ -202,7 +202,7 @@ - + diff --git a/CIMToolPlugin/builders/scala.xsl b/CIMToolPlugin/builders/scala.xsl index 079c5e74..f080d0e5 100644 --- a/CIMToolPlugin/builders/scala.xsl +++ b/CIMToolPlugin/builders/scala.xsl @@ -36,7 +36,7 @@ import au.com.langdale.skena._ API for - Generated by CIMTool http://cimtool.org + Generated by CIMTool https://cimtool.ucaiug.io object `` extends Vocabulary diff --git a/CIMToolPlugin/builders/sql.xsl b/CIMToolPlugin/builders/sql.xsl index 8129fcfd..09951109 100644 --- a/CIMToolPlugin/builders/sql.xsl +++ b/CIMToolPlugin/builders/sql.xsl @@ -39,7 +39,7 @@ Schema for - Generated by CIMTool http://cimtool.org + Generated by CIMTool https://cimtool.ucaiug.io diff --git a/CIMToolPlugin/icons/ea-repository.png b/CIMToolPlugin/icons/ea-repository.png new file mode 100644 index 00000000..c50381fd Binary files /dev/null and b/CIMToolPlugin/icons/ea-repository.png differ diff --git a/CIMToolPlugin/makeicons.launch b/CIMToolPlugin/makeicons.launch index a5c6838c..a5652269 100644 --- a/CIMToolPlugin/makeicons.launch +++ b/CIMToolPlugin/makeicons.launch @@ -1,6 +1,5 @@ - diff --git a/CIMToolPlugin/native/Firebird_win32-x86.zip b/CIMToolPlugin/native/Firebird_win32-x86.zip new file mode 100644 index 00000000..39c4a355 Binary files /dev/null and b/CIMToolPlugin/native/Firebird_win32-x86.zip differ diff --git a/CIMToolPlugin/native/Firebird_win32-x86_64.zip b/CIMToolPlugin/native/Firebird_win32-x86_64.zip new file mode 100644 index 00000000..625173f5 Binary files /dev/null and b/CIMToolPlugin/native/Firebird_win32-x86_64.zip differ diff --git a/CIMToolPlugin/plugin.xml b/CIMToolPlugin/plugin.xml index 912ba0e9..783b8a4c 100644 --- a/CIMToolPlugin/plugin.xml +++ b/CIMToolPlugin/plugin.xml @@ -178,11 +178,18 @@ point="org.eclipse.ui.editors"> + + IWorkspaceRunnable and in some cases, plain methods. @@ -248,8 +250,8 @@ public static OntModel parse(IFile file) throws CoreException { String ext = file.getFileExtension().toLowerCase(); if (ext.equals("xmi")) { return parseXMI(file); - } else if (ext.equals("eap")) - return parseEAP(file); + } else if (ext.equals("eap") || ext.equals("eapx") || ext.equals("qea") || ext.equals("qeax") || ext.equals("feap")) + return parseEAProject(file); else { if (ModelParserRegistry.INSTANCE.hasParserForExtension(ext)) { ModelParser[] parsers = ModelParserRegistry.INSTANCE.getParsersForExtension(ext); @@ -310,13 +312,13 @@ private static OntModel parseXMI(IFile file) throws CoreException { return interpretSchema(parser.getModel(), file); } - private static OntModel parseEAP(IFile file) throws CoreException { - EAPExtractor extractor; + private static OntModel parseEAProject(IFile file) throws CoreException { + EAProjectExtractor extractor; try { - extractor = new EAPExtractor(file.getLocation().toFile()); + extractor = EAProjectExtractorFactory.createExtractor(file.getLocation().toFile()); extractor.run(); - } catch (IOException e) { - throw error("can't access EA project", e); + } catch (EAProjectExtractorException e) { + throw error("Can't access EA project", e); } return interpretSchema(extractor.getModel(), file); } diff --git a/CIMToolPlugin/src/au/com/langdale/cimtoole/wizards/ImportCopyrightTemplatesPage.java b/CIMToolPlugin/src/au/com/langdale/cimtoole/wizards/ImportCopyrightTemplatesPage.java index 7f396495..d86ff8be 100644 --- a/CIMToolPlugin/src/au/com/langdale/cimtoole/wizards/ImportCopyrightTemplatesPage.java +++ b/CIMToolPlugin/src/au/com/langdale/cimtoole/wizards/ImportCopyrightTemplatesPage.java @@ -18,9 +18,9 @@ import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; +import java.nio.charset.Charset; import org.apache.commons.io.IOUtils; -import org.apache.commons.lang.CharEncoding; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.CoreException; @@ -230,7 +230,7 @@ protected String getFileContents(String pathname) { InputStream source; try { source = new BufferedInputStream(new FileInputStream(pathname)); - contents = new String(IOUtils.toByteArray(new InputStreamReader(source), CharEncoding.UTF_8)); + contents = new String(IOUtils.toByteArray(new InputStreamReader(source), Charset.forName("UTF-8"))); } catch (IOException e) { // } diff --git a/CIMToolPlugin/src/au/com/langdale/cimtoole/wizards/ImportSchema.java b/CIMToolPlugin/src/au/com/langdale/cimtoole/wizards/ImportSchema.java index 25ccbc9d..76625c11 100644 --- a/CIMToolPlugin/src/au/com/langdale/cimtoole/wizards/ImportSchema.java +++ b/CIMToolPlugin/src/au/com/langdale/cimtoole/wizards/ImportSchema.java @@ -20,7 +20,7 @@ public void init(IWorkbench workbench, IStructuredSelection selection) { setWindowTitle("Import Schema"); setNeedsProgressMonitor(true); main.setTitle(getWindowTitle()); - main.setDescription("Import an additional schema (XMI, OWL or EAP file)."); + main.setDescription("Import an additional schema (XMI, OWL, EAP, EAPX, QEA, QEAX, or FEAP file)."); main.setSelected(selection); } diff --git a/CIMToolPlugin/src/au/com/langdale/cimtoole/wizards/SchemaWizardPage.java b/CIMToolPlugin/src/au/com/langdale/cimtoole/wizards/SchemaWizardPage.java index f432df51..9a7073bc 100644 --- a/CIMToolPlugin/src/au/com/langdale/cimtoole/wizards/SchemaWizardPage.java +++ b/CIMToolPlugin/src/au/com/langdale/cimtoole/wizards/SchemaWizardPage.java @@ -45,7 +45,7 @@ public SchemaWizardPage() { } private String NAMESPACE = Info.getPreference(Info.SCHEMA_NAMESPACE); - private static String[] sources = {"*.eap", "*.xmi", "*.owl"}; + private static String[] sources = {"*.eap", "*.eapx", "*.qea", "*.qeax", "*.feap", "*.xmi", "*.owl"}; private IFile file; boolean importing; @@ -124,7 +124,7 @@ public String validate() { if(expectNewProject) return null; else - return "A schema XMI, OWL, EAP or other valid schema file is required"; + return "A schema XMI, OWL, EA Project or other valid schema file is required"; IProject project = expectNewProject? newProject: projects.getProject(); file = filename.getFile(Info.getSchemaFolder(project)); @@ -137,11 +137,12 @@ public String validate() { return "A schema named " + filename.getText() + " already exists. " + "Check option to replace."; - if( source.getText().endsWith(".eap")) { - String check = Info.checkValidEAP(new File(source.getText())); - if( check != null) - return check; + String check = null; + if( source.getText().endsWith(".eap") || source.getText().endsWith(".eapx")) { + check = Info.checkValidEAProject(new File(source.getText())); } + if( check != null) + return check; return null; } }; diff --git a/CIMToolProduct/CIMTool.product b/CIMToolProduct/CIMTool.product index 9d51e840..09d80689 100644 --- a/CIMToolProduct/CIMTool.product +++ b/CIMToolProduct/CIMTool.product @@ -1,7 +1,7 @@ - + diff --git a/CIMToolProduct/META-INF/MANIFEST.MF b/CIMToolProduct/META-INF/MANIFEST.MF index 7cf43bef..78881f15 100644 --- a/CIMToolProduct/META-INF/MANIFEST.MF +++ b/CIMToolProduct/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: CIMToolEnvironment Bundle-SymbolicName: au.com.langdale.cimtool.product;singleton:=true -Bundle-Version: 2.0.1 +Bundle-Version: 2.1.0 Bundle-ClassPath: CIMToolProduct Bundle-Vendor: Langdale Consultants Automatic-Module-Name: au.com.langdale.cimtool.product diff --git a/CIMToolProduct/cimtool-about.png b/CIMToolProduct/cimtool-about.png index 1ae437a3..62e8c222 100644 Binary files a/CIMToolProduct/cimtool-about.png and b/CIMToolProduct/cimtool-about.png differ diff --git a/CIMToolProduct/plugin.xml b/CIMToolProduct/plugin.xml index 80883a49..15740cac 100644 --- a/CIMToolProduct/plugin.xml +++ b/CIMToolProduct/plugin.xml @@ -7,7 +7,7 @@ point="org.eclipse.core.runtime.products"> + name="CIMTool 2.1.0"> @@ -30,7 +30,7 @@ + value="CIMTool 2.1.0"> + + + + + + + - - - - - + + + + + + diff --git a/CIMUtil/META-INF/MANIFEST.MF b/CIMUtil/META-INF/MANIFEST.MF index a722ff39..3e3a22fe 100644 --- a/CIMUtil/META-INF/MANIFEST.MF +++ b/CIMUtil/META-INF/MANIFEST.MF @@ -2,16 +2,20 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: CIMUtil Bundle-SymbolicName: au.com.langdale.cimutil -Bundle-Version: 2.0.1 +Bundle-Version: 2.1.0 Bundle-RequiredExecutionEnvironment: JavaSE-20 Require-Bundle: au.com.langdale.kena Bundle-ClassPath: cimutil.jar, - lib/poi-3.0.1-FINAL-20070705.jar, - lib/jackcess-1.2.9.jar, - lib/commons-logging-1.1.1.jar, lib/commons-lang-2.6.jar, lib/saxon-he-10.8.jar, - lib/xml-resolver-1.2.jar + lib/xml-resolver-1.2.jar, + lib/poi-3.9.jar, + lib/commons-logging-1.1.3.jar, + lib/slf4j-api-1.7.36.jar, + lib/sqlite-jdbc-3.45.2.0.jar, + lib/jackcess-2.2.3.jar, + lib/jaybird-5.0.4.java11.jar, + lib/jna-5.12.1.jar Export-Package: au.com.langdale.cim, au.com.langdale.jena, au.com.langdale.profiles, @@ -21,7 +25,6 @@ Export-Package: au.com.langdale.cim, com.healthmarketscience.jackcess, com.healthmarketscience.jackcess.complex, com.healthmarketscience.jackcess.query, - com.healthmarketscience.jackcess.scsu, org.apache.commons.lang, org.apache.commons.lang.builder, org.apache.commons.lang.enums, @@ -43,7 +46,6 @@ Export-Package: au.com.langdale.cim, org.apache.poi.hssf.model, org.apache.poi.hssf.record, org.apache.poi.hssf.record.aggregates, - org.apache.poi.hssf.record.formula, org.apache.poi.hssf.usermodel, org.apache.poi.hssf.util, org.apache.poi.poifs.common, @@ -53,5 +55,5 @@ Export-Package: au.com.langdale.cim, org.apache.poi.poifs.property, org.apache.poi.poifs.storage, org.apache.poi.util -Bundle-Vendor: Langdale Consultants +Bundle-Vendor: UCAIug Automatic-Module-Name: au.com.langdale.cimutil diff --git a/CIMUtil/build.properties b/CIMUtil/build.properties index 1a6c16ba..584a833e 100644 --- a/CIMUtil/build.properties +++ b/CIMUtil/build.properties @@ -1,11 +1,16 @@ bin.includes = META-INF/,\ cimutil.jar,\ lib/commons-lang-2.6.jar,\ - lib/commons-logging-1.1.1.jar,\ - lib/jackcess-1.2.9.jar,\ - lib/poi-3.0.1-FINAL-20070705.jar,\ + lib/commons-logging-1.1.3.jar,\ + lib/poi-3.9.jar,\ lib/saxon-he-10.8.jar,\ - lib/xml-resolver-1.2.jar + lib/xml-resolver-1.2.jar,\ + lib/sqlite-jdbc-3.45.2.0.jar,\ + lib/slf4j-api-1.7.36.jar,\ + lib/jackcess-2.2.3.jar,\ + lib/jaybird-5.0.4.java11.jar,\ + lib/jna-5.12.1.jar,\ + lib/dll/fbembed.dll jars.compile.order = cimutil.jar source.cimutil.jar = src/ output.cimutil.jar = bin/ diff --git a/CIMUtil/lib/README.txt b/CIMUtil/lib/README.txt index 96590239..09f3e3d7 100644 --- a/CIMUtil/lib/README.txt +++ b/CIMUtil/lib/README.txt @@ -1 +1,7 @@ -The Saxon-HE XSLT implementation has a single dependency on jline-2.9.jar. This jar may be removed if Saxon is not needed. \ No newline at end of file +Saxon XSLT: The Saxon-HE XSLT implementation has a single dependency on jline-2.9.jar. This jar may be removed if Saxon is not needed. + +Firebird JDBC Driver: jaybird-5.0.4.java11.jar and jna-5.12.1.jar + +SQLite: sqlite-jdbc-3.45.2.0.jar & slf4j-api-17.36.jar + +Jackcess: jackcess-2.2.3.jar, commons-lang.2.6.jar, commons-logging-1.1.3.jar & poi-3.9.jar \ No newline at end of file diff --git a/CIMUtil/lib/commons-logging-1.1.1.jar b/CIMUtil/lib/commons-logging-1.1.1.jar deleted file mode 100644 index 8758a96b..00000000 Binary files a/CIMUtil/lib/commons-logging-1.1.1.jar and /dev/null differ diff --git a/CIMUtil/lib/commons-logging-1.1.3.jar b/CIMUtil/lib/commons-logging-1.1.3.jar new file mode 100644 index 00000000..ab512540 Binary files /dev/null and b/CIMUtil/lib/commons-logging-1.1.3.jar differ diff --git a/CIMUtil/lib/dll/fbembed.dll b/CIMUtil/lib/dll/fbembed.dll new file mode 100644 index 00000000..87fd10dd Binary files /dev/null and b/CIMUtil/lib/dll/fbembed.dll differ diff --git a/CIMUtil/lib/jackcess-1.2.9.jar b/CIMUtil/lib/jackcess-1.2.9.jar deleted file mode 100644 index 86955195..00000000 Binary files a/CIMUtil/lib/jackcess-1.2.9.jar and /dev/null differ diff --git a/CIMUtil/lib/jackcess-2.2.3-sources.jar b/CIMUtil/lib/jackcess-2.2.3-sources.jar new file mode 100644 index 00000000..1cd3c6cf Binary files /dev/null and b/CIMUtil/lib/jackcess-2.2.3-sources.jar differ diff --git a/CIMUtil/lib/jackcess-2.2.3.jar b/CIMUtil/lib/jackcess-2.2.3.jar new file mode 100644 index 00000000..8ff59707 Binary files /dev/null and b/CIMUtil/lib/jackcess-2.2.3.jar differ diff --git a/CIMUtil/lib/jaybird-5.0.4.java11.jar b/CIMUtil/lib/jaybird-5.0.4.java11.jar new file mode 100644 index 00000000..b42c6f9b Binary files /dev/null and b/CIMUtil/lib/jaybird-5.0.4.java11.jar differ diff --git a/CIMUtil/lib/jna-5.12.1.jar b/CIMUtil/lib/jna-5.12.1.jar new file mode 100644 index 00000000..77f8c7ae Binary files /dev/null and b/CIMUtil/lib/jna-5.12.1.jar differ diff --git a/CIMUtil/lib/poi-3.0.1-FINAL-20070705.jar b/CIMUtil/lib/poi-3.0.1-FINAL-20070705.jar deleted file mode 100644 index c79c3328..00000000 Binary files a/CIMUtil/lib/poi-3.0.1-FINAL-20070705.jar and /dev/null differ diff --git a/CIMUtil/lib/poi-3.9.jar b/CIMUtil/lib/poi-3.9.jar new file mode 100644 index 00000000..0f462880 Binary files /dev/null and b/CIMUtil/lib/poi-3.9.jar differ diff --git a/CIMUtil/lib/slf4j-api-1.7.36.jar b/CIMUtil/lib/slf4j-api-1.7.36.jar new file mode 100644 index 00000000..7d3ce68d Binary files /dev/null and b/CIMUtil/lib/slf4j-api-1.7.36.jar differ diff --git a/CIMUtil/lib/sqlite-jdbc-3.45.2.0.jar b/CIMUtil/lib/sqlite-jdbc-3.45.2.0.jar new file mode 100644 index 00000000..9b6e9db4 Binary files /dev/null and b/CIMUtil/lib/sqlite-jdbc-3.45.2.0.jar differ diff --git a/CIMUtil/slf4j-api-1.7.36.jar b/CIMUtil/slf4j-api-1.7.36.jar new file mode 100644 index 00000000..7d3ce68d Binary files /dev/null and b/CIMUtil/slf4j-api-1.7.36.jar differ diff --git a/CIMUtil/sqlite-jdbc-3.45.2.0.jar b/CIMUtil/sqlite-jdbc-3.45.2.0.jar new file mode 100644 index 00000000..9b6e9db4 Binary files /dev/null and b/CIMUtil/sqlite-jdbc-3.45.2.0.jar differ diff --git a/CIMUtil/src/au/com/langdale/profiles/ProfileSerializer.java b/CIMUtil/src/au/com/langdale/profiles/ProfileSerializer.java index 182b2a3c..cd793a5d 100644 --- a/CIMUtil/src/au/com/langdale/profiles/ProfileSerializer.java +++ b/CIMUtil/src/au/com/langdale/profiles/ProfileSerializer.java @@ -33,6 +33,9 @@ import org.xml.sax.SAXException; import org.xml.sax.SAXParseException; +import com.hp.hpl.jena.vocabulary.RDFS; +import com.hp.hpl.jena.vocabulary.XSD; + import au.com.langdale.jena.JenaTreeModelBase; import au.com.langdale.jena.TreeModelBase.Node; import au.com.langdale.kena.OntResource; @@ -49,9 +52,6 @@ import au.com.langdale.sax.AbstractReader; import au.com.langdale.xmi.UML; -import com.hp.hpl.jena.vocabulary.RDFS; -import com.hp.hpl.jena.vocabulary.XSD; - /** * Convert a message model to XML. The form of the XML is designed to be easily * transformed to specific schemas in any schema language. @@ -437,8 +437,10 @@ private void emit(ElementNode node) throws SAXException { if (size == 0) { OntResource range = node.getBaseProperty().getRange(); elem = new Element("Reference"); - if (range != null && range.isURIResource()) + if (range != null && range.isURIResource()) { + elem.set("baseClass", range.getURI()); elem.set("type", range.getLocalName()); + } emit(node, elem); OntResource inverse = (node.getBaseProperty() != null ? node.getBaseProperty().getInverse() : null); @@ -592,7 +594,14 @@ private void emitStereotype(OntResource stereo) throws SAXException { if (!stereo.isURIResource()) return; Element elem = new Element("Stereotype"); - elem.set("label", stereo.getLabel()); + if (stereo.getLabel() != null) { + elem.set("label", stereo.getLabel()); + } else { + if (stereo.getLocalName() != null) + elem.set("label", stereo.getLocalName()); + else + elem.set("label", ""); + } elem.append(stereo.getURI()); elem.close(); } @@ -672,7 +681,7 @@ private void emit(OntResource type) throws SAXException { elem.set("dataType", type.getURI()); elem.set("name", type.getLocalName()); OntResource defin = type.getResource(RDFS.isDefinedBy); - if( defin != null ){ + if(defin != null){ elem.set("package", defin.getLabel()); elem.set("packageURI", defin.getURI()); } diff --git a/CIMUtil/src/au/com/langdale/profiles/xsdflat.xsl b/CIMUtil/src/au/com/langdale/profiles/xsdflat.xsl index 040a8fa6..8711ebc3 100644 --- a/CIMUtil/src/au/com/langdale/profiles/xsdflat.xsl +++ b/CIMUtil/src/au/com/langdale/profiles/xsdflat.xsl @@ -18,7 +18,7 @@ attributeFormDefault="unqualified"> - Generated by CIMTool , see http://cimtool.org + Generated by CIMTool , see https://cimtool.ucaiug.io diff --git a/CIMUtil/src/au/com/langdale/profiles/xsdmdi.xsl b/CIMUtil/src/au/com/langdale/profiles/xsdmdi.xsl index 5eb15b94..a556d8f0 100644 --- a/CIMUtil/src/au/com/langdale/profiles/xsdmdi.xsl +++ b/CIMUtil/src/au/com/langdale/profiles/xsdmdi.xsl @@ -25,7 +25,7 @@ - Generated by CIMTool , see http://cimtool.org + Generated by CIMTool , see https://cimtool.ucaiug.io diff --git a/CIMUtil/src/au/com/langdale/profiles/xsdplain.xsl b/CIMUtil/src/au/com/langdale/profiles/xsdplain.xsl index 1877615e..6629cdf8 100644 --- a/CIMUtil/src/au/com/langdale/profiles/xsdplain.xsl +++ b/CIMUtil/src/au/com/langdale/profiles/xsdplain.xsl @@ -23,7 +23,7 @@ Generated by CIMTool - , see http://cimtool.org + , see https://cimtool.ucaiug.io diff --git a/CIMUtil/src/au/com/langdale/profiles/xsdsimple.xsl b/CIMUtil/src/au/com/langdale/profiles/xsdsimple.xsl index 66630192..f2fe374b 100644 --- a/CIMUtil/src/au/com/langdale/profiles/xsdsimple.xsl +++ b/CIMUtil/src/au/com/langdale/profiles/xsdsimple.xsl @@ -20,7 +20,7 @@ attributeFormDefault="unqualified"> - Generated by CIMTool , see http://cimtool.org + Generated by CIMTool , see https://cimtool.ucaiug.io diff --git a/CIMUtil/src/au/com/langdale/xmi/AbstractEAProjectDBExtractor.java b/CIMUtil/src/au/com/langdale/xmi/AbstractEAProjectDBExtractor.java new file mode 100644 index 00000000..a2aff6fa --- /dev/null +++ b/CIMUtil/src/au/com/langdale/xmi/AbstractEAProjectDBExtractor.java @@ -0,0 +1,472 @@ +/* + * This software is Copyright 2005,2006,2007,2008 Langdale Consultants. + * Langdale Consultants can be contacted at: http://www.langdale.com.au + */ +package au.com.langdale.xmi; + +import java.io.File; +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +import au.com.langdale.kena.OntResource; + +public abstract class AbstractEAProjectDBExtractor extends AbstractEAProjectExtractor { + + // Column name constants corresponding to the EA project file SQLite DB. + private static final String COL_CLIENT = "Client"; + private static final String COL_DESCRIPTION = "Description"; + private static final String COL_PARENT_ID = "Parent_ID"; + private static final String COL_NOTE = "Note"; + private static final String COL_OBJECT_TYPE = "Object_Type"; + private static final String COL_PACKAGE_ID = "Package_ID"; + private static final String COL_VALUE = "Value"; + private static final String COL_PROPERTY = "Property"; + private static final String COL_SOURCE_ROLE = "SourceRole"; + private static final String COL_DEST_ROLE = "DestRole"; + private static final String COL_SOURCE_CARD = "SourceCard"; + private static final String COL_DEST_CARD = "DestCard"; + private static final String COL_SOURCE_ROLE_NOTE = "SourceRoleNote"; + private static final String COL_END_OBJECT_ID = "End_Object_ID"; + private static final String COL_START_OBJECT_ID = "Start_Object_ID"; + private static final String COL_DEST_ROLE_NOTE = "DestRoleNote"; + private static final String COL_DEST_IS_AGGREGATE = "DestIsAggregate"; + private static final String COL_SOURCE_IS_AGGREGATE = "SourceIsAggregate"; + private static final String COL_CONNECTOR_TYPE = "Connector_Type"; + private static final String COL_EA_GUID = "ea_guid"; + private static final String COL_DEFAULT = "Default"; + private static final String COL_NAME = "Name"; + private static final String COL_NOTES = "Notes"; + private static final String COL_OBJECT_ID = "Object_ID"; + + public AbstractEAProjectDBExtractor(File file) { + super(file); + } + + protected abstract void dbInit() throws SQLException; + + protected abstract Connection getConnection() throws SQLException; + + public void run() throws EAProjectExtractorException { + // NOTE: Connection and Statement are AutoClosable. + // Don't forget to close them both in order to avoid leaks. + try { + // We call dbInit for those databases that may need to perform + // JDBC or database related initialization such as registering + // a JDBC driver... + dbInit(); + // + loadStereotypesCache(); + loadTaggedValuesCache(); + gatherPackageIDs(); + extractPackages(); + extractClasses(); + extractAssociations(); + extractAttributes(); + } catch (EAProjectExtractorException eapException) { + eapException.printStackTrace(System.err); + throw eapException; + } catch (SQLException sqlException) { + sqlException.printStackTrace(System.err); + throw new EAProjectExtractorException("Unable to import the EA project file: " + file.getAbsolutePath(), sqlException); + } + } + + protected void loadStereotypesCache() throws EAProjectExtractorException { + stereotypesMap = new HashMap>(); + Connection connection = null; + Statement statement = null; + ResultSet rs = null; + try { + connection = getConnection(); + statement = connection.createStatement(); + rs = statement.executeQuery( + "select * from t_xref where Name = 'Stereotypes'"); + while (rs.next()) { + String eaGUID = rs.getString(COL_CLIENT); + if (stereotypesMap.containsKey(eaGUID)) { + List stereotypesList = stereotypesMap.get(eaGUID); + stereotypesList.add(rs.getString(COL_DESCRIPTION)); + } else { + List stereotypesList = new ArrayList(); + stereotypesList.add(rs.getString(COL_DESCRIPTION)); + stereotypesMap.put(eaGUID, stereotypesList); + } + } + } catch (SQLException sqlException) { + throw new EAProjectExtractorException("Unable to import the EA project file: " + file.getAbsolutePath(), sqlException); + } finally { + if (rs != null) { + try { + rs.close(); + } catch (SQLException e) { + e.printStackTrace(); + } + } + if (statement != null) { + try { + statement.close(); + } catch (SQLException e) { + e.printStackTrace(); + } + } + if (connection != null) { + try { + connection.close(); + } catch (SQLException e) { + e.printStackTrace(); + } + } + } + } + + protected void loadTaggedValuesCache() throws EAProjectExtractorException { + taggedValuesMap = new HashMap>(); + Connection connection = null; + Statement statement = null; + ResultSet rs = null; + try { + connection = getConnection(); + statement = connection.createStatement(); + rs = statement.executeQuery("select * from t_objectproperties"); + while (rs.next()) { + int objectId = rs.getInt(COL_OBJECT_ID); + if (taggedValuesMap.containsKey(objectId)) { + List taggedValuesList = taggedValuesMap.get(objectId); + taggedValuesList.add(new TaggedValue(rs.getString(COL_PROPERTY), rs.getString(COL_VALUE))); + } else { + List taggedValuesList = new ArrayList(); + taggedValuesList.add(new TaggedValue(rs.getString(COL_PROPERTY), rs.getString(COL_VALUE))); + taggedValuesMap.put(objectId, taggedValuesList); + } + } + } catch (SQLException sqlException) { + throw new EAProjectExtractorException("Unable to import the EA project file: " + file.getAbsolutePath(), sqlException); + } finally { + if (rs != null) { + try { + rs.close(); + } catch (SQLException e) { + e.printStackTrace(); + } + } + if (statement != null) { + try { + statement.close(); + } catch (SQLException e) { + e.printStackTrace(); + } + } + if (connection != null) { + try { + connection.close(); + } catch (SQLException e) { + e.printStackTrace(); + } + } + } + } + + protected void gatherPackageIDs() throws EAProjectExtractorException { + OntResource top = createGlobalPackage(); + + Connection connection = null; + Statement statement = null; + ResultSet rs = null; + try { + connection = getConnection(); + statement = connection.createStatement(); + rs = statement.executeQuery("select * from t_package order by Name"); + while (rs.next()) { + OntResource subject; + if (rs.getString(COL_NAME).equals("Model")) + subject = top; + else + subject = createIndividual(getXUID(rs), rs.getString(COL_NAME), UML.Package); + packageIDs.putID(rs.getInt(COL_PACKAGE_ID), subject); + } + } catch (SQLException sqlException) { + throw new EAProjectExtractorException("Unable to import the EA project file: " + file.getAbsolutePath(), sqlException); + } finally { + if (rs != null) { + try { + rs.close(); + } catch (SQLException e) { + e.printStackTrace(); + } + } + if (statement != null) { + try { + statement.close(); + } catch (SQLException e) { + e.printStackTrace(); + } + } + if (connection != null) { + try { + connection.close(); + } catch (SQLException e) { + e.printStackTrace(); + } + } + } + + } + + protected void extractPackages() throws EAProjectExtractorException { + Connection connection = null; + Statement statement = null; + ResultSet rs = null; + try { + connection = getConnection(); + statement = connection.createStatement(); + // For extracting packages we must perform a join to be able to pull in the + // Object_ID for the package. The Object_ID is needed to located tagged values. + rs = statement.executeQuery( + "select t_package.Package_ID AS Package_ID, t_package.Parent_ID AS Parent_ID, t_package.Notes AS Notes, t_package.ea_guid AS ea_guid, t_object.Object_ID AS Object_ID from t_package, t_object where t_package.Package_ID = t_object.Package_ID"); + while (rs.next()) { + int packageId = rs.getInt(COL_PACKAGE_ID); + String eaGUID = rs.getString(COL_EA_GUID); + OntResource subject = packageIDs.getID(packageId); + if (!subject.equals(UML.global_package)) { + int objectId = rs.getInt(COL_OBJECT_ID); + OntResource parent = packageIDs.getID(rs.getInt(COL_PARENT_ID)); + subject.addIsDefinedBy(parent == null ? UML.global_package : parent); + annotate(subject, rs.getString(COL_NOTES)); + // + addStereotypes(subject, eaGUID); + addTaggedValues(subject, objectId); + } + } + } catch (SQLException sqlException) { + throw new EAProjectExtractorException("Unable to import the EA project file: " + file.getAbsolutePath(), sqlException); + } finally { + if (rs != null) { + try { + rs.close(); + } catch (SQLException e) { + e.printStackTrace(); + } + } + if (statement != null) { + try { + statement.close(); + } catch (SQLException e) { + e.printStackTrace(); + } + } + if (connection != null) { + try { + connection.close(); + } catch (SQLException e) { + e.printStackTrace(); + } + } + } + } + + protected void extractClasses() throws EAProjectExtractorException { + Connection connection = null; + Statement statement = null; + ResultSet rs = null; + try { + connection = getConnection(); + statement = connection.createStatement(); + rs = statement.executeQuery("select * from t_object"); + while (rs.next()) { + if ("Class".equals(rs.getString(COL_OBJECT_TYPE))) { + OntResource subject = createClass(getXUID(rs), rs.getString(COL_NAME)); + int objectId = rs.getInt(COL_OBJECT_ID); + objectIDs.putID(objectId, subject); + annotate(subject, rs.getString(COL_NOTE)); + OntResource parent = packageIDs.getID(rs.getInt(COL_PACKAGE_ID)); + subject.addIsDefinedBy(parent == null ? UML.global_package : parent); + // + addStereotypes(subject, rs.getString(COL_EA_GUID)); + addTaggedValues(subject, objectId); + } + } + } catch (SQLException sqlException) { + throw new EAProjectExtractorException("Unable to import the EA project file: " + file.getAbsolutePath(), sqlException); + } finally { + if (rs != null) { + try { + rs.close(); + } catch (SQLException e) { + e.printStackTrace(); + } + } + if (statement != null) { + try { + statement.close(); + } catch (SQLException e) { + e.printStackTrace(); + } + } + if (connection != null) { + try { + connection.close(); + } catch (SQLException e) { + e.printStackTrace(); + } + } + } + } + + protected void extractAttributes() throws EAProjectExtractorException { + Connection connection = null; + Statement statement = null; + ResultSet rs = null; + try { + connection = getConnection(); + statement = connection.createStatement(); + rs = statement.executeQuery("select * from t_attribute"); + while (rs.next()) { + int objectId = rs.getInt(COL_OBJECT_ID); + OntResource id = objectIDs.getID(objectId); + if (id != null) { + String name = rs.getString(COL_NAME); + OntResource subject = createAttributeProperty(getXUID(rs), name); + subject.addDomain(id); + annotate(subject, rs.getString(COL_NOTES)); + subject.addIsDefinedBy(id.getIsDefinedBy()); + if (hasClassifier(rs)) { + int classifier = getClassifier(rs); + OntResource range = objectIDs.getID(classifier); + if (range != null) + subject.addRange(range); + else + System.out.println( + "Could not find the range of attribute " + name + ". Range ID = " + classifier); + } + String defaultValue = rs.getString(COL_DEFAULT); + if (defaultValue != null && "".equals(defaultValue)) { + subject.addProperty(UML.hasInitialValue, defaultValue); + } + // + addStereotypes(subject, rs.getString(COL_EA_GUID)); + addTaggedValues(subject, objectId); + } else + System.out.println("Could not find the domain of attribute " + rs.getString(COL_NAME) + + ". Domain ID = " + rs.getInt(COL_OBJECT_ID)); + } + } catch (SQLException sqlException) { + throw new EAProjectExtractorException("Unable to import the EA project file: " + file.getAbsolutePath(), sqlException); + } finally { + if (rs != null) { + try { + rs.close(); + } catch (SQLException e) { + e.printStackTrace(); + } + } + if (statement != null) { + try { + statement.close(); + } catch (SQLException e) { + e.printStackTrace(); + } + } + if (connection != null) { + try { + connection.close(); + } catch (SQLException e) { + e.printStackTrace(); + } + } + } + } + + protected void extractAssociations() throws EAProjectExtractorException { + Connection connection = null; + Statement statement = null; + ResultSet rs = null; + try { + connection = getConnection(); + statement = connection.createStatement(); + rs = statement.executeQuery("select * from t_connector"); + while (rs.next()) { + String type = rs.getString(COL_CONNECTOR_TYPE); + if (type.equals("Generalization") || type.equals("Association") || type.equals("Aggregation")) { + OntResource source = objectIDs.getID(rs.getInt(COL_START_OBJECT_ID)); + OntResource destin = objectIDs.getID(rs.getInt(COL_END_OBJECT_ID)); + if (source != null && destin != null) { + if (type.equals("Generalization")) { + source.addSuperClass(destin); + } else { + Role rolea = extractProperty( // + getXUID(rs), // + source, // + destin, // + rs.getString(COL_DEST_ROLE), // + rs.getString(COL_DEST_ROLE_NOTE), // + rs.getString(COL_DEST_CARD), // + rs.getInt(COL_DEST_IS_AGGREGATE), // + true); + Role roleb = extractProperty( // + getXUID(rs), // + destin, // + source, // + rs.getString(COL_SOURCE_ROLE), // + rs.getString(COL_SOURCE_ROLE_NOTE), // + rs.getString(COL_SOURCE_CARD), // + rs.getInt(COL_SOURCE_IS_AGGREGATE), // + false); + rolea.mate(roleb); + roleb.mate(rolea); + } + + // NOTE: We can and should support Stereotypes on connectors. We just need + // to determine what subject that they should be assigned to. Unsure of this. + // select Description from t_xref where Client = 'ea_guid of t_connector' and + // Name = 'Stereotypes' and Type = 'connector property'; // Stereotypes on + // connectors + } + } + } + } catch (SQLException sqlException) { + throw new EAProjectExtractorException("Unable to import the EA project file: " + file.getAbsolutePath(), sqlException); + } finally { + if (rs != null) { + try { + rs.close(); + } catch (SQLException e) { + e.printStackTrace(); + } + } + if (statement != null) { + try { + statement.close(); + } catch (SQLException e) { + e.printStackTrace(); + } + } + if (connection != null) { + try { + connection.close(); + } catch (SQLException e) { + e.printStackTrace(); + } + } + } + } + + private int getClassifier(ResultSet rs) throws SQLException { + String classifier = rs.getString("Classifier"); + return classifier != null ? Integer.parseInt(classifier) : 0; + } + + private boolean hasClassifier(ResultSet rs) throws SQLException { + return getClassifier(rs) != 0; + } + + private String getXUID(ResultSet rs) throws SQLException { + String xuid = rs.getString(COL_EA_GUID); + return "_" + xuid.substring(1, xuid.length() - 1); + } + +} diff --git a/CIMUtil/src/au/com/langdale/xmi/AbstractEAProjectExtractor.java b/CIMUtil/src/au/com/langdale/xmi/AbstractEAProjectExtractor.java new file mode 100644 index 00000000..e459f861 --- /dev/null +++ b/CIMUtil/src/au/com/langdale/xmi/AbstractEAProjectExtractor.java @@ -0,0 +1,152 @@ +/* + * This software is Copyright 2005,2006,2007,2008 Langdale Consultants. + * Langdale Consultants can be contacted at: http://www.langdale.com.au + */ +package au.com.langdale.xmi; + +import java.io.File; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import com.hp.hpl.jena.graph.FrontsNode; + +import au.com.langdale.kena.OntResource; + +public abstract class AbstractEAProjectExtractor extends XMIModel implements EAProjectExtractor { + + protected File file; + + protected IDList packageIDs = new IDList(100); + protected IDList objectIDs = new IDList(2000); + + private static String stereoPattern = "@STEREO;(.+?)@ENDSTEREO;"; + private static String name = "(.+?)=(.+?);"; + + private static Pattern pattern = Pattern.compile(stereoPattern); + private static Pattern namePattern = Pattern.compile(name); + + protected Map> stereotypesMap = new HashMap>(); + protected Map> taggedValuesMap = new HashMap>(); + + public AbstractEAProjectExtractor(File file) { + this.file = file; + } + + protected class TaggedValue { + public String name; + public String value; + + public TaggedValue(String name, String value) { + this.name = name; + this.value = (value != null ? value.trim() : value); + } + } + + @SuppressWarnings("serial") + protected class IDList extends ArrayList { + + public IDList(int size) { + super(size); + } + + public void putID(int index, OntResource id) { + while( index >= size()) { + add(null); + } + set(index, id); + } + + public OntResource getID(int index) { + if( index >= size() ) { + return null; + } + OntResource res = (OntResource) get(index); + return res; + } + } + + protected abstract void loadStereotypesCache() throws EAProjectExtractorException; + protected abstract void loadTaggedValuesCache() throws EAProjectExtractorException; + protected abstract void gatherPackageIDs() throws EAProjectExtractorException; + protected abstract void extractPackages() throws EAProjectExtractorException; + protected abstract void extractClasses() throws EAProjectExtractorException; + protected abstract void extractAssociations() throws EAProjectExtractorException; + protected abstract void extractAttributes() throws EAProjectExtractorException; + + protected void annotate(OntResource subject, String note) { + if (note == null) + return; + + note = note.trim(); + if (note.length() == 0) + return; + + subject.addComment(note, LANG); + } + + protected void addStereotypes(OntResource subject, String eaGUID) { + if (stereotypesMap.containsKey(eaGUID)) { + List stereotypesList = stereotypesMap.get(eaGUID); + for (String stereotypes : stereotypesList) { + Matcher matcher = pattern.matcher(stereotypes); + while (matcher.find()) { + String description = matcher.group(1); + Matcher stereoNameMatcher = namePattern.matcher(description); + while (stereoNameMatcher.find()) { + String groupName = stereoNameMatcher.group(1); + if ("Name".equals(groupName)) { + String stereoName = stereoNameMatcher.group(2); + subject.addProperty(UML.hasStereotype, createStereotypeByName(stereoName)); + } + } + } + } + } + } + + protected void addTaggedValues(OntResource subject, int objectId) { + if (taggedValuesMap.containsKey(objectId)) { + List taggedValuesList = taggedValuesMap.get(objectId); + for (TaggedValue taggedValue : taggedValuesList) { + FrontsNode property = Translator.annotationResource(taggedValue.name); + if (subject != null && property != null && taggedValue.value != null) { + subject.addProperty(property, taggedValue.value); + } + } + } + } + + protected Role extractProperty(String xuid, OntResource source, OntResource destin, String name, String note, String card, int aggregate, boolean sideA) { + Role role = new Role(); + role.property = createObjectProperty(xuid, sideA, name); + annotate(role.property, note); + role.property.addIsDefinedBy(source.getIsDefinedBy()); // FIXME: the package of an association is not always that of the source class + role.range = destin; + switch (aggregate) { + case 1: // Aggregate + role.aggregate = true; + role.composite = false; + break; + case 2: // Composite + role.aggregate = false; + role.composite = true; + break; + default: + role.aggregate = false; + role.composite = false; + break; + } + if( card.equals("1") || card.endsWith("..1")) + role.upper = 1; + if( card.equals("*") || card.startsWith("0..")) + role.lower = 0; + else + role.lower = 1; + return role; + } + +} diff --git a/CIMUtil/src/au/com/langdale/xmi/EAPExtractor.java b/CIMUtil/src/au/com/langdale/xmi/EAPExtractor.java index b47f1cf6..acadd855 100644 --- a/CIMUtil/src/au/com/langdale/xmi/EAPExtractor.java +++ b/CIMUtil/src/au/com/langdale/xmi/EAPExtractor.java @@ -1,51 +1,98 @@ +/* + * This software is Copyright 2005,2006,2007,2008 Langdale Consultants. + * Langdale Consultants can be contacted at: http://www.langdale.com.au + */ package au.com.langdale.xmi; import java.io.File; import java.io.IOException; import java.util.ArrayList; +import java.util.HashMap; import java.util.Iterator; +import java.util.List; import java.util.Map; -import au.com.langdale.kena.OntResource; - import com.healthmarketscience.jackcess.Database; +import com.healthmarketscience.jackcess.DatabaseBuilder; import com.healthmarketscience.jackcess.Table; +import au.com.langdale.kena.OntResource; -public class EAPExtractor extends XMIModel { +public class EAPExtractor extends AbstractEAProjectExtractor { - private File file; private Database db; - private IDList packageIDs = new IDList(100); - private IDList objectIDs = new IDList(2000); - public EAPExtractor(File file) { - this.file = file; + super(file); } - - public void run() throws IOException { - db = Database.open(file, true); + + public void run() throws EAProjectExtractorException { try { + db = DatabaseBuilder.open(file); + // + loadStereotypesCache(); + loadTaggedValuesCache(); gatherPackageIDs(); extractPackages(); extractClasses(); extractAssociations(); extractAttributes(); + } catch (IOException ioException) { + ioException.printStackTrace(System.err); + throw new EAProjectExtractorException("Unable to import the EA project file: " + file.getAbsolutePath(), + ioException); + } finally { + try { + db.close(); + } catch (IOException e) { + // Do nothing... + } + } + } + + protected void loadStereotypesCache() throws EAProjectExtractorException { + stereotypesMap = new HashMap>(); + Iterator it = getXRefTable().iterator(); + while (it.hasNext()) { + Row row = new Row(it.next()); + if (row.getName().equals("Stereotypes")) { + if (stereotypesMap.containsKey(row.getClient())) { + List stereotypesList = stereotypesMap.get(row.getClient()); + stereotypesList.add(row.getDescription()); + } else { + List stereotypesList = new ArrayList(); + stereotypesList.add(row.getDescription()); + stereotypesMap.put(row.getClient(), stereotypesList); + } + } } - finally { - db.close(); + } + + protected void loadTaggedValuesCache() throws EAProjectExtractorException { + taggedValuesMap = new HashMap>(); + Iterator it = getObjectPropertiesTable().iterator(); + while (it.hasNext()) { + Row row = new Row(it.next()); + if (taggedValuesMap.containsKey(row.getObjectID())) { + List taggedValuesList = taggedValuesMap.get(row.getObjectID()); + taggedValuesList.add(new TaggedValue(row.getProperty(), row.getValue())); + } else { + List taggedValuesList = new ArrayList(); + taggedValuesList.add(new TaggedValue(row.getProperty(), row.getValue())); + taggedValuesMap.put(row.getObjectID(), taggedValuesList); + } } } - private void gatherPackageIDs() throws IOException { + protected void gatherPackageIDs() throws EAProjectExtractorException { OntResource top = createGlobalPackage(); - - Iterator it = getPackageTable().iterator(); - while( it.hasNext()) { + + Table table = getPackageTable(); + Iterator it = table.iterator(); + while (it.hasNext()) { Row row = new Row(it.next()); OntResource subject; - if( row.getName().equals("Model")) + if (row.getName().equals("Model")) subject = top; else subject = createIndividual(row.getXUID(), row.getName(), UML.Package); @@ -53,129 +100,167 @@ private void gatherPackageIDs() throws IOException { } } - private void extractPackages() throws IOException { + protected void extractPackages() throws EAProjectExtractorException { Iterator it = getPackageTable().iterator(); - while( it.hasNext()) { + while (it.hasNext()) { Row row = new Row(it.next()); OntResource subject = packageIDs.getID(row.getPackageID()); - if(! subject.equals(UML.global_package)) { - OntResource parent = packageIDs.getID( row.getParentID()); - subject.addIsDefinedBy(parent == null? UML.global_package: parent); + if (!subject.equals(UML.global_package)) { + OntResource parent = packageIDs.getID(row.getParentID()); + subject.addIsDefinedBy(parent == null ? UML.global_package : parent); annotate(subject, row.getNotes()); + // + addStereotypes(subject, row.getEAGUID()); + // For packages the Object_ID is actually located in the t_object table so we + // must obtain that first... + // addTaggedValues(subject, objectId); } } } - private void annotate(OntResource subject, String note) { - if( note == null) - return; - - note = note.trim(); - if( note.length() == 0) - return; - - subject.addComment(note, LANG); - } - - private void extractClasses() throws IOException { + protected void extractClasses() throws EAProjectExtractorException { Iterator it = getObjectTable().iterator(); - while( it.hasNext()) { + while (it.hasNext()) { Row row = new Row(it.next()); - if( row.getObjectType().equals("Class")) { + if (row.getObjectType().equals("Class")) { OntResource subject = createClass(row.getXUID(), row.getName()); objectIDs.putID(row.getObjectID(), subject); - annotate( subject, row.getNote()); - OntResource parent = packageIDs.getID( row.getPackageID()); - subject.addIsDefinedBy(parent == null? UML.global_package: parent); - if( row.hasStereotype()) - subject.addProperty(UML.hasStereotype, createStereotypeByName(row.getStereotype())); + annotate(subject, row.getNote()); + OntResource parent = packageIDs.getID(row.getPackageID()); + subject.addIsDefinedBy(parent == null ? UML.global_package : parent); + // + addStereotypes(subject, row.getEAGUID()); + addTaggedValues(subject, row.getObjectID()); } -// else -// System.out.println("Ignoring object type " + row.getObjectType() + " id " + row.getObjectID()); } } - private void extractAttributes() throws IOException { + protected void extractAttributes() throws EAProjectExtractorException { Iterator it = getAttributeTable().iterator(); - while( it.hasNext()) { + while (it.hasNext()) { Row row = new Row(it.next()); OntResource id = objectIDs.getID(row.getObjectID()); - if( id != null ) { + if (id != null) { OntResource subject = createAttributeProperty(row.getXUID(), row.getName()); subject.addDomain(id); - annotate( subject, row.getNotes()); + annotate(subject, row.getNotes()); subject.addIsDefinedBy(id.getIsDefinedBy()); - if( row.hasClassifier()) { + if (row.hasClassifier()) { OntResource range = objectIDs.getID(row.getClassifier()); - if( range != null) + if (range != null) subject.addRange(range); else - System.out.println("Could not find the range of attribute " + row.getName() + ". Range ID = " + row.getClassifier()); + System.out.println("Could not find the range of attribute " + row.getName() + ". Range ID = " + + row.getClassifier()); } - if( row.hasDefault()) + if (row.hasDefault()) { subject.addProperty(UML.hasInitialValue, row.getDefault()); - if( row.hasStereotype()) - subject.addProperty(UML.hasStereotype, createStereotypeByName(row.getStereotype())); - } - else - System.out.println("Could not find the domain of attribute " + row.getName() + ". Domain ID = " + row.getObjectID()); + } + // + addStereotypes(subject, row.getEAGUID()); + addTaggedValues(subject, row.getObjectID()); + } else + System.out.println("Could not find the domain of attribute " + row.getName() + ". Domain ID = " + + row.getObjectID()); } } - private void extractAssociations() throws IOException { + protected void extractAssociations() throws EAProjectExtractorException { Iterator it = getConnectorTable().iterator(); - while( it.hasNext()) { + while (it.hasNext()) { Row row = new Row(it.next()); String type = row.getConnectorType(); - if( type.equals("Generalization") || type.equals("Association")) { + if (type.equals("Generalization") || type.equals("Association") || type.equals("Aggregation")) { OntResource source = objectIDs.getID(row.getStartObjectID()); OntResource destin = objectIDs.getID(row.getEndObjectID()); - if( source != null && destin != null) { - if( type.equals("Generalization")) { + if (source != null && destin != null) { + if (type.equals("Generalization")) { source.addSuperClass(destin); - } - else { - Role rolea = extractProperty(row.getXUID(), source, destin, row.getDestRole(), row.getDestRoleNote(), row.getDestCard(), row.getDestIsAggregate(), true); - Role roleb = extractProperty(row.getXUID(), destin, source, row.getSourceRole(), row.getSourceRoleNote(), row.getSourceCard(), row.getSourceIsAggregate(), false); + } else { + Role rolea = extractProperty( // + row.getXUID(), // + source, // + destin, // + row.getDestRole(), // + row.getDestRoleNote(), // + row.getDestCard(), // + row.getDestIsAggregate(), // + true); + Role roleb = extractProperty( // + row.getXUID(), // + destin, // + source, // + row.getSourceRole(), // + row.getSourceRoleNote(), // + row.getSourceCard(), // + row.getSourceIsAggregate(), // + false); rolea.mate(roleb); roleb.mate(rolea); } } - } } } - private Role extractProperty(String xuid, OntResource source, OntResource destin, String name, String note, String card, boolean aggregate, boolean sideA) { - Role role = new Role(); - role.property = createObjectProperty(xuid, sideA, name); - annotate( role.property, note); - role.property.addIsDefinedBy(source.getIsDefinedBy()); // FIXME: the package of an association is not always that of the source class - role.range = destin; - role.aggregate = aggregate; - if( card.equals("1") || card.endsWith("..1")) - role.upper = 1; - if( card.equals("*") || card.startsWith("0..")) - role.lower = 0; - else - role.lower = 1; - return role; + private Table getPackageTable() throws EAProjectExtractorException { + Table table = null; + try { + table = db.getTable("t_package"); + } catch (IOException ioe) { + throw new EAProjectExtractorException(ioe); + } + return table; + } + + private Table getObjectTable() throws EAProjectExtractorException { + Table table = null; + try { + table = db.getTable("t_object"); + } catch (IOException ioe) { + throw new EAProjectExtractorException(ioe); + } + return table; } - private Table getPackageTable() throws IOException { - return db.getTable("t_package"); + private Table getObjectPropertiesTable() throws EAProjectExtractorException { + Table table = null; + try { + table = db.getTable("t_objectproperties"); + } catch (IOException ioe) { + throw new EAProjectExtractorException(ioe); + } + return table; } - private Table getObjectTable() throws IOException { - return db.getTable("t_object"); + private Table getConnectorTable() throws EAProjectExtractorException { + Table table = null; + try { + table = db.getTable("t_connector"); + } catch (IOException ioe) { + throw new EAProjectExtractorException(ioe); + } + return table; } - private Table getConnectorTable() throws IOException { - return db.getTable("t_connector"); + private Table getXRefTable() throws EAProjectExtractorException { + Table table = null; + try { + table = db.getTable("t_xref"); + } catch (IOException ioe) { + throw new EAProjectExtractorException(ioe); + } + return table; } - private Table getAttributeTable() throws IOException { - return db.getTable("t_attribute"); + private Table getAttributeTable() throws EAProjectExtractorException { + Table table = null; + try { + table = db.getTable("t_attribute"); + } catch (IOException ioe) { + throw new EAProjectExtractorException(ioe); + } + return table; } private class Row { @@ -184,140 +269,131 @@ private class Row { Row(Object raw) { fields = (Map) raw; } - + + public String getDescription() { + return getString("Description"); + } + int getObjectID() { return getInt("Object_ID"); } - + int getPackageID() { return getInt("Package_ID"); } - + int getParentID() { return getInt("Parent_ID"); } - + int getStartObjectID() { return getInt("Start_Object_ID"); } - + int getEndObjectID() { return getInt("End_Object_ID"); } - + int getClassifier() { Object raw = fields.get("Classifier"); - return raw != null ? Integer.parseInt(raw.toString()): 0; + return raw != null ? Integer.parseInt(raw.toString()) : 0; } - + boolean hasClassifier() { return getClassifier() != 0; } + String getEAGUID() { + String eaGUID = fields.get("ea_guid").toString(); + return eaGUID; + } + String getXUID() { String xuid = fields.get("ea_guid").toString(); - return "_" + xuid.substring(1, xuid.length()-1); + return "_" + xuid.substring(1, xuid.length() - 1); } - + + public String getClient() { + return getString("Client"); + } + String getName() { return getString("Name"); } - + String getObjectType() { return getString("Object_Type"); } - + String getConnectorType() { return getString("Connector_Type"); } - + String getNote() { return getString("Note"); } - + String getNotes() { return getString("Notes"); } - - String getStereotype() { - return fields.get("Stereotype").toString(); - } - - boolean hasStereotype() { - return fields.get("Stereotype") != null; - } - + boolean hasDefault() { return fields.get("Default") != null; } - + String getDefault() { return fields.get("Default").toString(); } - + String getDestRole() { return getString("DestRole"); } - + String getDestRoleNote() { return getString("DestRoleNote"); } - + String getDestCard() { return getString("DestCard"); } - - boolean getDestIsAggregate() { - return getInt("DestIsAggregate") == 1; + + int getDestIsAggregate() { + return getInt("DestIsAggregate"); } - + String getSourceRole() { return getString("SourceRole"); } - + String getSourceRoleNote() { return getString("SourceRoleNote"); } - + String getSourceCard() { return getString("SourceCard"); } - - boolean getSourceIsAggregate() { - return getInt("SourceIsAggregate") == 1; - } - - int getInt( String name ) { - Object raw = fields.get(name); - return (raw instanceof Integer)? ((Integer)raw).intValue(): 0; + + int getSourceIsAggregate() { + return getInt("SourceIsAggregate"); } - String getString( String name ) { - Object raw = fields.get(name); - return raw != null ? raw.toString(): ""; + public String getProperty() { + return getString("Property"); } - } - - @SuppressWarnings("serial") - private class IDList extends ArrayList { - - public IDList(int size) { - super(size); + + public String getValue() { + return getString("Value"); } - public void putID(int index, OntResource id) { - while( index >= size()) { - add(null); - } - set(index, id); + int getInt(String name) { + Object raw = fields.get(name); + return (raw instanceof Integer) ? ((Integer) raw).intValue() : 0; } - - public OntResource getID(int index) { - if( index >= size() ) { - return null; - } - OntResource res = (OntResource) get(index); - return res; + + String getString(String name) { + Object raw = fields.get(name); + return raw != null ? raw.toString() : ""; } } + } diff --git a/CIMUtil/src/au/com/langdale/xmi/EAProjectExtractor.java b/CIMUtil/src/au/com/langdale/xmi/EAProjectExtractor.java new file mode 100644 index 00000000..f9b40dbd --- /dev/null +++ b/CIMUtil/src/au/com/langdale/xmi/EAProjectExtractor.java @@ -0,0 +1,15 @@ +/* + * This software is Copyright 2005,2006,2007,2008 Langdale Consultants. + * Langdale Consultants can be contacted at: http://www.langdale.com.au + */ +package au.com.langdale.xmi; + +import au.com.langdale.kena.OntModel; + +public interface EAProjectExtractor { + + public void run() throws EAProjectExtractorException; + + public OntModel getModel(); + +} diff --git a/CIMUtil/src/au/com/langdale/xmi/EAProjectExtractorException.java b/CIMUtil/src/au/com/langdale/xmi/EAProjectExtractorException.java new file mode 100644 index 00000000..78f44fd6 --- /dev/null +++ b/CIMUtil/src/au/com/langdale/xmi/EAProjectExtractorException.java @@ -0,0 +1,31 @@ +/* + * This software is Copyright 2005,2006,2007,2008 Langdale Consultants. + * Langdale Consultants can be contacted at: http://www.langdale.com.au + */ +package au.com.langdale.xmi; + +public class EAProjectExtractorException extends Exception { + + private static final long serialVersionUID = 1L; + + public EAProjectExtractorException() { + } + + public EAProjectExtractorException(String message) { + super(message); + } + + public EAProjectExtractorException(Throwable cause) { + super(cause); + } + + public EAProjectExtractorException(String message, Throwable cause) { + super(message, cause); + } + + public EAProjectExtractorException(String message, Throwable cause, boolean enableSuppression, + boolean writableStackTrace) { + super(message, cause, enableSuppression, writableStackTrace); + } + +} diff --git a/CIMUtil/src/au/com/langdale/xmi/EAProjectExtractorFactory.java b/CIMUtil/src/au/com/langdale/xmi/EAProjectExtractorFactory.java new file mode 100644 index 00000000..78fd2d66 --- /dev/null +++ b/CIMUtil/src/au/com/langdale/xmi/EAProjectExtractorFactory.java @@ -0,0 +1,32 @@ +/* + * This software is Copyright 2005,2006,2007,2008 Langdale Consultants. + * Langdale Consultants can be contacted at: http://www.langdale.com.au + */ +package au.com.langdale.xmi; + +import java.io.File; + +/** + * Static factory class for creating extractors specialized for specific EA + * Project files. + * + */ +public class EAProjectExtractorFactory { + + public static EAProjectExtractor createExtractor(File file) { + String ext = file.getName().substring(file.getName().lastIndexOf(".") + 1).toLowerCase(); + switch (ext) { + case "eap": + case "eapx": + return new EAPExtractor(file); + case "qea": + case "qeax": + return new QEAExtractor(file); + case "feap": + return new FEAPExtractor(file); + default: + throw new IllegalArgumentException("Unsupported EA project file type: " + ext); + } + } + +} diff --git a/CIMUtil/src/au/com/langdale/xmi/FEAPExtractor.java b/CIMUtil/src/au/com/langdale/xmi/FEAPExtractor.java new file mode 100644 index 00000000..d8b32dea --- /dev/null +++ b/CIMUtil/src/au/com/langdale/xmi/FEAPExtractor.java @@ -0,0 +1,42 @@ +/* + * This software is Copyright 2005,2006,2007,2008 Langdale Consultants. + * Langdale Consultants can be contacted at: http://www.langdale.com.au + */ +package au.com.langdale.xmi; + +import java.io.File; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.SQLException; + +public class FEAPExtractor extends AbstractEAProjectDBExtractor { + + private static final String USERNAME = "SYSDBA"; + private static final String PASSWORD = "masterkey"; + + public FEAPExtractor(File file) { + super(file); + } + + @Override + protected void dbInit() throws SQLException { + try { + Class.forName("org.firebirdsql.jdbc.FBDriver"); + } catch (ClassNotFoundException e) { + System.err.println("Firebird JDBC driver not found."); + e.printStackTrace(System.err); + throw new RuntimeException(e); + } + } + + @Override + protected Connection getConnection() throws SQLException { + /** + * The default Firebird DB administrator credentials are SYSDBA/masterkey. EA + * Firebird project files (.feap) can be accessed with these defaults. + */ + String connectionURL = "jdbc:firebirdsql:embedded:" + file.getAbsolutePath(); + return DriverManager.getConnection(connectionURL, USERNAME, PASSWORD); + } + +} diff --git a/CIMUtil/src/au/com/langdale/xmi/QEAExtractor.java b/CIMUtil/src/au/com/langdale/xmi/QEAExtractor.java new file mode 100644 index 00000000..add014ae --- /dev/null +++ b/CIMUtil/src/au/com/langdale/xmi/QEAExtractor.java @@ -0,0 +1,28 @@ +/* + * This software is Copyright 2005,2006,2007,2008 Langdale Consultants. + * Langdale Consultants can be contacted at: http://www.langdale.com.au + */ +package au.com.langdale.xmi; + +import java.io.File; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.SQLException; + +public class QEAExtractor extends AbstractEAProjectDBExtractor { + + public QEAExtractor(File file) { + super(file); + } + + @Override + protected void dbInit() { + // Nothing to initialize for SQLite as the JDBC Driver is self-registering + } + + @Override + protected Connection getConnection() throws SQLException { + String connectionURL = "jdbc:sqlite:" + file.getAbsolutePath(); + return DriverManager.getConnection(connectionURL); + } +} diff --git a/CIMUtil/src/au/com/langdale/xmi/UML.java b/CIMUtil/src/au/com/langdale/xmi/UML.java index 830c33b5..77d952ed 100644 --- a/CIMUtil/src/au/com/langdale/xmi/UML.java +++ b/CIMUtil/src/au/com/langdale/xmi/UML.java @@ -130,7 +130,7 @@ public static void loadOntology( OntModel model ) { model.createIndividual(enumliteral.getURI(), Stereotype).addLabel("enum", null); model.createIndividual(union.getURI(), Stereotype).addLabel("Union", null); model.createIndividual(extendedBy.getURI(), Stereotype).addLabel("Extended By", null); - model.createIndividual(extension.getURI(), Stereotype).addLabel("Extension Class", null); + model.createIndividual(extension.getURI(), Stereotype).addLabel("Extension", null); model.createIndividual(primitive.getURI(), Stereotype).addLabel("Primitive", null); model.createIndividual(base.getURI(), Stereotype).addLabel("Base", null); model.createIndividual(cimdatatype.getURI(), Stereotype).addLabel("CIMDatatype", null); diff --git a/CIMUtil/src/au/com/langdale/xmi/XMIModel.java b/CIMUtil/src/au/com/langdale/xmi/XMIModel.java index a10f0d10..7dba736c 100644 --- a/CIMUtil/src/au/com/langdale/xmi/XMIModel.java +++ b/CIMUtil/src/au/com/langdale/xmi/XMIModel.java @@ -380,7 +380,7 @@ public class Role { /** * Interpret this association role in the context of its mate. - * Establish the OWL domain and rage. Interpret the UML + * Establish the OWL domain and range. Interpret the UML * multiplicity as OWL functional and inverse functional * property types. */ diff --git a/CIMUtil/src/au/com/langdale/xmi/XMIParser.java b/CIMUtil/src/au/com/langdale/xmi/XMIParser.java index 77b8fd5c..55d60c7e 100644 --- a/CIMUtil/src/au/com/langdale/xmi/XMIParser.java +++ b/CIMUtil/src/au/com/langdale/xmi/XMIParser.java @@ -19,10 +19,9 @@ import org.xml.sax.SAXException; import org.xml.sax.XMLReader; -import au.com.langdale.kena.OntResource; - import com.hp.hpl.jena.graph.FrontsNode; +import au.com.langdale.kena.OntResource; import au.com.langdale.sax.XMLElement; import au.com.langdale.sax.XMLInterpreter; import au.com.langdale.sax.XMLMode; @@ -59,9 +58,9 @@ public InputSource resolveEntity(String arg0, String arg1) throws SAXException, return new InputSource(new StringReader("")); }}); - // kick off in global package mode - can vacumn up elements that - // slip outside the Model element in some xmi dialects - reader.setContentHandler( new XMLInterpreter( new PackageMode() )); + // kick off in global package mode - can vacuum up elements that + // slip outside the Model element in some XMI dialects + reader.setContentHandler(new XMLInterpreter(new PackageMode())); reader.parse(source); } diff --git a/README.md b/README.md index dd8a6071..8257c1cf 100644 --- a/README.md +++ b/README.md @@ -35,9 +35,9 @@ For further details on how to use CIMTool to create and edit profiles based on t ## Latest Release - - 2.0.1 + - 2.1.0 - - The latest release is available here on GitHub at [CIMTool-2.0.1](https://github.com/ucaiug/CIMTool/releases) and is delivered as a ZIP file. Releases are also made available in the CIMug [tools download folder](https://cimug.ucaiug.org/Standards%20Artifacts/Forms/AllItems.aspx?RootFolder=%2FStandards%20Artifacts%2FUCA%20TF%20Tools&FolderCTID=0x0120001062F2F1DF27704DBB748ABBDC3B3AA2&View=%7BFEBD8EE1%2D6B40%2D42F6%2DB228%2DCCF131291FBE%7D) on the UCAIug website. + - The latest release is available here on GitHub at [CIMTool-2.1.0](https://github.com/ucaiug/CIMTool/releases) and is delivered as a ZIP file. Releases are also made available in the CIMug [tools download folder](https://cimug.ucaiug.org/Standards%20Artifacts/Forms/AllItems.aspx?RootFolder=%2FStandards%20Artifacts%2FUCA%20TF%20Tools&FolderCTID=0x0120001062F2F1DF27704DBB748ABBDC3B3AA2&View=%7BFEBD8EE1%2D6B40%2D42F6%2DB228%2DCCF131291FBE%7D) on the UCAIug website. - Information on features and fixes for the release can be found [here](https://cimtool.ucaiug.io/release-notes). ## Installation & Setup diff --git a/com.cimphony.cimtoole/META-INF/MANIFEST.MF b/com.cimphony.cimtoole/META-INF/MANIFEST.MF index 46ec2c65..2bc9e071 100644 --- a/com.cimphony.cimtoole/META-INF/MANIFEST.MF +++ b/com.cimphony.cimtoole/META-INF/MANIFEST.MF @@ -8,7 +8,7 @@ Bundle-RequiredExecutionEnvironment: JavaSE-20 Require-Bundle: org.eclipse.emf.ecore;bundle-version="2.5.0", org.eclipse.emf;bundle-version="2.5.0", au.com.langdale.cimutil;bundle-version="1.8.2", - au.com.langdale.rcputil;bundle-version="2.0.1", + au.com.langdale.rcputil;bundle-version="2.1.0", org.eclipse.core.resources, org.eclipse.core.runtime, au.com.langdale.kena, diff --git a/com.cimphony.cimtoole/src/com/cimphony/cimtoole/wizards/ImportRegistrySchema.java b/com.cimphony.cimtoole/src/com/cimphony/cimtoole/wizards/ImportRegistrySchema.java index ce81f118..5967d300 100644 --- a/com.cimphony.cimtoole/src/com/cimphony/cimtoole/wizards/ImportRegistrySchema.java +++ b/com.cimphony.cimtoole/src/com/cimphony/cimtoole/wizards/ImportRegistrySchema.java @@ -9,7 +9,6 @@ import java.io.IOException; import java.nio.charset.Charset; -import org.apache.poi.util.IOUtils; import org.eclipse.core.resources.IFile; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IStatus; @@ -26,46 +25,46 @@ import au.com.langdale.cimtoole.project.Info; import au.com.langdale.cimtoole.project.Task; -import au.com.langdale.util.Jobs; public class ImportRegistrySchema extends Wizard implements IImportWizard { - + private RegistrySchemaWizardPage main = new RegistrySchemaWizardPage(); - + public void init(IWorkbench workbench, IStructuredSelection selection) { - setWindowTitle("Import Schema"); + setWindowTitle("Import Schema"); setNeedsProgressMonitor(true); main.setTitle(getWindowTitle()); main.setDescription("Import an additional schema from the registry."); main.setSelected(selection); } - + @Override - public void addPages() { - addPage(main); - } - + public void addPages() { + addPage(main); + } + @Override public boolean performFinish() { EPackage ePackage = main.getEPackage(); String ns = ePackage.getNsURI(); - if (!ns.endsWith("#")) ns += "#"; + if (!ns.endsWith("#")) + ns += "#"; ByteArrayOutputStream buf = new ByteArrayOutputStream(); - try{ - buf.write(ePackage.getNsURI().getBytes(Charset.forName("UTF-8"))); - buf.write('\n'); - - IFile file = main.getFile(); - if (!file.exists()) - file.create(new ByteArrayInputStream(buf.toByteArray()), false, new NullProgressMonitor()); - else - file.setContents(new ByteArrayInputStream(buf.toByteArray()), false, true, new NullProgressMonitor()); - Info.putProperty( file, Task.SCHEMA_NAMESPACE, ns); - }catch (IOException ex){ + try { + buf.write(ePackage.getNsURI().getBytes(Charset.forName("UTF-8"))); + buf.write('\n'); + + IFile file = main.getFile(); + if (!file.exists()) + file.create(new ByteArrayInputStream(buf.toByteArray()), false, new NullProgressMonitor()); + else + file.setContents(new ByteArrayInputStream(buf.toByteArray()), false, true, new NullProgressMonitor()); + Info.putProperty(file, Task.SCHEMA_NAMESPACE, ns); + } catch (IOException ex) { ErrorDialog.openError(this.getShell(), "IO Error", ex.getMessage(), new Status(IStatus.ERROR, CimphonyCIMToolPlugin.PLUGIN_ID, ex.getMessage(), ex)); return false; - }catch (CoreException ex){ + } catch (CoreException ex) { ErrorDialog.openError(this.getShell(), "Core Exception", ex.getMessage(), new Status(IStatus.ERROR, CimphonyCIMToolPlugin.PLUGIN_ID, ex.getMessage(), ex)); return false; diff --git a/docs/developers/package-deploy.md b/docs/developers/package-deploy.md index 2dad4205..59b97f68 100644 --- a/docs/developers/package-deploy.md +++ b/docs/developers/package-deploy.md @@ -44,7 +44,7 @@ The **Export** dialog provides two destination options for exporting the **CIMTo The configuration settings highlighted in the next screenshot are for exporting as an archive. A couple of items to highlight: -1. The **Root directory** field is required and specifies the name of the directory that will appear within the archive file and which will serve as the root directory when extracting. For the purposes of CIMTool the naming convention should be adhered to for each release: ```CIMTool``` +1. The **Root directory** field is required and specifies the name of the directory that will appear within the archive file and which will serve as the root directory when extracting. For the purposes of CIMTool a naming convention that includes the semantic version should be matched to that for the release being deployed: ```CIMTool-x.x.x``` (e.g. CIMTool-2.1.0) 2. The **"Synchronize before exporting"** option should be checked. diff --git a/docs/getting-started.md b/docs/getting-started.md index 6dc67b65..85d3987e 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -6,7 +6,7 @@ Download the latest binary release of **CIMTool** [here](https://github.com/cimu !!! example - Extracting to `D:\CIMTool-2.0.1` folder on a Windows system would result in a new `D:\CIMTool-2.0.1\CIMTool` folder containing **CIMTool** and it dependencies. The launchable executable would be located at `D:\CIMTool-2.0.1\CIMTool\CIMTool.exe` + Extracting to the `D:\` folder on a Windows system would result in a new `D:\CIMTool-2.1.0` folder containing **CIMTool** and it dependencies. The launchable executable would be located at `D:\CIMTool-2.1.0\CIMTool.exe` ## Step 2 - Install Java Starting with **CIMTool** release 2.0.0 and later you no longer need to download and install a Java runtime environment. Instead, the appropriate release of Java now comes bundled in the ZIP archive. All that is needed is to extract the ZIP file and then launch the CIMTool executable (i.e. `CIMTool.exe`). This greatly simplifies the installation process and if installing such a release you may skip over this step and proceed on to Step 3 below. diff --git a/docs/images/deploy-cim-tool-4.png b/docs/images/deploy-cim-tool-4.png index adf75acc..828142e6 100644 Binary files a/docs/images/deploy-cim-tool-4.png and b/docs/images/deploy-cim-tool-4.png differ diff --git a/docs/release-notes.md b/docs/release-notes.md index fdd48708..bef2ea71 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -3,6 +3,27 @@ This section contains CIMTool release notes and can be used for quick reference as those available on GitHub [here](https://github.com/cimug-org/CIMTool/releases), but contain more versions since this log pre-dates GitHub being the version control system for CIMTool. +### Release 2.1.0 [09-Aug-2024] + +CIMTool 2.1.0 is a minor release with some useful enhancements and an important defect fix. + +Enhancement [Issue #108](https://github.com/cimug-org/CIMTool/issues/108): +CIMTool did not yet support the new .qea and .qeax (64-bit) EA project file format introduced in the 64-bit Sparx EA 16.x releases. The new .qea and qeax file are now based on SQLite. + +Enhancement [Issue #114](https://github.com/cimug-org/CIMTool/issues/114): +CIMTool did not yet support the .eapx and .feap (32-bit) EA project file formats available in the 32-bit Sparx EA 15.x releases. The .feap format is an embedded Firebird database that works across both EA 15.x 32-bit and EA 16.x 64-bit release of the product. This specific type of EA project file is the only only file format that can be shared between both 32-bit Sparx EA 15.x and 64-bit EA 16.x releases. Note that this enhancements intersects the work identified in [Issue #108](https://github.com/cimug-org/CIMTool/issues/108). + +Enhancement [Issue #118](https://github.com/cimug-org/CIMTool/issues/118): +This issues introduces a new builder to generate a [LinkML](https://linkml.io) representation of a CIMTool profile and is useful for a wide variety of downstream processing. The output from this builder can be leverage LinkML's core python toolchain which includes functionality like generators to convert schemas to other modeling languages and data converters and validators for working with data that conforms to LinkML (including RDF, JSON, and TSV). The following offer some useful background as to what LinkML is and how it can be leveraged: [LinkML FAQ](https://linkml.io/linkml/faq/modeling.html) and [LinkML Documentation](https://linkml.io/linkml/) + +Enhancement [Issue #133](https://github.com/cimug-org/CIMTool/issues/133): +PNNL has contributed two new XSLT custom builders (see: [cimantic-graphs](https://cimtool-builders.ucaiug.io/custom-builders/cimantic-graphs/builder.html)) that generate python-based code for working with semantic graphs. These have been added as OOTB builders. Thanks to Alex Anderson for his contribution to the CIM community! + +Defect [Issue #131](https://github.com/cimug-org/CIMTool/issues/131): +Aggregation relationships between classes were not appearing in the "Project Model" view in CIMTool (only associations and generalizations were visible). Thanks to Walter Concert for catching and reporting the issue. + +NOTE: This release does not yet address the issues as reported in the 2.0.1 release notes. Fixes for custom extensions in RDFS XSLT builders are now targeted for the 2.2.0 release. + ### Release 2.0.1 [12-May-2024] CIMTool 2.0.1 is a patch release and should be utilized in place of CIMTool 2.0.0 until release 2.1.0 is finalized and made public.