Skip to content

Commit

Permalink
Merge branch 'EMC-290_UKEOF_UI_updates' into 'develop'
Browse files Browse the repository at this point in the history
Resolve EMC-290 "Additional relationships for UKEOF catalogue"

Closes EMC-290

See merge request eip/catalogue!747
  • Loading branch information
joncooper65 committed Oct 24, 2024
2 parents 6e23a8c + c93d936 commit f5ed31c
Show file tree
Hide file tree
Showing 39 changed files with 449 additions and 112 deletions.
18 changes: 18 additions & 0 deletions fixtures/datastore/REV-1/3ebb3a34-517d-4892-be5a-e020532e0298.meta
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"rawType": "application/vnd.monitoring-facility+json",
"state": "published",
"documentType": "monitoring-facility",
"permissions": {
"EDIT": [
"superadmin"
],
"VIEW": [
"superadmin",
"public"
],
"DELETE": [
"superadmin"
]
},
"catalogue": "ukceh"
}
38 changes: 38 additions & 0 deletions fixtures/datastore/REV-1/3ebb3a34-517d-4892-be5a-e020532e0298.raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"id": "3ebb3a34-517d-4892-be5a-e020532e0298",
"uri": "https://catalogue-staging.ceh.ac.uk/id/3ebb3a34-517d-4892-be5a-e020532e0298",
"type": "monitoringFacility",
"title": "BT Tower London Atmospheric Pollution Observatory",
"metadataDate": "2024-09-24T12:49:47",
"resourceIdentifiers": [
{
"code": "https://catalogue-staging.ceh.ac.uk/id/3ebb3a34-517d-4892-be5a-e020532e0298"
}
],
"relationships": [
{
"relation": "http://onto.ceh.ac.uk/EF#belongsTo",
"target": "4d40c67c-2bd6-4461-a7c4-43058abf9a16"
}
],
"keywords": [
{
"value": "Sentinel site"
}
],
"geometry": {
"geometryString": "{\"type\":\"Feature\",\"properties\":{},\"geometry\":{\"type\":\"Point\",\"coordinates\":[-0.13879,51.52142]}}",
"wkt": "POINT(-0.13879 51.52142)"
},
"geometryRepresentative": false,
"mobile": false,
"responsibleParties": [
{
"individualName": "Carole Helfter",
"organisationName": "UK Centre for Ecology & Hydrology",
"organisationIdentifier": "https://ror.org/00pggkr55",
"role": "pointOfContact",
"email": "[email protected]"
}
]
}
18 changes: 18 additions & 0 deletions fixtures/datastore/REV-1/4d40c67c-2bd6-4461-a7c4-43058abf9a16.meta
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"rawType": "application/vnd.monitoring-network+json",
"state": "published",
"documentType": "monitoring-network",
"permissions": {
"EDIT": [
"superadmin"
],
"VIEW": [
"superadmin",
"public"
],
"DELETE": [
"superadmin"
]
},
"catalogue": "ukceh"
}
20 changes: 20 additions & 0 deletions fixtures/datastore/REV-1/4d40c67c-2bd6-4461-a7c4-43058abf9a16.raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"id": "4d40c67c-2bd6-4461-a7c4-43058abf9a16",
"uri": "https://catalogue-staging.ceh.ac.uk/id/4d40c67c-2bd6-4461-a7c4-43058abf9a16",
"type": "monitoringNetwork",
"title": "UKCEH Sentinel sites",
"metadataDate": "2024-09-24T12:50:00",
"resourceIdentifiers": [
{
"code": "https://catalogue-staging.ceh.ac.uk/id/4d40c67c-2bd6-4461-a7c4-43058abf9a16"
}
],
"boundingBox": {
"westBoundLongitude": -1.11097,
"eastBoundLongitude": -0.13869,
"southBoundLatitude": 51.521319999999996,
"northBoundLatitude": 51.60276,
"coordinates": "[[[-1.11097, 51.521319999999996], [-1.11097, 51.60276], [-0.13869, 51.60276], [-0.13869, 51.521319999999996], [-1.11097, 51.521319999999996]]]",
"bounds": "{\"type\": \"Feature\", \"properties\": {}, \"geometry\": { \"type\": \"Polygon\", \"coordinates\": [[[-1.11097, 51.521319999999996], [-1.11097, 51.60276], [-0.13869, 51.60276], [-0.13869, 51.521319999999996], [-1.11097, 51.521319999999996]]] }}"
}
}
18 changes: 18 additions & 0 deletions fixtures/datastore/REV-1/5d4fd6ea-18a1-44b7-a845-8c29e34bbb46.meta
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"rawType": "application/vnd.monitoring-facility+json",
"state": "published",
"documentType": "monitoring-facility",
"permissions": {
"EDIT": [
"superadmin"
],
"VIEW": [
"superadmin",
"public"
],
"DELETE": [
"superadmin"
]
},
"catalogue": "ukceh"
}
33 changes: 33 additions & 0 deletions fixtures/datastore/REV-1/5d4fd6ea-18a1-44b7-a845-8c29e34bbb46.raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"id": "5d4fd6ea-18a1-44b7-a845-8c29e34bbb46",
"uri": "https://catalogue-staging.ceh.ac.uk/id/5d4fd6ea-18a1-44b7-a845-8c29e34bbb46",
"type": "monitoringFacility",
"title": "Wallingford Meteorological Site",
"metadataDate": "2024-09-24T12:50:00",
"resourceIdentifiers": [
{
"code": "https://catalogue-staging.ceh.ac.uk/id/5d4fd6ea-18a1-44b7-a845-8c29e34bbb46"
}
],
"relationships": [
{
"relation": "http://onto.ceh.ac.uk/EF#belongsTo",
"target": "4d40c67c-2bd6-4461-a7c4-43058abf9a16"
}
],
"keywords": [
{
"value": "Sentinel site"
}
],
"facilityType": {
"value": "site",
"uri": "http://ex.com/facilityType/site"
},
"geometry": {
"geometryString": "{\"type\":\"Feature\",\"properties\":{},\"geometry\":{\"type\":\"Point\",\"coordinates\":[-1.11087,51.60266]}}",
"wkt": "POINT(-1.11087 51.60266)"
},
"geometryRepresentative": false,
"mobile": false
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,22 @@ public class Ontology {
public static final Property EIDC_MEMBER_OF = ResourceFactory.createProperty("https://vocabs.ceh.ac.uk/eidc#memberOf");
public static final Property EIDC_USES = ResourceFactory.createProperty("https://vocabs.ceh.ac.uk/eidc#uses");

public static final Property SET_UP_FOR = ResourceFactory.createProperty("http://purl.org/voc/ef#setUpFor");
public static final Property USES = ResourceFactory.createProperty("http://purl.org/voc/ef#uses");
public static final Property INVOLVED_IN = ResourceFactory.createProperty("http://purl.org/voc/ef#involvedIn");
public static final Property SUPERSEDES = ResourceFactory.createProperty("http://purl.org/voc/ef#supersedes");
public static final Property SUPERSEDED_BY = ResourceFactory.createProperty("http://purl.org/voc/ef#supersededBy");
public static final Property BROADER = ResourceFactory.createProperty("http://purl.org/voc/ef#broader");
public static final Property NARROWER = ResourceFactory.createProperty("http://purl.org/voc/ef#narrower");
public static final Property BELONGS_TO = ResourceFactory.createProperty("http://purl.org/voc/ef#belongsTo");
public static final Property RELATED_TO = ResourceFactory.createProperty("http://purl.org/voc/ef#relatedTo");
public static final Property CONTAINS = ResourceFactory.createProperty("http://purl.org/voc/ef#contains");
public static final Property TRIGGERS = ResourceFactory.createProperty("http://purl.org/voc/ef#triggers");
public static final Property SET_UP_FOR = ResourceFactory.createProperty("http://onto.ceh.ac.uk/EF#setUpFor");
public static final Property USES = ResourceFactory.createProperty("http://onto.ceh.ac.uk/EF#uses");
public static final Property INVOLVED_IN = ResourceFactory.createProperty("http://onto.ceh.ac.uk/EF#involvedIn");
public static final Property SUPERSEDES = ResourceFactory.createProperty("http://onto.ceh.ac.uk/EF#supersedes");
public static final Property SUPERSEDED_BY = ResourceFactory.createProperty("http://onto.ceh.ac.uk/EF#supersededBy");
public static final Property BROADER = ResourceFactory.createProperty("http://onto.ceh.ac.uk/EF#broader");
public static final Property NARROWER = ResourceFactory.createProperty("http://onto.ceh.ac.uk/EF#narrower");
public static final Property HASCHILD = ResourceFactory.createProperty("http://onto.ceh.ac.uk/EF#hasChild");
public static final Property BELONGS_TO = ResourceFactory.createProperty("http://onto.ceh.ac.uk/EF#belongsTo");
public static final Property RELATED_TO = ResourceFactory.createProperty("http://onto.ceh.ac.uk/EF#relatedTo");
public static final Property UTILISES = ResourceFactory.createProperty("http://onto.ceh.ac.uk/EF#utilises");
public static final Property ASSOCIATED_WITH = ResourceFactory.createProperty("http://onto.ceh.ac.uk/EF#associatedWith");
public static final Property CONTAINS = ResourceFactory.createProperty("http://onto.ceh.ac.uk/EF#contains");
public static final Property TRIGGERS = ResourceFactory.createProperty("http://onto.ceh.ac.uk/EF#triggers");

public static final Property LINKING_TIME = ResourceFactory.createProperty("http://purl.org/voc/ef#linkingTime");
public static final Property LINKING_TIME = ResourceFactory.createProperty("http://onto.ceh.ac.uk/EF#linkingTime");
public static final Property TEMPORAL_BEGIN = ResourceFactory.createProperty("http://def.seegrid.csiro.au/isotc211/iso19108/2002/temporal#begin");
public static final Property TEMPORAL_END = ResourceFactory.createProperty("http://def.seegrid.csiro.au/isotc211/iso19108/2002/temporal#end");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ private String toTitlecase(String camelCase) {
char c = camelCase.charAt(i);
if( prevChar == ' ')
{
result.append(Character.toUpperCase(c));
result.append(Character.toLowerCase(c));
}
else if(Character.isUpperCase(c) && !Character.isUpperCase(prevChar))
{
// insert space before start of word if camel case
result.append( ' ' );
result.append(Character.toUpperCase( c ));
result.append(Character.toLowerCase( c ));
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
})
public class MonitoringActivity extends AbstractMetadataDocument implements WellKnownText {
private List<String> alternateTitles;
private String objectives;
private String objectives, operationalStatus;
private BoundingBox boundingBox;
private List<ResponsibleParty> responsibleParties;
private List<TimePeriod> operatingPeriod;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
@Template(called="rdf/monitoring/facility.ftl", whenRequestedAs=RDF_TTL_VALUE)
})
public class MonitoringFacility extends AbstractMetadataDocument implements WellKnownText {
private String operationalStatus;
private List<String> alternateTitles;
private Keyword facilityType;
private Geometry geometry;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
})
public class MonitoringNetwork extends AbstractMetadataDocument implements WellKnownText {
private List<String> alternateTitles;
private String objectives;
private String objectives, operationalStatus;
private List<ResponsibleParty> responsibleParties;
private TimePeriod operatingPeriod;
private List<Keyword> environmentalDomain, keywordsParameters;
Expand All @@ -39,3 +39,4 @@ public List<String> getWKTs() {
return Stream.ofNullable(boundingBox).map(BoundingBox::getWkt).toList();
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
})
public class MonitoringProgramme extends AbstractMetadataDocument implements WellKnownText {
private List<String> alternateTitles;
private String objectives;
private String objectives, operationalStatus;
private BoundingBox boundingBox;
private List<ResponsibleParty> responsibleParties;
private List<TimePeriod> operatingPeriod;
Expand Down
6 changes: 3 additions & 3 deletions java/src/test/java/templates/RdfTurtleTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ void loadActivity() {
createStatement(
createResource("https://example.com/id/9371"),
createProperty("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),
createResource("http://www.w3.org/2015/03/inspire/ef#EnvironmentalMonitoringActivity")
createResource("http://onto.ceh.ac.uk/EF#Activity")
)
)
);
Expand All @@ -111,7 +111,7 @@ void loadFacility() {
createStatement(
createResource("https://example.com/id/1234"),
createProperty("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),
createResource("http://www.w3.org/2015/03/inspire/ef#EnvironmentalMonitoringFacility")
createResource("http://onto.ceh.ac.uk/EF#Facility")
)
)
);
Expand All @@ -134,7 +134,7 @@ void loadNetwork() {
createStatement(
createResource("https://example.com/id/7453"),
createProperty("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),
createResource("http://www.w3.org/2015/03/inspire/ef#EnvironmentalMonitoringNetwork")
createResource("http://onto.ceh.ac.uk/EF#Network")
)
)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class ResponsiblePartyTest {
public void authorIsHumanReadable() {
//Given
ResponsibleParty author = ResponsibleParty.builder().role("author").build();
String expected = "Author";
String expected = "author";

//When
String actual = author.getRoleDisplayName();
Expand All @@ -26,7 +26,7 @@ public void authorIsHumanReadable() {
public void resourceProviderIsHumanReadable() {
//Given
ResponsibleParty author = ResponsibleParty.builder().role("resourceProvider").build();
String expected = "Resource Provider";
String expected = "resource provider";

//When
String actual = author.getRoleDisplayName();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@misc{1234:45553,
doi = {1234:45553},
url = {https://doi.org/1234:45553},
author = {Foo;Bar},
author = {Foo AND Bar},
publisher = {BOB},
title = {Land and Water},
year = {2020}
}
}
4 changes: 2 additions & 2 deletions templates/citation/bib.ftlh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@misc{${doi},
doi = {${doi}},
url = {${url}},
author = {${authors?join(';')}},
author = {${authors?join(' AND ')}},
publisher = {${publisher}},
title = {${title}},
year = {${year?c}}
}
}
2 changes: 1 addition & 1 deletion templates/html/ceh-model.ftlh
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
<#if otherContacts?? && otherContacts?has_content>
<@m.key "Other contacts">
<#list otherContacts as otherContact>
<dt>${otherContact.roleDisplayName}</dt>
<dt>${otherContact.roleDisplayName?cap_first}</dt>
<dd>
<div class="responsibleParty">
<@func.displayContact otherContact, true, true, false />
Expand Down
2 changes: 1 addition & 1 deletion templates/html/document/_contacts.ftlh
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@

<#if otherContacts?has_content>
<#list otherContacts as otherContact>
<dt>${otherContact.roleDisplayName}</dt>
<dt>${otherContact.roleDisplayName?cap_first}</dt>
<dd>
<div class="responsibleParty">
<@func.displayContact otherContact false true false />
Expand Down
3 changes: 0 additions & 3 deletions templates/html/footer/eidc.ftlh
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
<a target="_blank" href="https://eidc.ac.uk/contact" aria-label="Contact us" class="social">
<i class="fa-solid fa-xl fa-fw fa-envelope"></i>
</a>
<a class="social" target="_blank" href="https://twitter.com/EIDC_data" aria-label="Go to our X (Twitter) feed">
<i class="fa-brands fa-xl fa-fw fa-x-twitter"></i>
</a>
</div>
<div class="footer-terms">
UKCEH &copy; ${.now?datetime?string['yyyy']}
Expand Down
5 changes: 2 additions & 3 deletions templates/html/monitoring/activity.ftlh
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@

</#if>

<@m.relationships "Uses" "Uses these facilities/networks" "http://onto.nerc.ac.uk/CEHMD/rels/uses" />
<@m.relationships "Setup for" "Set up for these programmes" "http://ontm.nerc.ac.uk/CEHMD/rels/setupFor" />
<@m.inverseRelationships "Setup for" "Set up for these programmes" "http://onto.nerc.ac.uk/CEHMD/rels/triggers" />
<@m.relationships "http://onto.ceh.ac.uk/EF#uses" "Uses these facilities/networks"/>
<@m.inverseRelationships "http://onto.ceh.ac.uk/EF#triggers" "Set up for these programmes"/>

</@m.base>

Expand Down
19 changes: 15 additions & 4 deletions templates/html/monitoring/facility.ftlh
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,19 @@
</div>
</#if>

<@m.inverseRelationships "Uses" "Used by these activities" "http://onto.nerc.ac.uk/CEHMD/rels/uses" />
<@m.relationships "Belongs To" "Belongs to these networks" "http://purl.org/voc/ef#belongsTo" />
<@m.relationships "Supersedes" "Supersedes" "http://purl.org/voc/ef#supersedes" />
<@m.inverseRelationships "Superseded by" "Superseded by" "http://purl.org/voc/ef#supersedes" />
<div class="relationships">
<@m.relationships "http://onto.ceh.ac.uk/EF#belongsTo" "Belongs to these networks"/>

<@m.inverseRelationships "http://onto.ceh.ac.uk/EF#uses" "Used by" />
<@m.inverseRelationships "http://onto.ceh.ac.uk/EF#utilises" "Used by" />

<@m.relationships "http://onto.ceh.ac.uk/EF#supersedes" "Supersedes" />
<@m.inverseRelationships "http://onto.ceh.ac.uk/EF#supersedes" "Superseded by" />

<@m.relationships "http://onto.ceh.ac.uk/EF#narrower" "Child facilities" />
<@m.inverseRelationships "http://onto.ceh.ac.uk/EF#narrower" "Parent facilities" />

<@m.symmetricRelationships "http://onto.ceh.ac.uk/EF#associatedWith" "Related"/>
</div>

</@m.base>
Loading

0 comments on commit f5ed31c

Please sign in to comment.