From 3866f8160d2e0aa1b35202e7d6586875e62c739e Mon Sep 17 00:00:00 2001 From: William Welling Date: Mon, 6 Apr 2020 13:26:56 -0500 Subject: [PATCH 1/4] add altmetric score and citation count to document --- .../middleware/discovery/model/Document.java | 24 +++++++++++++++++++ .../sparql/document/altmetricScore.sparql | 7 ++++++ .../sparql/document/citationCount.sparql | 7 ++++++ 3 files changed, 38 insertions(+) create mode 100644 src/main/resources/templates/sparql/document/altmetricScore.sparql create mode 100644 src/main/resources/templates/sparql/document/citationCount.sparql diff --git a/src/main/java/edu/tamu/scholars/middleware/discovery/model/Document.java b/src/main/java/edu/tamu/scholars/middleware/discovery/model/Document.java index 9fe0a980e..3f2d161b1 100644 --- a/src/main/java/edu/tamu/scholars/middleware/discovery/model/Document.java +++ b/src/main/java/edu/tamu/scholars/middleware/discovery/model/Document.java @@ -431,6 +431,14 @@ public class Document extends Common { @PropertySource(template = "document/receipt", predicate = "http://www.w3.org/2000/01/rdf-schema#label") private List receipts; + @Indexed(type = "pfloat", copyTo = "_text_") + @PropertySource(template = "document/altmetricScore", predicate = "http://vivo.library.tamu.edu/ontology/TAMU#altmetricScore") + private float altmetricScore; + + @Indexed(type = "pint", copyTo = "_text_") + @PropertySource(template = "document/citationCount", predicate = "http://vivo.library.tamu.edu/ontology/TAMU#citationCount") + private int citationCount; + public Document() { } @@ -1179,4 +1187,20 @@ public void setReceipts(List receipts) { this.receipts = receipts; } + public float getAltmetricScore() { + return altmetricScore; + } + + public void setAltmetricScore(float altmetricScore) { + this.altmetricScore = altmetricScore; + } + + public int getCitationCount() { + return citationCount; + } + + public void setCitationCount(int citationCount) { + this.citationCount = citationCount; + } + } diff --git a/src/main/resources/templates/sparql/document/altmetricScore.sparql b/src/main/resources/templates/sparql/document/altmetricScore.sparql new file mode 100644 index 000000000..b37b31d23 --- /dev/null +++ b/src/main/resources/templates/sparql/document/altmetricScore.sparql @@ -0,0 +1,7 @@ +PREFIX tamu: + +CONSTRUCT { + <{{uri}}> tamu:AltmetricScore ?altmetricScore . +} WHERE { + <{{uri}}> tamu:AltmetricScore ?altmetricScore . +} \ No newline at end of file diff --git a/src/main/resources/templates/sparql/document/citationCount.sparql b/src/main/resources/templates/sparql/document/citationCount.sparql new file mode 100644 index 000000000..4dc4cf356 --- /dev/null +++ b/src/main/resources/templates/sparql/document/citationCount.sparql @@ -0,0 +1,7 @@ +PREFIX tamu: + +CONSTRUCT { + <{{uri}}> tamu:CitationCount ?citationCount . +} WHERE { + <{{uri}}> tamu:CitationCount ?citationCount . +} \ No newline at end of file From a97abcf6acc45f759edd3d93ae403af090060ea2 Mon Sep 17 00:00:00 2001 From: William Welling Date: Mon, 6 Apr 2020 14:02:19 -0500 Subject: [PATCH 2/4] add generated document --- .../middleware/graphql/model/Document.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/main/java/edu/tamu/scholars/middleware/graphql/model/Document.java b/src/main/java/edu/tamu/scholars/middleware/graphql/model/Document.java index 17327c9a7..4bcb44a56 100644 --- a/src/main/java/edu/tamu/scholars/middleware/graphql/model/Document.java +++ b/src/main/java/edu/tamu/scholars/middleware/graphql/model/Document.java @@ -187,6 +187,10 @@ public class Document extends AbstractNestedDocument { private String isTemplate; + private float altmetricScore; + + private int citationCount; + private List type; private String image; @@ -739,6 +743,22 @@ public void setIsTemplate(String isTemplate) { this.isTemplate = isTemplate; } + public float getAltmetricScore() { + return altmetricScore; + } + + public void setAltmetricScore(float altmetricScore) { + this.altmetricScore = altmetricScore; + } + + public int getCitationCount() { + return citationCount; + } + + public void setCitationCount(int citationCount) { + this.citationCount = citationCount; + } + public List getType() { return type; } From b03c70a12fadd242c1bee512bf23fea845192436 Mon Sep 17 00:00:00 2001 From: William Welling Date: Mon, 6 Apr 2020 14:17:46 -0500 Subject: [PATCH 3/4] update document display view, use string data type --- .../middleware/discovery/model/Document.java | 20 +++++++++---------- .../middleware/graphql/model/Document.java | 12 +++++------ src/main/resources/defaults/displayViews.yml | 6 ++++++ .../documents/overview/altmetricScore.html | 1 + .../documents/overview/citationCount.html | 1 + 5 files changed, 24 insertions(+), 16 deletions(-) create mode 100644 src/main/resources/defaults/displayViews/documents/overview/altmetricScore.html create mode 100644 src/main/resources/defaults/displayViews/documents/overview/citationCount.html diff --git a/src/main/java/edu/tamu/scholars/middleware/discovery/model/Document.java b/src/main/java/edu/tamu/scholars/middleware/discovery/model/Document.java index 3f2d161b1..bb52cc37e 100644 --- a/src/main/java/edu/tamu/scholars/middleware/discovery/model/Document.java +++ b/src/main/java/edu/tamu/scholars/middleware/discovery/model/Document.java @@ -330,7 +330,7 @@ public class Document extends Common { @PropertySource(template = "document/iclCode", predicate = "http://vivoweb.org/ontology/core#iclCode") private String iclCode; - @Indexed(type = "whole_string") + @Indexed(type = "sorting_string") @PropertySource(template = "document/numberOfPages", predicate = "http://purl.org/ontology/bibo/numPages") private String numberOfPages; @@ -350,7 +350,7 @@ public class Document extends Common { @PropertySource(template = "document/issue", predicate = "http://purl.org/ontology/bibo/issue") private String issue; - @Indexed(type = "whole_string") + @Indexed(type = "sorting_string") @PropertySource(template = "document/placeOfPublication", predicate = "http://vivoweb.org/ontology/core#placeOfPublication") private String placeOfPublication; @@ -431,13 +431,13 @@ public class Document extends Common { @PropertySource(template = "document/receipt", predicate = "http://www.w3.org/2000/01/rdf-schema#label") private List receipts; - @Indexed(type = "pfloat", copyTo = "_text_") + @Indexed(type = "sorting_string", copyTo = "_text_") @PropertySource(template = "document/altmetricScore", predicate = "http://vivo.library.tamu.edu/ontology/TAMU#altmetricScore") - private float altmetricScore; + private String altmetricScore; - @Indexed(type = "pint", copyTo = "_text_") + @Indexed(type = "sorting_string", copyTo = "_text_") @PropertySource(template = "document/citationCount", predicate = "http://vivo.library.tamu.edu/ontology/TAMU#citationCount") - private int citationCount; + private String citationCount; public Document() { @@ -1187,19 +1187,19 @@ public void setReceipts(List receipts) { this.receipts = receipts; } - public float getAltmetricScore() { + public String getAltmetricScore() { return altmetricScore; } - public void setAltmetricScore(float altmetricScore) { + public void setAltmetricScore(String altmetricScore) { this.altmetricScore = altmetricScore; } - public int getCitationCount() { + public String getCitationCount() { return citationCount; } - public void setCitationCount(int citationCount) { + public void setCitationCount(String citationCount) { this.citationCount = citationCount; } diff --git a/src/main/java/edu/tamu/scholars/middleware/graphql/model/Document.java b/src/main/java/edu/tamu/scholars/middleware/graphql/model/Document.java index 4bcb44a56..971c6d9c6 100644 --- a/src/main/java/edu/tamu/scholars/middleware/graphql/model/Document.java +++ b/src/main/java/edu/tamu/scholars/middleware/graphql/model/Document.java @@ -187,9 +187,9 @@ public class Document extends AbstractNestedDocument { private String isTemplate; - private float altmetricScore; + private String altmetricScore; - private int citationCount; + private String citationCount; private List type; @@ -743,19 +743,19 @@ public void setIsTemplate(String isTemplate) { this.isTemplate = isTemplate; } - public float getAltmetricScore() { + public String getAltmetricScore() { return altmetricScore; } - public void setAltmetricScore(float altmetricScore) { + public void setAltmetricScore(String altmetricScore) { this.altmetricScore = altmetricScore; } - public int getCitationCount() { + public String getCitationCount() { return citationCount; } - public void setCitationCount(int citationCount) { + public void setCitationCount(String citationCount) { this.citationCount = citationCount; } diff --git a/src/main/resources/defaults/displayViews.yml b/src/main/resources/defaults/displayViews.yml index e8cdd3d33..4e9a3912a 100644 --- a/src/main/resources/defaults/displayViews.yml +++ b/src/main/resources/defaults/displayViews.yml @@ -877,6 +877,12 @@ - name: keywords template: "defaults/displayViews/documents/overview/keywords.html" field: keywords + - name: altmetric score + template: "defaults/displayViews/documents/overview/altmetricScore.html" + field: altmetricScore + - name: citation count + template: "defaults/displayViews/documents/overview/citationCount.html" + field: citationCount - name: Identity sections: - name: EAN International-Uniform Code Council (EAN-UCC) 13 diff --git a/src/main/resources/defaults/displayViews/documents/overview/altmetricScore.html b/src/main/resources/defaults/displayViews/documents/overview/altmetricScore.html new file mode 100644 index 000000000..3200d75c1 --- /dev/null +++ b/src/main/resources/defaults/displayViews/documents/overview/altmetricScore.html @@ -0,0 +1 @@ +

{{{altmetricScore}}}

\ No newline at end of file diff --git a/src/main/resources/defaults/displayViews/documents/overview/citationCount.html b/src/main/resources/defaults/displayViews/documents/overview/citationCount.html new file mode 100644 index 000000000..40ea645f8 --- /dev/null +++ b/src/main/resources/defaults/displayViews/documents/overview/citationCount.html @@ -0,0 +1 @@ +

{{{citationCount}}}

\ No newline at end of file From 97b35026ecb13e95b6a36bcd444cd7d85c0727c4 Mon Sep 17 00:00:00 2001 From: William Welling Date: Mon, 6 Apr 2020 15:17:26 -0500 Subject: [PATCH 4/4] fix altmetric score and citation count predicate --- .../tamu/scholars/middleware/discovery/model/Document.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/edu/tamu/scholars/middleware/discovery/model/Document.java b/src/main/java/edu/tamu/scholars/middleware/discovery/model/Document.java index bb52cc37e..ee543371d 100644 --- a/src/main/java/edu/tamu/scholars/middleware/discovery/model/Document.java +++ b/src/main/java/edu/tamu/scholars/middleware/discovery/model/Document.java @@ -432,11 +432,11 @@ public class Document extends Common { private List receipts; @Indexed(type = "sorting_string", copyTo = "_text_") - @PropertySource(template = "document/altmetricScore", predicate = "http://vivo.library.tamu.edu/ontology/TAMU#altmetricScore") + @PropertySource(template = "document/altmetricScore", predicate = "http://vivo.library.tamu.edu/ontology/TAMU#AltmetricScore") private String altmetricScore; @Indexed(type = "sorting_string", copyTo = "_text_") - @PropertySource(template = "document/citationCount", predicate = "http://vivo.library.tamu.edu/ontology/TAMU#citationCount") + @PropertySource(template = "document/citationCount", predicate = "http://vivo.library.tamu.edu/ontology/TAMU#CitationCount") private String citationCount; public Document() {