1
0
Fork 0

Merge pull request '[graph indexing] expand the instance level fulltext in the XML records' (#326) from instance_fulltext_xml into beta

Reviewed-on: D-Net/dnet-hadoop#326
This commit is contained in:
Claudio Atzori 2023-07-27 15:02:07 +02:00
commit 1275a07d45
4 changed files with 27 additions and 3 deletions

View File

@ -57,6 +57,8 @@ public class XmlInstance implements Serializable {
// typed results
private String processingchargecurrency;
private String fulltext;
private Qualifier refereed; // peer-review status
public String getUrl() {
@ -162,4 +164,12 @@ public class XmlInstance implements Serializable {
public void setRefereed(Qualifier refereed) {
this.refereed = refereed;
}
public String getFulltext() {
return fulltext;
}
public void setFulltext(String fulltext) {
this.fulltext = fulltext;
}
}

View File

@ -1309,6 +1309,9 @@ public class XmlRecordFactory implements Serializable {
.map(d -> XmlSerializationUtils.asXmlElement("license", d))
.collect(Collectors.toList()));
}
if (StringUtils.isNotBlank(instance.getFulltext())) {
fields.add(XmlSerializationUtils.asXmlElement("fulltext", instance.getFulltext()));
}
children
.add(
@ -1459,6 +1462,9 @@ public class XmlRecordFactory implements Serializable {
Optional
.ofNullable(i.getDistributionlocation())
.ifPresent(dl -> instance.getDistributionlocation().add(dl));
Optional
.ofNullable(i.getFulltext())
.ifPresent(instance::setFulltext);
});
if (instance.getHostedby().size() > 1

View File

@ -47,8 +47,6 @@ public class XmlRecordFactoryTest {
final String xml = xmlRecordFactory.build(new JoinedEntity<>(p));
System.out.println(xml);
assertNotNull(xml);
final Document doc = new SAXReader().read(new StringReader(xml));
@ -92,6 +90,12 @@ public class XmlRecordFactoryTest {
assertEquals("EOSC::Jupyter Notebook", doc.valueOf("//*[local-name() = 'result']/eoscifguidelines/@code"));
assertEquals(2, Integer.parseInt(doc.valueOf("count(//*[local-name() = 'result']/fulltext)")));
assertEquals(
"https://osf.io/preprints/socarxiv/7vgtu/download",
doc.valueOf("//*[local-name() = 'result']/fulltext[1]"));
}
@Test

View File

@ -485,10 +485,14 @@
},
"extraInfo": [],
"format": [],
"fulltext": [],
"fulltext": [
{ "value" : "https://osf.io/preprints/socarxiv/7vgtu/download" },
{ "value" : "https://osf.io/preprints/socarxiv/7vgtu/download2" }
],
"id": "50|CSC_________::0000ec4dd9df012feaafa77e71a0fb4c",
"instance": [
{
"fulltext" : "https://osf.io/preprints/socarxiv/7vgtu/download",
"measures": [
{
"id": "influence",