Skip to content

Commit

Permalink
Merge pull request #282 from FAIRDataTeam/hotfix/1.13.2
Browse files Browse the repository at this point in the history
Hotfix 1.13.2
  • Loading branch information
MarekSuchanek authored May 16, 2022
2 parents a55fcf5 + c2b2bbb commit aa85310
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]


## [1.13.2]

### Fixed

- Harvest also `fdp-o:MetadataService` in FDP Index

## [1.13.1]

### Changed
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</parent>
<groupId>nl.dtls</groupId>
<artifactId>fairdatapoint</artifactId>
<version>1.13.1</version>
<version>1.13.2</version>
<packaging>jar</packaging>

<name>FairDataPoint</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
import nl.dtls.fairdatapoint.entity.index.http.ExchangeDirection;
import nl.dtls.fairdatapoint.entity.index.http.ExchangeState;
import nl.dtls.fairdatapoint.service.index.entry.IndexEntryService;
import nl.dtls.fairdatapoint.vocabulary.FDP;
import nl.dtls.fairdatapoint.vocabulary.R3D;
import org.eclipse.rdf4j.model.IRI;
import org.eclipse.rdf4j.model.Resource;
import org.eclipse.rdf4j.model.Statement;
Expand All @@ -54,6 +56,7 @@
import java.time.Duration;
import java.time.Instant;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Optional;

Expand All @@ -63,18 +66,17 @@ public class MetadataRetrievalUtils {

private static final Integer VERSION = 1;

private static final IRI REPOSITORY = SimpleValueFactory.getInstance().createIRI("http://www.re3data" +
".org/schema/3-0#Repository");

private static final IRI COUNTRY = SimpleValueFactory.getInstance().createIRI("http://www.re3data" +
".org/schema/3-0#institutionCountry");
private static final List<IRI> REPOSITORY_TYPES = List.of(
R3D.REPOSITORY,
FDP.METADATASERVICE
);

private static final Map<IRI, String> MAPPING = Map.of(
DCTERMS.TITLE, "title",
DCTERMS.DESCRIPTION, "description",
DCTERMS.HAS_VERSION, "version",
DCTERMS.PUBLISHER, "publisher",
COUNTRY, "country"
R3D.COUNTRY, "country"
);

private static final HttpClient client = HttpClient.newBuilder()
Expand Down Expand Up @@ -181,7 +183,7 @@ private static RepositoryMetadata extractRepositoryMetadata(ArrayList<Statement>

private static Optional<Resource> findRepository(ArrayList<Statement> statements) {
for (Statement st : statements) {
if (st.getPredicate().equals(RDF.TYPE) && st.getObject().equals(REPOSITORY)) {
if (st.getPredicate().equals(RDF.TYPE) && REPOSITORY_TYPES.stream().anyMatch(st.getObject()::equals)) {
return Optional.of(st.getSubject());
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ metadataProperties:

openapi:
title: FAIR Data Point API
version: 1.13.1
version: 1.13.2
description: "The reference implementation of the metadata registration service: A service implementing the API specification. It contains an authentication system to allow maintainers to define and update metadata. Read-only access to the data is public."
contact:
name: Luiz Bonino
Expand Down

0 comments on commit aa85310

Please sign in to comment.