Skip to content

Commit

Permalink
feat: return validation status for a distribution (#670)
Browse files Browse the repository at this point in the history
  • Loading branch information
EmmanuelDemey authored Jun 27, 2024
1 parent 601c10d commit 0a73ebe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,13 @@ public String getDistributions() throws RmesException {

@Override
public String getDistributionByID(String id) throws RmesException {
JSONObject distrib=repoGestion.getResponseAsObject(DistributionQueries.getDistribution(id, getDistributionGraph()));
if (distrib.has("id")){
return this.repoGestion.getResponseAsObject(DistributionQueries.getDistribution(id, getDistributionGraph())).toString();
} else {
JSONObject distribution = repoGestion.getResponseAsObject(DistributionQueries.getDistribution(id, getDistributionGraph()));

if (distribution.isEmpty()){
throw new RmesNotFoundException("This distribution does not exist");
}

return distribution.toString();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SELECT ?id ?idDataset ?labelLg1 ?labelLg2 ?descriptionLg1 ?descriptionLg2 ?created ?updated
SELECT ?id ?idDataset ?labelLg1 ?labelLg2 ?descriptionLg1 ?descriptionLg2 ?created ?updated ?validationState
?format ?byteSize ?url
FROM <${DATASET_GRAPH}>
WHERE {
Expand Down

0 comments on commit 0a73ebe

Please sign in to comment.