Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes coming from the openDS public review #7

Merged
merged 3 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 47 additions & 47 deletions app/data/opends/annotation-termlist.csv

Large diffs are not rendered by default.

48 changes: 24 additions & 24 deletions app/data/opends/create-update-tombstone-event-termlist.csv

Large diffs are not rendered by default.

58 changes: 29 additions & 29 deletions app/data/opends/data-mapping-termlist.csv

Large diffs are not rendered by default.

178 changes: 89 additions & 89 deletions app/data/opends/digital-media-termlist.csv

Large diffs are not rendered by default.

630 changes: 319 additions & 311 deletions app/data/opends/digital-specimen-termlist.csv

Large diffs are not rendered by default.

100 changes: 54 additions & 46 deletions app/data/opends/machine-annotation-service-termlist.csv

Large diffs are not rendered by default.

61 changes: 31 additions & 30 deletions app/data/opends/source-system-termlist.csv

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion app/md/digital-specimen/termlist-header.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ The properties of a class start with a lowercase and use the lowerCamelCase nami
When a class contains a property which contains a list of another class we use the convention `hasXXX` where XXX is the class name.
For example, the Digital Specimen can contain a list of Event objects, so it has a property called `hasEvent`.
When a class is directly nested (not through a list) we use the class name as property name.
For example, the Location class contains the property `ods:GeoReference` which contains the Geo Reference class.
For example, the Location class contains the property `ods:Georeference` which contains the Geo Reference class.

When terms are borrowed from other vocabularies, such as Darwin Core, Annotation Vocabulary, Schema.org or others, we use the same naming convention as in the original vocabulary.
This could conflict with the openDS vocabulary naming convention.
Expand Down
9 changes: 7 additions & 2 deletions app/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,8 +476,8 @@ def generate_terms(header_mdfile, term_file):
on=['compound_name'], how='left'
)
terms = terms_skos_df.sort_values(by=['class_name'])
terms['examples'] = terms['examples'].str.replace(r'"', '')
terms['definition'] = terms['definition'].str.replace(r'"', '')
terms['examples'] = parse_list_to_string(terms['examples'])
terms['enum'] = parse_list_to_string(terms['enum'])

# Unique Class Names
opends_classes = terms_df["class_name"].dropna().unique()
Expand All @@ -493,6 +493,11 @@ def generate_terms(header_mdfile, term_file):
return marked_text, opends_classes, sssom_df, terms, terms_by_class


def parse_list_to_string(terms):
if not terms.isna().values.all():
return terms.str.replace(r'"', '').replace("'", "").replace("[", "").replace("]", "")


def generate_guide(header_mdfile, term_file):
with open(header_mdfile, encoding="utf8") as f:
marked_text = markdown2.markdown(f.read())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
tombstoneDate : string
tombstoneText : string
TombstonedByAgent : object
hasRelatedPID : array
hasRelatedPID : array<object>
}
class Agent {
name : string
Expand All @@ -39,15 +39,15 @@
roleOrder : integer
email : string
url : string
hasIdentifier : array
hasIdentifier : array<ods:Identifier>
}
class AnnotationTarget {
ID : string
type : string
hasSelector : object
}
class AnnotationBody {
value : array
value : array<string>
references : string
score : number
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
class CreateUpdateTombstoneEvent {
ID : string
type : string
hasProvAgent : array
hasProvAgent : array<ods:Agent>
}
class Activity {
wasAssociatedWith : array
wasAssociatedWith : array<ods:Agent>
endedAtTime : string
used : string
comment : string
changeValue : array
changeValue : array<object>
}
class Entity {
value : object
Expand All @@ -24,7 +24,7 @@
roleOrder : integer
email : string
url : string
hasIdentifier : array
hasIdentifier : array<ods:Identifier>
}
CreateUpdateTombstoneEvent -- Activity
CreateUpdateTombstoneEvent -- Entity
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
classDiagram
class Mapping {
class DataMapping {
ID : string
type : string
status : None
Expand All @@ -9,16 +9,16 @@
dateCreated : string
dateModified : string
creator : object
DefaultMapping : array
FieldMapping : array
DefaultMapping : array<ods:DefaultMapping>
FieldMapping : array<ods:FieldMapping>
mappingDataStandard : None
TombstoneMetadata : object
}
class TombstoneMetadata {
tombstoneDate : string
tombstoneText : string
TombstonedByAgent : object
hasRelatedPID : array
hasRelatedPID : array<object>
}
class Agent {
name : string
Expand All @@ -28,7 +28,7 @@
roleOrder : integer
email : string
url : string
hasIdentifier : array
hasIdentifier : array<ods:Identifier>
}
Mapping -- TombstoneMetadata
Mapping -- Agent
DataMapping -- TombstoneMetadata
DataMapping -- Agent
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
rightsHolder : string
source : string
creator : string
hasAssertion : array
hasCitation : array
hasIdentifier : array
hasEntityRelationship : array
hasAgent : array
hasAssertion : array<ods:Assertion>
hasCitation : array<ods:Citation>
hasIdentifier : array<ods:Identifier>
hasEntityRelationship : array<ods:EntityRelationship>
hasAgent : array<ods:Agent>
TombstoneMetadata : object
}
class Agent {
Expand All @@ -35,7 +35,7 @@
roleOrder : integer
email : string
url : string
hasIdentifier : array
hasIdentifier : array<ods:Identifier>
}
class Assertion {
measurementID : string
Expand Down Expand Up @@ -92,7 +92,7 @@
tombstoneDate : string
tombstoneText : string
TombstonedByAgent : object
hasRelatedPID : array
hasRelatedPID : array<object>
}
DigitalMedia -- Agent
DigitalMedia -- Assertion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
sourceSystemID : string
sourceSystemName : string
livingOrPreserved : None
language : array
language : array<string>
license : string
basisOfRecord : string
preparations : string
Expand All @@ -45,15 +45,15 @@
associatedOrganisms : string
organismRemarks : string
dynamicProperties : string
hasMaterialEntity : array
hasIdentification : array
hasAssertion : array
hasEvent : array
hasEntityRelationship : array
hasCitation : array
hasIdentifier : array
hasChronometricAge : array
hasAgent : array
hasMaterialEntity : array<ods:MaterialEntity>
hasIdentification : array<ods:Identification>
hasAssertion : array<ods:Assertion>
hasEvent : array<ods:Event>
hasEntityRelationship : array<ods:EntityRelationship>
hasCitation : array<ods:Citation>
hasIdentifier : array<ods:Identifier>
hasChronometricAge : array<ods:ChronometricAge>
hasAgent : array<ods:Agent>
TombstoneMetadata : object
}
class MaterialEntity {
Expand All @@ -70,13 +70,13 @@
recordedBy : string
recordedByID : string
verbatimLabel : string
hasIdentification : array
hasAssertion : array
hasEntityRelationship : array
hasCitation : array
hasIdentifier : array
hasEvent : array
hasAgent : array
hasIdentification : array<ods:Identification>
hasAssertion : array<ods:Assertion>
hasEntityRelationship : array<ods:EntityRelationship>
hasCitation : array<ods:Citation>
hasIdentifier : array<ods:Identifier>
hasEvent : array<ods:Event>
hasAgent : array<ods:Agent>
}
class Identification {
identificationID : string
Expand All @@ -91,8 +91,8 @@
isVerifiedIdentification : boolean
identificationRemarks : string
identificationQualifier : string
hasCitation : array
hasTaxonIdentification : array
hasCitation : array<ods:Citation>
hasTaxonIdentification : array<ods:TaxonIdentification>
}
class TaxonIdentification {
taxonID : string
Expand Down Expand Up @@ -167,7 +167,7 @@
eventRemarks : string
collectorName : string
collectorID : string
hasAssertion : array
hasAssertion : array<ods:Assertion>
Location : object
}
class Location {
Expand Down Expand Up @@ -245,7 +245,7 @@
roleOrder : integer
email : string
url : string
hasIdentifier : array
hasIdentifier : array<ods:Identifier>
}
class Assertion {
measurementID : string
Expand Down Expand Up @@ -322,7 +322,7 @@
tombstoneDate : string
tombstoneText : string
TombstonedByAgent : object
hasRelatedPID : array
hasRelatedPID : array<object>
}

DigitalSpecimen -- MaterialEntity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@
serviceAvailability : string
maintainer : object
license : string
dependency : array
dependency : array<string>
slaDocumentation : string
topicName : string
maxReplicas : integer
batchingPermitted : boolean
timeToLive : integer
TombstoneMetadata : object
hasEnvironmentalVariable : array<ods:EnvironmentalVariable>
hasSecretVariable : array<ods:SecretVariable>
}
class ContactPoint {
description : string
Expand All @@ -36,7 +38,7 @@
tombstoneDate : string
tombstoneText : string
TombstonedByAgent : object
hasRelatedPID : array
hasRelatedPID : array<object>
}
class Agent {
name : string
Expand All @@ -46,8 +48,18 @@
roleOrder : integer
email : string
url : string
hasIdentifier : array
hasIdentifier : array<ods:Identifier>
}
class SecretVariable {
name : string
secretKeyRef : string
}
class EnvironmentalVariable {
name : string
value : ['string', 'integer', 'boolean']
}
MachineAnnotationService -- ContactPoint
MachineAnnotationService -- TombstoneMetadata
MachineAnnotationService -- Agent
MachineAnnotationService -- SecretVariable
MachineAnnotationService -- EnvironmentalVariable
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@
url : string
collectionManagementSystem : string
translatorType : None
maximumRecords : integer
dataMappingID : string
TombstoneMetadata : object
}
class TombstoneMetadata {
tombstoneDate : string
tombstoneText : string
TombstonedByAgent : object
hasRelatedPID : array
hasRelatedPID : array<object>
}
class Agent {
name : string
Expand All @@ -29,7 +30,7 @@
roleOrder : integer
email : string
url : string
hasIdentifier : array
hasIdentifier : array<ods:Identifier>
}
SourceSystem -- TombstoneMetadata
SourceSystem -- Agent
24 changes: 20 additions & 4 deletions app/templates/includes/termlist/termlist-table.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ <h2 id="5-vocabulary">5 Vocabulary</h2>
{% endif %}


{% if v['examples'] is number %}
{% else %}
{% set list1 = v['examples'].split('`, `') %}
{% if v['examples'] is number or v['examples'] is float %}
{% elif v['examples'] is not none and v['examples'] is not number and v['examples'] is not float and v['examples']|length > 0 %}
{% set list1 = v['examples'].split('| ') %}
<tr>
<th scope="row">Examples</th>
<td>
<ul class="td-list">
{% for item in list1 %}
<li><span>{{ item|replace("`","") }}</span></li>
<li><span>{{ item }}</span></li>
{% endfor %}
</ul>

Expand All @@ -64,6 +64,22 @@ <h2 id="5-vocabulary">5 Vocabulary</h2>

{% endif %}

{% if v['enum'] is number or v['enum'] is float %}
{% elif v['enum'] is not none and v['enum'] is not number and v['enum'] is not float and v['enum']|length > 0 %}
{% set list1 = v['enum'].split('| ') %}
<tr>
<th scope="row">Controlled Vocabulary</th>
<td>
<ul class="td-list">
{% for item in list1 %}
<li><span>{{ item }}</span></li>
{% endfor %}
</ul>

</td>
</tr>
Comment on lines +70 to +80

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't know how this should look but often and elements are stored in separate (table rows)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm took this over from Latimer Core only made some small changes to it. Would like to keep this for now

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand, just a generic HTML thing that is possible, but not recommended

{% endif %}

{% if v['datatype'] is number %}
{% else %}
<tr>
Expand Down
Loading
Loading