Skip to content

Commit 3de6605

Browse files
authored
Merge pull request #101 from clarin-eric/5.1.2
5.1.2
2 parents f7e4401 + 6bd833a commit 3de6605

File tree

15 files changed

+518
-543
lines changed

15 files changed

+518
-543
lines changed

CHANGES.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# version 5.2.0
2+
- calculate total linkchecker statistics from category statistics and overall from provider group statistics to prevent database access at different times while linkchecker changes data continuously
3+
4+
# version 5.1.1
5+
- upgrading [RASA](https://github.com/clarin-eric/resource-availability-status-api) dependency to version 4.0.1
6+
7+
# version 5.1.0
8+
- upgrading [RASA](https://github.com/clarin-eric/resource-availability-status-api) dependency to version 4.0.0
9+
- various code changes because of [changes in RASA API](https://github.com/clarin-eric/resource-availability-status-api/blob/master/CHANGES.md)
10+
- reviewing log levels

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Clarin Curation Module
22

3-
Here is the current deployed instance of Curation Module: https://curate.acdh.oeaw.ac.at/
3+
Here is the current deployed instance of Curation Module: https://curation.clarin.eu/
44

55
The goal of this project is to implement software component for curation and quality assessment which can be integrated in the CLARINs VLO workflow. Project is initialized by Metadata Curation Task Force. Specification for the Curation Module is based on the Metadata Quality Assessement Service proposal. Curation Module validates and normalizes single MD records, repositories and profiles, to assess their quality and to produce reports with different information for different actors in VLO workflow. For implementation this project will use some of the existing CLARIN components.
66

curation-module-core/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
<parent>
55
<artifactId>curation-module</artifactId>
66
<groupId>eu.clarin.cmdi</groupId>
7-
<version>5.1.1</version>
7+
<version>5.1.2</version>
88
</parent>
99
<modelVersion>4.0.0</modelVersion>
1010
<artifactId>curation-module-core</artifactId>
11-
<version>5.1.1</version>
11+
<version>5.1.2</version>
1212
<properties>
1313
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1414
<slf4j.version>1.7.25</slf4j.version>

curation-module-core/src/main/java/eu/clarin/cmdi/curation/main/Main.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ public static void main(String[] args) throws Exception {
176176

177177
}
178178
}
179-
linkCheckerReport.createOverall();
180179

181180
LOG.info("Creating collections table...");
182181

curation-module-core/src/main/java/eu/clarin/cmdi/curation/report/CMDProfileReport.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,12 @@
1212
import javax.xml.bind.annotation.XmlRootElement;
1313

1414
import eu.clarin.cmdi.curation.cr.ProfileHeader;
15+
import eu.clarin.cmdi.curation.utils.TimeUtils;
1516
import eu.clarin.cmdi.curation.xml.XMLMarshaller;
1617

1718

1819
/**
1920
* A selection of values from a single CMDProfileReport which will form a line in a statistical overview
20-
*
21-
* @author Wolfgang Walter SAUER (wowasa) &lt;[email protected]&gt;
2221
*/
2322
@XmlRootElement(name = "profile-report")
2423
@XmlAccessorType(XmlAccessType.FIELD)
@@ -30,8 +29,8 @@ public class CMDProfileReport implements Report<CMDProfileReport> {
3029
@XmlAttribute(name = "max-score")
3130
public double maxScore;
3231

33-
@XmlAttribute
34-
public Long timeStamp = System.currentTimeMillis();
32+
@XmlAttribute(name = "creation-time")
33+
public String creationTime = TimeUtils.humanizeToDate(System.currentTimeMillis());
3534

3635
@XmlElement(name = "header-section")
3736
public ProfileHeader header;

curation-module-core/src/main/java/eu/clarin/cmdi/curation/report/CollectionReport.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import eu.clarin.cmdi.curation.xml.XMLMarshaller;
77
import eu.clarin.cmdi.rasa.DAO.Statistics.CategoryStatistics;
88
import eu.clarin.cmdi.rasa.filters.CheckedLinkFilter;
9-
import eu.clarin.cmdi.rasa.helpers.statusCodeMapper.Category;
109
import org.slf4j.Logger;
1110
import org.slf4j.LoggerFactory;
1211

@@ -53,8 +52,8 @@ public class CollectionReport implements Report<CollectionReport> {
5352
@XmlAttribute(name = "ins-max-score")
5453
public Double maxPossibleScoreInstance = 0.0;
5554

56-
@XmlAttribute(name = "timestamp")
57-
public String timeStamp = TimeUtils.humanizeToDate(System.currentTimeMillis());
55+
@XmlAttribute(name = "creation-time")
56+
public String creationTime = TimeUtils.humanizeToDate(System.currentTimeMillis());
5857

5958
@XmlElement(name = "file-section")
6059
public FileReport fileReport;
@@ -417,6 +416,15 @@ public static class Statistics {
417416

418417
@XmlAttribute
419418
public String colorCode;
419+
420+
public Statistics() {
421+
422+
}
423+
424+
public Statistics(String category, String colorCode) {
425+
this.category = category;
426+
this.colorCode = colorCode;
427+
}
420428
}
421429

422430
@XmlRootElement
Lines changed: 127 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package eu.clarin.cmdi.curation.report;
22

3+
import eu.clarin.cmdi.curation.utils.TimeUtils;
34
import eu.clarin.cmdi.curation.xml.XMLMarshaller;
45

56
import java.io.OutputStream;
@@ -18,132 +19,130 @@
1819
public class CollectionsReport implements Report<CollectionsReport> {
1920

2021
// private static final Logger logger = LoggerFactory.getLogger(CollectionsReport.class);
21-
22-
@XmlElement(name = "collection")
23-
private List<Collection> collections = new ArrayList<Collection>();
24-
25-
@Override
26-
public void setParentName(String parentName) {
27-
28-
}
29-
30-
@Override
31-
public String getParentName() {
32-
33-
return null;
34-
}
35-
36-
@Override
37-
public String getName() {
38-
39-
return "CollectionsReport";
40-
}
41-
42-
@Override
43-
public boolean isValid() {
44-
45-
return false;
46-
}
47-
48-
@Override
49-
public void addSegmentScore(Score segmentScore) {
50-
51-
52-
}
53-
54-
@Override
55-
public void toXML(OutputStream os) {
56-
XMLMarshaller<CollectionsReport> instanceMarshaller = new
57-
XMLMarshaller<>(CollectionsReport.class);
58-
instanceMarshaller.marshal(this, os);
59-
}
60-
61-
@Override
62-
public void mergeWithParent(CollectionsReport parentReport) {
63-
64-
65-
}
66-
67-
public void addReport(Report<?> report) {
68-
if (report instanceof CollectionReport) {
69-
this.collections.add(new Collection((CollectionReport) report));
70-
}
71-
}
72-
73-
74-
@XmlRootElement
75-
@XmlAccessorType(XmlAccessType.FIELD)
76-
public static class Collection {
77-
@XmlAttribute
78-
private String name;
79-
@XmlElement
80-
private String reportName;
81-
@XmlElement
82-
private double scorePercentage;
83-
@XmlElement
84-
private long numOfFiles;
85-
@XmlElement
86-
private int numOfProfiles;
87-
@XmlElement
88-
private int numOfUniqueLinks;
89-
@XmlElement
90-
private int numOfCheckedLinks;
91-
@XmlElement
92-
private double ratioOfValidLinks;
93-
@XmlElement
94-
private double avgNumOfResProxies;
95-
@XmlElement
96-
private int numOfResProxies;
97-
@XmlElement
98-
private double ratioOfValidRecords;
99-
@XmlElement
100-
private double avgNumOfEmptyXMLElements;
101-
@XmlElement
102-
private double avgFacetCoverage;
103-
104-
@XmlElementWrapper(name = "facets")
105-
@XmlElement(name = "facet")
106-
private List<Facet> facets = new ArrayList<Facet>();
107-
108-
public Collection() {
109-
110-
}
111-
112-
public Collection(CollectionReport report) {
113-
this.name = report.getName();
114-
this.reportName = report.getName();
115-
this.scorePercentage = report.scorePercentage;
116-
this.numOfFiles = report.fileReport.numOfFiles;
117-
this.numOfProfiles = report.headerReport.profiles.totNumOfProfiles;
118-
this.numOfUniqueLinks = report.urlReport.totNumOfUniqueLinks;
119-
this.numOfCheckedLinks = report.urlReport.totNumOfCheckedLinks;
120-
this.ratioOfValidLinks = report.urlReport.ratioOfValidLinks;
121-
this.avgNumOfResProxies = report.resProxyReport.avgNumOfResProxies;
122-
this.numOfResProxies = report.resProxyReport.totNumOfResProxies;
123-
this.ratioOfValidRecords = report.xmlValidationReport.ratioOfValidRecords;
124-
this.avgNumOfEmptyXMLElements = report.xmlPopulatedReport.avgXMLEmptyElement;
125-
this.avgFacetCoverage = report.facetReport.coverage;
126-
127-
report.facetReport.facet.forEach(f -> this.facets.add(new Facet(f.name, f.coverage)));
128-
}
129-
130-
}
131-
132-
@XmlRootElement
133-
@XmlAccessorType(XmlAccessType.FIELD)
134-
public static class Facet {
135-
@XmlAttribute
136-
private String name;
137-
@XmlElement
138-
private double avgCoverage;
139-
140-
public Facet() {
141-
142-
}
143-
144-
public Facet(String name, double avgCoverage) {
145-
this.name = name;
146-
this.avgCoverage = avgCoverage;
147-
}
148-
}
22+
@XmlAttribute(name = "creation-time")
23+
public String creationTime = TimeUtils.humanizeToDate(System.currentTimeMillis());
24+
25+
@XmlElement(name = "collection")
26+
private List<Collection> collections = new ArrayList<Collection>();
27+
28+
@Override
29+
public void setParentName(String parentName) {
30+
31+
}
32+
33+
@Override
34+
public String getParentName() {
35+
36+
return null;
37+
}
38+
39+
@Override
40+
public String getName() {
41+
42+
return "CollectionsReport";
43+
}
44+
45+
@Override
46+
public boolean isValid() {
47+
48+
return false;
49+
}
50+
51+
@Override
52+
public void addSegmentScore(Score segmentScore) {
53+
54+
}
55+
56+
@Override
57+
public void toXML(OutputStream os) {
58+
XMLMarshaller<CollectionsReport> instanceMarshaller = new XMLMarshaller<>(CollectionsReport.class);
59+
instanceMarshaller.marshal(this, os);
60+
}
61+
62+
@Override
63+
public void mergeWithParent(CollectionsReport parentReport) {
64+
65+
}
66+
67+
public void addReport(Report<?> report) {
68+
if (report instanceof CollectionReport) {
69+
this.collections.add(new Collection((CollectionReport) report));
70+
}
71+
}
72+
73+
@XmlRootElement
74+
@XmlAccessorType(XmlAccessType.FIELD)
75+
public static class Collection {
76+
@XmlAttribute
77+
private String name;
78+
@XmlElement
79+
private String reportName;
80+
@XmlElement
81+
private double scorePercentage;
82+
@XmlElement
83+
private long numOfFiles;
84+
@XmlElement
85+
private int numOfProfiles;
86+
@XmlElement
87+
private int numOfUniqueLinks;
88+
@XmlElement
89+
private int numOfCheckedLinks;
90+
@XmlElement
91+
private double ratioOfValidLinks;
92+
@XmlElement
93+
private double avgNumOfResProxies;
94+
@XmlElement
95+
private int numOfResProxies;
96+
@XmlElement
97+
private double ratioOfValidRecords;
98+
@XmlElement
99+
private double avgNumOfEmptyXMLElements;
100+
@XmlElement
101+
private double avgFacetCoverage;
102+
103+
@XmlElementWrapper(name = "facets")
104+
@XmlElement(name = "facet")
105+
private List<Facet> facets = new ArrayList<Facet>();
106+
107+
public Collection() {
108+
109+
}
110+
111+
public Collection(CollectionReport report) {
112+
this.name = report.getName();
113+
this.reportName = report.getName();
114+
this.scorePercentage = report.scorePercentage;
115+
this.numOfFiles = report.fileReport.numOfFiles;
116+
this.numOfProfiles = report.headerReport.profiles.totNumOfProfiles;
117+
this.numOfUniqueLinks = report.urlReport.totNumOfUniqueLinks;
118+
this.numOfCheckedLinks = report.urlReport.totNumOfCheckedLinks;
119+
this.ratioOfValidLinks = report.urlReport.ratioOfValidLinks;
120+
this.avgNumOfResProxies = report.resProxyReport.avgNumOfResProxies;
121+
this.numOfResProxies = report.resProxyReport.totNumOfResProxies;
122+
this.ratioOfValidRecords = report.xmlValidationReport.ratioOfValidRecords;
123+
this.avgNumOfEmptyXMLElements = report.xmlPopulatedReport.avgXMLEmptyElement;
124+
this.avgFacetCoverage = report.facetReport.coverage;
125+
126+
report.facetReport.facet.forEach(f -> this.facets.add(new Facet(f.name, f.coverage)));
127+
}
128+
129+
}
130+
131+
@XmlRootElement
132+
@XmlAccessorType(XmlAccessType.FIELD)
133+
public static class Facet {
134+
@XmlAttribute
135+
private String name;
136+
@XmlElement
137+
private double avgCoverage;
138+
139+
public Facet() {
140+
141+
}
142+
143+
public Facet(String name, double avgCoverage) {
144+
this.name = name;
145+
this.avgCoverage = avgCoverage;
146+
}
147+
}
149148
}

0 commit comments

Comments
 (0)