Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,10 @@ default <D extends StacCollectionModel> Collection getCollection(D m, Filter fil
if (m.getSummaries().getAiDescription() != null) {
collection.getProperties().put(CollectionProperty.aiDescription, m.getSummaries().getAiDescription());
}

if(m.getSummaries().getScope() != null) {
collection.getProperties().put(CollectionProperty.scope, m.getSummaries().getScope());
}
}

return collection;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,8 @@ public class SummariesModel {
@JsonProperty("ai:description")
protected String aiDescription;

@JsonProperty("scope")
protected Map<String, String> scope;

protected String statement;
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ public enum CollectionProperty {
centroid("centroid"),
pace("pace"),
datasetGroup("dataset_group"),
aiDescription("ai:description");
aiDescription("ai:description"),
scope("scope");

private final String value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ public void verifyAddingPropertyWorks() {
var datasetGroup = List.of("group_test");
var aiDescription = "AI-generated description for testing";

Map<String, String> scope = new HashMap<>();
scope.put("code", "document");
scope.put("name", "IMOS publication");

StacCollectionModel model = StacCollectionModel
.builder()
.summaries(
Expand All @@ -120,6 +124,7 @@ public void verifyAddingPropertyWorks() {
.statement(statement)
.datasetGroup(datasetGroup)
.aiDescription(aiDescription)
.scope(scope)
.build()
)
.license("Attribution 4.0")
Expand Down Expand Up @@ -147,6 +152,8 @@ public void verifyAddingPropertyWorks() {
Assertions.assertEquals("revision date", collection.getProperties().get(CollectionProperty.revision));
Assertions.assertEquals(datasetGroup, collection.getProperties().get(CollectionProperty.datasetGroup));
Assertions.assertEquals(aiDescription, collection.getProperties().get(CollectionProperty.aiDescription));
Assertions.assertEquals("document",
((Map<String, String>) collection.getProperties().get(CollectionProperty.scope)).get("code"));
Assertions.assertNotNull(collection.getLinks());
Assertions.assertEquals(3, collection.getLinks().size());
}
Expand Down
Loading