-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Import elements are ordered Message schema fixes Structures, proxy, appinfo schema documents now generated, not copied Version 1.0-alpha.2
- Loading branch information
1 parent
b0ece6c
commit f720e6e
Showing
46 changed files
with
1,461 additions
and
1,231 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,67 +10,41 @@ For more information on NIEMOpen, see the project's website at [www.niemopen.org | |
|
||
General questions about OASIS Open Projects may be directed to OASIS staff at [[email protected]](mailto:[email protected]) | ||
|
||
## What's new in version 1.0-alpha.1 | ||
|
||
* Create NIEM 6 source and message document piles from NIEM 5 model | ||
* Every schema document gets a Namespace object; SchemaDocument removed | ||
* Fixed many URIs in source, resource, test files | ||
* DefinitionText changed to DocumentationText in CMF 1.0 | ||
* Recognize adapter representation term in addition to appinfo:externalAdapterTypeIndicator | ||
* Many changes to the JUnit tests. | ||
|
||
## What's new in version 0.7-alpha.6 (12 December) | ||
|
||
* CMF to message schema is working | ||
* Most of the augmentation examples are working (but not augmentations on every object) | ||
* Built-in schema documents are from the PS01 release | ||
|
||
## What's new in version 0.7-alpha.5 (14 November) | ||
|
||
* NIEM 6 XSD generation uses builtin schema documents from NIEM 6 PSD01 | ||
* Entire NIEM 6 PSD 01 model converts to CMF and back to XSD | ||
* Handle several annoying differences between Windows and Linux JRE | ||
* Many other bugs fixed | ||
|
||
## What's new in version 0.7-alpha.4 (26 September) | ||
|
||
* Many many bugs fixed | ||
* Entire NIEM 5 model converts to CMF and back to XSD | ||
* The usual builtin schema documents now obtained from the JAR file | ||
* NIEM 6 XSD generation still doesn't work | ||
|
||
## What's new in version 0.7-alpha.3 (9 August) | ||
|
||
* New features in CMF to XSD commands | ||
* `cmftool m2xref` renamed to `cmftool m2xsrc` | ||
* Option to generate xml-catalog.xsd file | ||
* Option to specify name of generated XML Catalog file | ||
* Option to specify message schema "root namespace" with all needed import elements | ||
|
||
## What's new in version 0.7-alpha.2 | ||
|
||
* Now generates CMF version 0.8, which is based on NIEM 6 | ||
* There are NIEM 6 builtin schema documents in *src/main/dist/share*. These are based on the Wildcard Augmentation discussions. | ||
* **n5to6** command converts a NIEM 5 model (CMF or XSD) to NIEM 6, rewriting namespace URIs | ||
* CMF to XSD command split into three | ||
* **m2xn5** command generates NIEM 5 XSD | ||
* **m2xref** command generates NIEM 6 reference XSD | ||
* **m2xmsg** command will generate NIEM 6 message XSD (not implemented yet) | ||
|
||
## What's new in version 0.7-alpha.1 | ||
|
||
* Handling code-list-instance (CLI) properties | ||
* Handling code-list-schema-attribute (CLSA) appinfo | ||
* Augmentations are now primarily recorded as properties in the Namespace object | ||
* The CMF submodule is now in the OASIS repo | ||
|
||
## What's working now | ||
|
||
- NIEM XML schema pile to Common Model Format | ||
- Common Model Format to NIEM XML schema pile | ||
- NIEM 5.2 niem-core model converts from XSD to CMF and back to XSD with no significant change | ||
(except LocalTerm appinfo is not handled yet) | ||
- Entire NIEM 5.2 model converts from XSD to CMF, and vice versa. (Haven't looked for significant changes yet.) | ||
## CMFTool commands | ||
|
||
* `x2m` command generates CMF from a source or message XSD pile | ||
* `m2m` command generates a canonical version of a CMF file | ||
* `m2o` command generates OWL from CMF (needs work) | ||
* `m2xn5` command generates NIEM 5 XSD from CMF | ||
* `m2xs` command generates NIEM 6 source XSD from CMF | ||
* `m2xm` command generates NIEM 6 message XSD from CMF | ||
* `n5to6` command converts a NIEM 5 model (CMF or XSD) to NIEM 6 CMF, rewriting namespace URIs (needs fixing) | ||
* `xcanon` command generates a canonical version of an XSD document | ||
* `xcmp` command compares two XML schemas | ||
|
||
Every command accepts a `–help` argument, for providing, well… help. | ||
|
||
## What's new in version 1.0-alpha.2 | ||
|
||
* CMF now has `ObjectProperty` and `DataProperty` | ||
* `cmf:ReferenceCode` and `appinfo:referenceCode` is working | ||
* Global element augmentation is working | ||
* Message schema generation is working | ||
* Builtin schema documents are updated to version PS02 | ||
* Add `structures:appliesToParent` to `AssociationType` and `ObjectType` in *structures.xsd* | ||
* Add proxies for xs:Name, NCName, QName to *niem-xs.xsd* | ||
|
||
## Still to be done | ||
|
||
* Writing partial models in CMF, composing a model from parts | ||
* Handle `appinfo:relationshipPropertyIndicator` | ||
* Implement `appinfo:AttributeAugmentation` | ||
* Corner cases for `xs:simpleType` | ||
* Ordered properties and xs:list | ||
* Definitions | ||
* Repeated (with `xml:lang`), including inside `LocalTerm` elements | ||
* On element/attribute references (and HasProperty objects) | ||
* On `xs:import elements` | ||
|
||
## Quick start | ||
|
||
|
@@ -85,15 +59,15 @@ Run "cmftool help" for a list of commands. | |
|
||
## Examples | ||
|
||
There is an "examples" directory, with... examples. But they are still NIEM 5 based. | ||
There is an "examples" directory, with... examples. But they are still NIEM 5 based. | ||
|
||
## Testing | ||
|
||
The directory "src/test/resources" contains resources for the JUnit tests. | ||
The directory "src/test/resources" contains resources for the JUnit tests. Many, many examples there. | ||
|
||
## Building | ||
|
||
This project was built with NetBeans 10.0, Gradle 8.3, and Oracle JDK 17.0.9 | ||
This project was built with NetBeans 21.0, Gradle 8.6, and Oracle JDK 21.0.2 | ||
Try "gradle installDist" | ||
|
||
## Other assets | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule CMF
updated
from ebafcf to 3aeac7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,9 @@ | |
*/ | ||
package org.mitre.niem.cmf; | ||
|
||
import org.apache.logging.log4j.LogManager; | ||
import org.apache.logging.log4j.Logger; | ||
|
||
/** | ||
* A class for <cmf:NamespaceAugmentingRecord> | ||
* Records all the augmentations in a namespace. If every augmentation was an | ||
|
@@ -39,14 +42,16 @@ | |
* <a href="mailto:[email protected]">[email protected]</a> | ||
*/ | ||
public class AugmentRecord extends ObjectType implements Comparable<AugmentRecord> { | ||
static final Logger LOG = LogManager.getLogger(AugmentRecord.class); | ||
|
||
private ClassType classType = null; // the augmented Class | ||
private Property property = null; // the agumenting Property | ||
private int indexInType = -1; // index of Property in augmentation type, or -1 if no such type | ||
private int minQ = 0; // minOccurs | ||
private int maxQ = 0; // maxOccurs | ||
private boolean maxUnbounded = false; // unbounded | ||
private boolean orderedProperty = false; // is this property ordered? | ||
private int globalAug = AUG_NONE; // global augmentation? Of objects, associations, simple content? | ||
private String globalAugComp = null; // QName of global component augmented (eg. structures:ObjectType) | ||
|
||
public void setClassType (ClassType c) { classType = c; } | ||
public void setProperty (Property p) { property = p; } | ||
|
@@ -64,33 +69,34 @@ public class AugmentRecord extends ObjectType implements Comparable<AugmentRecor | |
public boolean maxUnbounded () { return maxUnbounded; } | ||
public boolean orderedProperties () { return orderedProperty; } | ||
|
||
// Global augmentation codes are represented internally as a bitmap | ||
// AUG_NONE, AUG_ASSOC, and AUG_OBJECT are mutually exclusive! | ||
public String getGlobalAugmented () { return globalAugComp; } | ||
public void setGlobalAugmented (String s) { globalAugComp = s; } | ||
|
||
// Global augmentation codes | ||
public static final int AUG_NONE = 0; // not a global augmentation | ||
public static final int AUG_ASSOC = 1; // global augmentation for associations | ||
public static final int AUG_OBJECT = 2; // global augmentation for objects | ||
public static final int AUG_SIMPLE = 4; // global augmentation for simple content | ||
public static final int AUG_MAX = 4; | ||
public static String[] augCode = { "NONE", "ASSOCIATION", "OBJECT", null, "SIMPLE" }; | ||
public static final int AUG_ASSOC = 1; // a global augmentation for associations | ||
public static final int AUG_OBJECT = 2; // a global augmentation for objects | ||
public static final int AUG_SIMPLE = 3; // a global augmentation for simple content | ||
public static final int AUG_NUMCODES = 4; // this many kinds of augmentations | ||
|
||
public void setGlobalAug (int i) { globalAug = i; } | ||
public boolean hasGlobalAug (int i) { return 0 != (globalAug & i); } | ||
public int getGlobalAug () { return globalAug; } | ||
public void addGlobalAug (int i) { globalAug = globalAug | i; } | ||
public void addGlobalAug (String s) { | ||
if (null == s) return; | ||
for (int i = 1; i <= AUG_MAX; i++) | ||
if (null != augCode[i] && augCode[i].equals(s)) addGlobalAug(i); | ||
public int getGlobalAug () { | ||
if (null == globalAugComp) return AUG_NONE; | ||
var cname = globalAugComp.substring(globalAugComp.indexOf(":")+1); | ||
if (cname.startsWith("Association")) return AUG_ASSOC; | ||
if (cname.startsWith("Object")) return AUG_OBJECT; | ||
if (cname.startsWith("Simple")) return AUG_SIMPLE; | ||
LOG.error("unknown global augmented component {}", globalAugComp); | ||
return AUG_NONE; | ||
} | ||
public String getGlobalAugCode (int i) { return augCode[i]; } | ||
|
||
public AugmentRecord () {} | ||
|
||
@Override | ||
public int compareTo (AugmentRecord o) { | ||
int rv = this.classType.compareTo(o.classType); | ||
// if (0 == rv) rv = this.indexInType - o.indexInType; | ||
int rv = 0; | ||
if (null != this.classType && null != o.classType) rv = this.classType.compareTo(o.classType); | ||
if (0 == rv) rv = this.property.getQName().compareTo(o.property.getQName()); | ||
if (0 == rv) rv = this.globalAugComp.compareTo(o.globalAugComp); | ||
return rv; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,7 +33,7 @@ | |
* <a href="mailto:[email protected]">[email protected]</a> | ||
*/ | ||
public class ClassType extends Component { | ||
private String refCode = ""; | ||
private String refCode = null; | ||
private boolean isAugmentable = false; | ||
private ClassType extensionOfClass = null; | ||
private final List<HasProperty> hasPropertyList = new ArrayList<>(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.