Skip to content

Commit d2149f4

Browse files
committed
Add support for set-level curation_rule* slots.
In SSSOM 1.1, the `curation_rule` and `curation_rule_text` slots will be usable at the level of the mapping set, and propagatable. This commit updates the model classes to reflect that future change.
1 parent 4258cfe commit d2149f4

File tree

2 files changed

+44
-1
lines changed

2 files changed

+44
-1
lines changed

core/src/main/lombok/org/incenp/obofoundry/sssom/model/MappingSet.java

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,17 @@ public class MappingSet {
156156
@Versionable(addedIn = Version.SSSOM_1_1)
157157
private String similarityMeasure;
158158

159+
@JsonProperty("curation_rule")
160+
@EntityReference
161+
@Propagatable
162+
@Versionable(addedIn = Version.SSSOM_1_1)
163+
private List<String> curationRule;
164+
165+
@JsonProperty("curation_rule_text")
166+
@Propagatable
167+
@Versionable(addedIn = Version.SSSOM_1_1)
168+
private List<String> curationRuleText;
169+
159170
@JsonProperty("see_also")
160171
@SlotURI("http://www.w3.org/2000/01/rdf-schema#seeAlso")
161172
@URI
@@ -310,6 +321,36 @@ public List<String> getObjectPreprocessing(boolean set) {
310321
return objectPreprocessing;
311322
}
312323

324+
/**
325+
* Gets the list of curation_rule values, optionally
326+
* initializing the list if needed.
327+
*
328+
* @param set If {@code true}, the underlying field will be initialized to
329+
* an empty list if it happens to be {@code null}.
330+
* @return The list of curation_rule values.
331+
*/
332+
public List<String> getCurationRule(boolean set) {
333+
if ( curationRule == null && set ) {
334+
curationRule = new ArrayList<>();
335+
}
336+
return curationRule;
337+
}
338+
339+
/**
340+
* Gets the list of curation_rule_text values, optionally
341+
* initializing the list if needed.
342+
*
343+
* @param set If {@code true}, the underlying field will be initialized to
344+
* an empty list if it happens to be {@code null}.
345+
* @return The list of curation_rule_text values.
346+
*/
347+
public List<String> getCurationRuleText(boolean set) {
348+
if ( curationRuleText == null && set ) {
349+
curationRuleText = new ArrayList<>();
350+
}
351+
return curationRuleText;
352+
}
353+
313354
/**
314355
* Gets the list of see_also values, optionally
315356
* initializing the list if needed.

linkml/custom-javagen.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,9 @@ def get_added_in_version(self, class_name, slot_name):
387387
# following dictionary, that we query _before_ querying the
388388
# schema.
389389
overrides = {
390-
"MappingSet:similarity_measure": "1.1"
390+
"MappingSet:similarity_measure": "1.1",
391+
"MappingSet:curation_rule": "1.1",
392+
"MappingSet:curation_rule_text": "1.1"
391393
}
392394

393395
added_in = overrides.get(f"{class_name}:{slot_name}", None)

0 commit comments

Comments
 (0)