-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from musale/update/add-references-node
Adds TLC Elements
- Loading branch information
Showing
25 changed files
with
615 additions
and
5 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
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { AttributeGroupItem } from "../Interfaces/AttributeGroupItem"; | ||
import { HasChildrenMap } from "../Interfaces/HasChildrenMap"; | ||
import { NodeRules } from "../Interfaces/NodeRules"; | ||
import { TLCs } from "../ElementGroups/TLCs"; | ||
import { DocRefs } from "../ElementGroups/DocRefs"; | ||
import { ReferenceType } from "./ReferenceType"; | ||
|
||
/** | ||
* The complex type refItems is a list of types of references | ||
* used in the references section. | ||
*/ | ||
export class RefItems implements HasChildrenMap { | ||
readonly CHILDREN_MAP: NodeRules = { | ||
refItemsChoices: { | ||
choice: true, | ||
minOccur: 1, | ||
options: { | ||
tlcsGroup: { | ||
choice: true, | ||
minOccur: 1, | ||
maxOccur: 1, | ||
options: { ...(new TLCs()).CHILDREN_MAP } | ||
}, | ||
docrefGroup: { | ||
choice: true, | ||
minOccur: 1, | ||
maxOccur: 1, | ||
options: { ...(new DocRefs()).CHILDREN_MAP } | ||
} | ||
} | ||
} | ||
}; | ||
|
||
readonly ATTRIBUTE_GROUPS: AttributeGroupItem[] = [ | ||
...(new ReferenceType()).ATTRIBUTE_GROUPS | ||
]; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { AttributeGroupItem } from "../Interfaces/AttributeGroupItem"; | ||
import { HasChildrenMap } from "../Interfaces/HasChildrenMap"; | ||
import { NodeRules } from "../Interfaces/NodeRules"; | ||
import { Core, Idreq, Link, Show } from "../AttributeGroups"; | ||
|
||
/** | ||
* The complex type referenceType defines the empty content model | ||
* and the list of attributes for metadata elements in the | ||
* references section | ||
*/ | ||
export class ReferenceType implements HasChildrenMap { | ||
readonly CHILDREN_MAP: NodeRules = {}; | ||
|
||
readonly ATTRIBUTE_GROUPS: AttributeGroupItem[] = [ | ||
...(new Core()).items, | ||
...(new Idreq()).items, | ||
...(new Link()).items, | ||
...(new Show()).items | ||
]; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { AttributeGroupItem } from "../Interfaces/AttributeGroupItem"; | ||
import { HasChildrenMap } from "../Interfaces/HasChildrenMap"; | ||
import { NodeRules } from "../Interfaces/NodeRules"; | ||
|
||
/** | ||
* The group docrefs is a list of types of legal references to documents. | ||
*/ | ||
export class DocRefs implements HasChildrenMap { | ||
readonly CHILDREN_MAP: NodeRules = { | ||
docRefChoices: { | ||
choice: true, | ||
maxOccur: 1, | ||
minOccur: 1, | ||
options: { | ||
original: { minOccur: 1, maxOccur: 1, options: {} }, | ||
passiveRef: { minOccur: 1, maxOccur: 1, options: {} }, | ||
activeRef: { minOccur: 1, maxOccur: 1, options: {} }, | ||
jurisprudence: { minOccur: 1, maxOccur: 1, options: {} }, | ||
hasAttachment: { minOccur: 1, maxOccur: 1, options: {} }, | ||
attachmentOf: { minOccur: 1, maxOccur: 1, options: {} } | ||
} | ||
} | ||
}; | ||
|
||
readonly ATTRIBUTE_GROUPS: AttributeGroupItem[] = []; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { AttributeGroupItem } from "../Interfaces/AttributeGroupItem"; | ||
import { HasChildrenMap } from "../Interfaces/HasChildrenMap"; | ||
import { NodeRules } from "../Interfaces/NodeRules"; | ||
import { | ||
EIdAttribute, | ||
ShowAsAttribute, | ||
HrefAttribute, | ||
ShortFormAttribute, | ||
GUIDAttribute, | ||
WIdAttribute | ||
} from "../Attributes"; | ||
|
||
/** | ||
* The group TLCs is a list of types of Top Level classes of | ||
* the Akoma Ntoso ontology. | ||
*/ | ||
export class TLCs implements HasChildrenMap { | ||
readonly CHILDREN_MAP: NodeRules = { | ||
TLCChoices: { | ||
choice: true, | ||
maxOccur: 1, | ||
minOccur: 1, | ||
options: { | ||
TLCPerson: { minOccur: 1, maxOccur: 1, options: {} }, | ||
TLCOrganization: { minOccur: 1, maxOccur: 1, options: {} }, | ||
TLCConcept: { minOccur: 1, maxOccur: 1, options: {} }, | ||
TLCObject: { minOccur: 1, maxOccur: 1, options: {} }, | ||
TLCEvent: { minOccur: 1, maxOccur: 1, options: {} }, | ||
TLCLocation: { minOccur: 1, maxOccur: 1, options: {} }, | ||
TLCProcess: { minOccur: 1, maxOccur: 1, options: {} }, | ||
TLCRole: { minOccur: 1, maxOccur: 1, options: {} }, | ||
TLCTerm: { minOccur: 1, maxOccur: 1, options: {} }, | ||
TLCReference: { minOccur: 1, maxOccur: 1, options: {} } | ||
} | ||
} | ||
}; | ||
|
||
readonly ATTRIBUTE_GROUPS: AttributeGroupItem[] = []; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { AbstractNode } from '../../Abstracts/AbstractNode'; | ||
import { AttributeGroupItem } from '../../Interfaces/AttributeGroupItem'; | ||
import { NodeRules } from '../../Interfaces/NodeRules'; | ||
import { ReferenceType } from '../../ComplexTypes/ReferenceType'; | ||
|
||
const type = new ReferenceType(); | ||
/** | ||
* The element activeRef is a metadata reference to the | ||
* Akoma Ntoso IRI of a document that is modified by this | ||
* document (i.e., an active references) | ||
*/ | ||
export class ActiveRef extends AbstractNode { | ||
abbreviation = ''; | ||
|
||
getNodeName(): string { | ||
return 'activeRef'; | ||
} | ||
|
||
readonly CHILDREN_MAP: NodeRules = type.CHILDREN_MAP; | ||
|
||
readonly SEQUENCE: string[] = []; | ||
|
||
readonly ATTRIBUTE_GROUPS: AttributeGroupItem[] = type.ATTRIBUTE_GROUPS; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { AbstractNode } from "../../Abstracts/AbstractNode"; | ||
import { AttributeGroupItem } from "../../Interfaces/AttributeGroupItem"; | ||
import { NodeRules } from "../../Interfaces/NodeRules"; | ||
import { ReferenceType } from "../../ComplexTypes/ReferenceType"; | ||
import { Type } from "../../AttributeGroups"; | ||
|
||
const type = new ReferenceType(); | ||
/** | ||
* The element attachmentOf is a metadata reference to | ||
* the Akoma Ntoso IRI of a document of which this | ||
* document is an attachment | ||
*/ | ||
export class AttachmentOf extends AbstractNode { | ||
abbreviation = ""; | ||
|
||
getNodeName(): string { | ||
return "attachmentOf"; | ||
} | ||
|
||
readonly CHILDREN_MAP: NodeRules = type.CHILDREN_MAP; | ||
|
||
readonly SEQUENCE: string[] = []; | ||
|
||
readonly ATTRIBUTE_GROUPS: AttributeGroupItem[] = [ | ||
...type.ATTRIBUTE_GROUPS, | ||
...(new Type()).items | ||
]; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { AbstractNode } from "../../Abstracts/AbstractNode"; | ||
import { AttributeGroupItem } from "../../Interfaces/AttributeGroupItem"; | ||
import { NodeRules } from "../../Interfaces/NodeRules"; | ||
import { ReferenceType } from "../../ComplexTypes/ReferenceType"; | ||
import { Type } from "../../AttributeGroups"; | ||
|
||
const type = new ReferenceType(); | ||
/** | ||
* The element hasAttachment is a metadata reference to | ||
* the Akoma Ntoso IRI of a document of which this | ||
* document is an attachment | ||
*/ | ||
export class HasAttachment extends AbstractNode { | ||
abbreviation = ""; | ||
|
||
getNodeName(): string { | ||
return "hasAttachment"; | ||
} | ||
|
||
readonly CHILDREN_MAP: NodeRules = type.CHILDREN_MAP; | ||
|
||
readonly SEQUENCE: string[] = []; | ||
|
||
readonly ATTRIBUTE_GROUPS: AttributeGroupItem[] = [ | ||
...type.ATTRIBUTE_GROUPS, | ||
...(new Type()).items | ||
]; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { AbstractNode } from "../../Abstracts/AbstractNode"; | ||
import { AttributeGroupItem } from "../../Interfaces/AttributeGroupItem"; | ||
import { NodeRules } from "../../Interfaces/NodeRules"; | ||
import { ReferenceType } from "../../ComplexTypes/ReferenceType"; | ||
|
||
const type = new ReferenceType(); | ||
/** | ||
* The element jurisprudence is a metadata reference to | ||
* the Akoma Ntoso IRI of a document of which this | ||
* document is an attachment | ||
*/ | ||
export class Jurisprudence extends AbstractNode { | ||
abbreviation = ""; | ||
|
||
getNodeName(): string { | ||
return "jurisprudence"; | ||
} | ||
|
||
readonly CHILDREN_MAP: NodeRules = type.CHILDREN_MAP; | ||
|
||
readonly SEQUENCE: string[] = []; | ||
|
||
readonly ATTRIBUTE_GROUPS: AttributeGroupItem[] = type.ATTRIBUTE_GROUPS; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { AbstractNode } from '../../Abstracts/AbstractNode'; | ||
import { AttributeGroupItem } from '../../Interfaces/AttributeGroupItem'; | ||
import { NodeRules } from '../../Interfaces/NodeRules'; | ||
import { ReferenceType } from '../../ComplexTypes/ReferenceType'; | ||
|
||
const type = new ReferenceType(); | ||
/** | ||
* The element original is a metadata reference to the | ||
* Akoma Ntoso IRI of the original version of this | ||
* document (i.e., the first expression) | ||
*/ | ||
export class Original extends AbstractNode { | ||
abbreviation = ''; | ||
|
||
getNodeName(): string { | ||
return 'original'; | ||
} | ||
|
||
readonly CHILDREN_MAP: NodeRules = type.CHILDREN_MAP; | ||
|
||
readonly SEQUENCE: string[] = []; | ||
|
||
readonly ATTRIBUTE_GROUPS: AttributeGroupItem[] = type.ATTRIBUTE_GROUPS; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { AbstractNode } from "../../Abstracts/AbstractNode"; | ||
import { AttributeGroupItem } from "../../Interfaces/AttributeGroupItem"; | ||
import { NodeRules } from "../../Interfaces/NodeRules"; | ||
import { ReferenceType } from "../../ComplexTypes/ReferenceType"; | ||
|
||
const type = new ReferenceType(); | ||
/** | ||
* The element passiveRef is a metadata reference to the | ||
* Akoma Ntoso IRI of a document providing modifications | ||
* on this document (i.e., a passive references) | ||
*/ | ||
export class PassiveRef extends AbstractNode { | ||
abbreviation = ""; | ||
|
||
getNodeName(): string { | ||
return "passiveRef"; | ||
} | ||
|
||
readonly CHILDREN_MAP: NodeRules = type.CHILDREN_MAP; | ||
|
||
readonly SEQUENCE: string[] = []; | ||
|
||
readonly ATTRIBUTE_GROUPS: AttributeGroupItem[] = type.ATTRIBUTE_GROUPS; | ||
} |
Oops, something went wrong.