Skip to content

Commit

Permalink
Create hierarchy of Contact information (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenejac committed Oct 27, 2023
1 parent a4a3bc5 commit 2f08587
Show file tree
Hide file tree
Showing 13 changed files with 176 additions and 30 deletions.
2 changes: 1 addition & 1 deletion datatypes/Contact_Information.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Definition
The contact information assigned to an [Agent](../entities/Organisation_Unit.md). The contact information might be
Postal address, Visiting address, Email address, Telephone number, Website URL
Physical Address (Postal address, Visiting address) or Electronic Address (Email address, Telephone number, Website URL, etc.)

## Components
- postalAddress : [Postal Address](../datatypes/Postal_Address.md)
Expand Down
11 changes: 11 additions & 0 deletions datatypes/Electronic_Address.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Electronic Address

## Definition
An electronic address assigned to an [Agent](../entities/Organisation_Unit.md).

## Specialization of
[Contact Information](../datatypes/Contact_Information.md)

## Note
An electronic address might be [Email address](../datatypes/Email_Address.md), [Telephone number](../datatypes/Telephone_Number.md), [Website URL](../datatypes/Website_Address.md).
Moreover, additional subtypes of Electronic Address can be created in CERIF modules.
21 changes: 21 additions & 0 deletions datatypes/Email_Address.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Email Address

## Definition
An email address assigned to an [Agent](../entities/Organisation_Unit.md).

## Specialization of
[Electronic Address](../datatypes/Electronic_Address.md)

## Based on
[URI](../datatypes/URI.md)

## Restrictions
1. The URI must start with `mailto:`
2. The rest of the URI must match the regular expression<sup>[1](#fn1)</sup>: `^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$`

---
## Matches
1. Close match of [Schema.org Email](https://schema.org/email)

## References
<a name="fn1">\[1\]</a> Email address validation https://regexr.com/3e48o
25 changes: 25 additions & 0 deletions datatypes/Phone_Number.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Phone Number

## Definition
A phone number assigned to an [Agent](../entities/Organisation_Unit.md).

## Specialization of
[Electronic Address](../datatypes/Electronic_Address.md)

## Based on
[URI](../datatypes/URI.md)

## Restrictions
1. The URI must match RFC 3966 specification <sup>[1](#fn1)</sup>

## Examples
- `tel:+1-201-555-0123` - This URI points to a full phone number.
- `tel:863-1234;phone-context=+1-914-555` - The URI describes a local
phone number that is valid within a particular phone prefix.

---
## Matches
1. Close match of [Schema.org Phone](https://schema.org/telephone)

## References
<a name="fn1">\[1\]</a> The tel URI for Telephone Numbers https://datatracker.ietf.org/doc/html/rfc3966
12 changes: 12 additions & 0 deletions datatypes/Physical_Address.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Physical Address

## Definition
The location assigned to an [Organisation Unit](../entities/Organisation_Unit.md) or some other CERIF entity instance.

## Notes
Please note there are two specializations of this data type providing more or less structured details about a physical
address [Simple Physical Address](../datatypes/Simple_Physical_Address.md) and [Structured Physical Address](../datatypes/Structured_Physical_Address.md)

## Components
- country : [Country](../datatypes/Country.md)

14 changes: 9 additions & 5 deletions datatypes/Postal_Address.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
# Postal Address

## Definition
The location assigned to an [Organisation Unit](../entities/Organisation_Unit.md) or some other CERIF entity instance.
A postal address assigned to an [Agent](../entities/Organisation_Unit.md).

## Notes
Please note there are two specializations of this data type providing more or less structured details about a postal
address [Simple Postal Address](../datatypes/Simple_Postal_Address.md) and [Structured Postal Address](../datatypes/Structured_Postal_Address.md)
## Specialization of
[Contact Information](../datatypes/Contact_Information.md)

## Components
- country : [Country](../datatypes/Country.md)
- physical address : [Physical Address](../datatypes/Physical_Address.md)

---
## Matches
1. Close match of [Schema.org home location](https://schema.org/homeLocation)
2. Close match of [Schema.org address](https://schema.org/address)
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Simple Postal Address

## Definition
This data type is used when a string representation of postal address is used.
This data type is used when a string representation of physical address is used.

## Notes
The main intended usage of multiple strings for different languages is to allow the representation of the addresses in different scripts, allowing for transliterations.

## Specialization of
[Postal Address](../datatypes/Postal_Address.md)
[Physical Address](../datatypes/Physical_Address.md)

## Components
- those inherited from [Postal Address](../datatypes/Postal_Address.md#components)
- those inherited from [Physical Address](../datatypes/Physical_Address.md#components)
- address : [Multilingual String](../datatypes/Multilingual_String.md)

Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
# Structured Postal Address

## Definition
This data type is used when a structured representation of postal address is used.
This data type is used when a structured representation of physical address is used.

## Notes
The main intended usage of multiple strings for different languages is to allow the representation of the addresses in different scripts, allowing for transliterations.

## Specialization of
[Postal Address](../datatypes/Postal_Address.md)
[Physical Address](../datatypes/Physical_Address.md)

## Components
- those inherited from [Postal Address](../datatypes/Postal_Address.md#components)
- those inherited from [Physical Address](../datatypes/Physical_Address.md#components)
- street : [Multilingual String](../datatypes/Multilingual_String.md)
- city : [Multilingual String](../datatypes/Multilingual_String.md)
- ZIP code: [Multilingual String](../datatypes/Multilingual_String.md)
- stateOrProvince: [Multilingual String](../datatypes/Multilingual_String.md)


---
## Matches
1. Close match of [Schema.org Postal address](https://schema.org/PostalAddress)
14 changes: 14 additions & 0 deletions datatypes/Visiting_Address.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Visiting Address

## Definition
A visiting address assigned to an [Agent](../entities/Organisation_Unit.md).

## Specialization of
[Contact Information](../datatypes/Contact_Information.md)

## Components
- physical address : [Physical Address](../datatypes/Physical_Address.md)

---
## Matches
1. Close match of [Schema.org work location](https://schema.org/workLocation)
20 changes: 20 additions & 0 deletions datatypes/Website_Address.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Website Address

## Definition
A website address assigned to an [Agent](../entities/Organisation_Unit.md).

## Specialization of
[Electronic Address](../datatypes/Electronic_Address.md)

## Based on
[URI](../datatypes/URI.md)

## Restrictions
1. The URI must match the regular expression<sup>[1](#fn1)</sup>: `[(http(s)?):\/\/(www\.)?a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)`

---
## Matches
1. Close match of [Schema.org URL](https://schema.org/url)

## References
<a name="fn1">\[1\]</a> URL validation https://regexr.com/39nr7
57 changes: 45 additions & 12 deletions diagrams/core.puml
Original file line number Diff line number Diff line change
Expand Up @@ -330,34 +330,67 @@
}
!endsub

!startsub Postal_Address
datatype("Postal_Address") {
!startsub Physical_Address
datatype("Physical_Address") {
country : Country
}

datatype("Simple_Postal_Address") {
datatype("Simple_Physical_Address") {
address : Multilingual_String
}

datatype("Structured_Postal_Address") {
datatype("Structured_Physical_Address") {
street : Multilingual_String
city : Multilingual_String
zipCode : Multilingual_String
}

"Postal_Address" <|-d- "Simple_Postal_Address"
"Postal_Address" <|-d- "Structured_Postal_Address"
"Physical_Address" <|-d- "Simple_Physical_Address"
"Physical_Address" <|-d- "Structured_Physical_Address"

datatype("Contact_Information") {
postalAddress : Postal_Address
visitingAddress : Postal_Address
postalAddress : Physical_Address
visitingAddress : Physical_Address
phone : String
emailAddress : URI
webSiteURL : URI
}

"Contact_Information" --> "Postal_Address" : postalAddress >
"Contact_Information" --> "Postal_Address" : visitingAddress >
datatype("Postal_Address") {
physicalAddress : Physical_Address
}

"Contact_Information" <|-d- "Postal_Address"
"Postal_Address" --> "1" "Physical_Address"


datatype("Visiting_Address") {
physicalAddress : Physical_Address
}

"Contact_Information" <|-d- "Visiting_Address"
"Visiting_Address" --> "1" "Physical_Address"

datatype("Electronic_Address") {
}

"Contact_Information" <|-d- "Electronic_Address"

datatype("Email_Address") {
}

"Electronic_Address" <|-d- "Email_Address"

datatype("Website_Address") {
}

"Electronic_Address" <|-d- "Website_Address"

datatype("Phone_Number") {
}

"Electronic_Address" <|-d- "Phone_Number"


!endsub

Expand All @@ -368,8 +401,8 @@
}
!endsub

!startsub Postal_Address
"Postal_Address" o..> "Country" : country >
!startsub Physical_Address
"Physical_Address" o..> "Country" : country >
!endsub

!startsub Affiliation_Statement
Expand Down
11 changes: 6 additions & 5 deletions guidelines/DESCRIBING_DATATYPES.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ Use the [template file](./TEMPLATE_DATATYPE_COMPLEX.md) as a starting point.
### For datatypes without components (xsd:simpleType)
1. **Definition**: The scope of the datatype and its meaning.
2. **Notes**: An additional description to communicate the purpose of the datatype.
3. **Based on**: The link to the base datatype (the datatype this type restricts)
4. **Restrictions**: An enumerated list of restrictions that apply (e.g. maximum length, regular expression, possibly also algorithmic restrictions such as checksums)
5. **Examples**: A list of examples
3. **Specialization of**: The link to the super datatype (the datatype this type extends)
4. **Based on**: The link to the base datatype (the datatype this type restricts)
5. **Restrictions**: An enumerated list of restrictions that apply (e.g. maximum length, regular expression, possibly also algorithmic restrictions such as checksums)
6. **Examples**: A list of examples
---
6. **Matches**: Describe any external datatypes this datatype matches.
7. **References**: References to external resources in case these are referenced.
7. **Matches**: Describe any external datatypes this datatype matches.
8. **References**: References to external resources in case these are referenced.

Use the [template file](./TEMPLATE_DATATYPE_SIMPLE.md) as a starting point.
3 changes: 3 additions & 0 deletions guidelines/TEMPLATE_DATATYPE_SIMPLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ The scope of the datatype and its meaning.<sup>[1](#fn1)</sup>
## Notes
An additional description to communicate the purpose of the datatype.

## Specialization of
[XXX](../datatypes/XXX.md)

## Based on
[XXX](../datatypes/XXX.md)

Expand Down

0 comments on commit 2f08587

Please sign in to comment.