1. Addition of new scimaps vis related jar file.
2. COmpleted the task of providing subdiscipline activity for an entity & other metadata to the front-end in the json format. 3/ Minor refactor of utility functions.
This commit is contained in:
parent
42d4a2ae86
commit
69311ae53f
9 changed files with 242 additions and 111 deletions
BIN
productMods/WEB-INF/lib/oim.vivo.scimapcore.jar
Normal file
BIN
productMods/WEB-INF/lib/oim.vivo.scimapcore.jar
Normal file
Binary file not shown.
|
@ -52,6 +52,7 @@ public class VisualizationFrameworkConstants {
|
||||||
public static final String INDIVIDUAL_URI_KEY = "uri";
|
public static final String INDIVIDUAL_URI_KEY = "uri";
|
||||||
public static final String VIS_MODE_KEY = "vis_mode";
|
public static final String VIS_MODE_KEY = "vis_mode";
|
||||||
public static final String RENDER_MODE_KEY = "render_mode";
|
public static final String RENDER_MODE_KEY = "render_mode";
|
||||||
|
public static final String OUTPUT_FORMAT_KEY = "output";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* These values represent possible render modes.
|
* These values represent possible render modes.
|
||||||
|
@ -121,7 +122,9 @@ public class VisualizationFrameworkConstants {
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* These values represent possible vis-modes for temporal graph vis
|
* These values represent possible data serialization formats corresponding to
|
||||||
|
* output format key.
|
||||||
* */
|
* */
|
||||||
public static final String TEMPORAL_GRAPH_JSON_DATA_VIS_MODE = "json";
|
public static final String JSON_OUTPUT_FORMAT = "json";
|
||||||
|
public static final String CSV_OUTPUT_FORMAT = "csv";
|
||||||
}
|
}
|
||||||
|
|
|
@ -138,7 +138,7 @@ public class EntityPublicationCountRequestHandler implements
|
||||||
/*
|
/*
|
||||||
* This will provide the data in json format mainly used for standalone tmeporal vis.
|
* This will provide the data in json format mainly used for standalone tmeporal vis.
|
||||||
* */
|
* */
|
||||||
if (VisualizationFrameworkConstants.TEMPORAL_GRAPH_JSON_DATA_VIS_MODE
|
if (VisualizationFrameworkConstants.JSON_OUTPUT_FORMAT
|
||||||
.equalsIgnoreCase(vitroRequest.getParameter(
|
.equalsIgnoreCase(vitroRequest.getParameter(
|
||||||
VisualizationFrameworkConstants.VIS_MODE_KEY))) {
|
VisualizationFrameworkConstants.VIS_MODE_KEY))) {
|
||||||
|
|
||||||
|
@ -306,7 +306,7 @@ public class EntityPublicationCountRequestHandler implements
|
||||||
|
|
||||||
entityJson.setEntityURI(subentity.getIndividualURI());
|
entityJson.setEntityURI(subentity.getIndividualURI());
|
||||||
|
|
||||||
boolean isPerson = UtilityFunctions.isEntityAPerson(vreq, subentity);
|
boolean isPerson = UtilityFunctions.isEntityAPerson(vreq, subentity.getIndividualURI());
|
||||||
|
|
||||||
if (isPerson) {
|
if (isPerson) {
|
||||||
entityJson.setVisMode("PERSON");
|
entityJson.setVisMode("PERSON");
|
||||||
|
|
|
@ -95,7 +95,7 @@ public class TemporalGrantVisualizationRequestHandler implements
|
||||||
/*
|
/*
|
||||||
* This will provide the data in json format mainly used for standalone temporal vis.
|
* This will provide the data in json format mainly used for standalone temporal vis.
|
||||||
* */
|
* */
|
||||||
if (VisualizationFrameworkConstants.TEMPORAL_GRAPH_JSON_DATA_VIS_MODE
|
if (VisualizationFrameworkConstants.JSON_OUTPUT_FORMAT
|
||||||
.equalsIgnoreCase(vitroRequest
|
.equalsIgnoreCase(vitroRequest
|
||||||
.getParameter(VisualizationFrameworkConstants.VIS_MODE_KEY))) {
|
.getParameter(VisualizationFrameworkConstants.VIS_MODE_KEY))) {
|
||||||
|
|
||||||
|
|
|
@ -207,7 +207,7 @@ public class TemporalPublicationVisualizationRequestHandler implements
|
||||||
/*
|
/*
|
||||||
* This will provide the data in json format mainly used for standalone tmeporal vis.
|
* This will provide the data in json format mainly used for standalone tmeporal vis.
|
||||||
* */
|
* */
|
||||||
if (VisualizationFrameworkConstants.TEMPORAL_GRAPH_JSON_DATA_VIS_MODE
|
if (VisualizationFrameworkConstants.JSON_OUTPUT_FORMAT
|
||||||
.equalsIgnoreCase(vitroRequest.getParameter(
|
.equalsIgnoreCase(vitroRequest.getParameter(
|
||||||
VisualizationFrameworkConstants.VIS_MODE_KEY))) {
|
VisualizationFrameworkConstants.VIS_MODE_KEY))) {
|
||||||
|
|
||||||
|
|
|
@ -85,7 +85,7 @@ public class EntityGrantCountRequestHandler implements
|
||||||
/*
|
/*
|
||||||
* This will provide the data in json format mainly used for standalone temporal vis.
|
* This will provide the data in json format mainly used for standalone temporal vis.
|
||||||
* */
|
* */
|
||||||
if (VisualizationFrameworkConstants.TEMPORAL_GRAPH_JSON_DATA_VIS_MODE
|
if (VisualizationFrameworkConstants.JSON_OUTPUT_FORMAT
|
||||||
.equalsIgnoreCase(vitroRequest
|
.equalsIgnoreCase(vitroRequest
|
||||||
.getParameter(VisualizationFrameworkConstants.VIS_MODE_KEY))) {
|
.getParameter(VisualizationFrameworkConstants.VIS_MODE_KEY))) {
|
||||||
|
|
||||||
|
@ -304,7 +304,7 @@ public class EntityGrantCountRequestHandler implements
|
||||||
|
|
||||||
entityJson.setEntityURI(subentity.getIndividualURI());
|
entityJson.setEntityURI(subentity.getIndividualURI());
|
||||||
|
|
||||||
if (UtilityFunctions.isEntityAPerson(vreq, subentity)) {
|
if (UtilityFunctions.isEntityAPerson(vreq, subentity.getIndividualURI())) {
|
||||||
entityJson.setVisMode("PERSON");
|
entityJson.setVisMode("PERSON");
|
||||||
} else {
|
} else {
|
||||||
entityJson.setVisMode("ORGANIZATION");
|
entityJson.setVisMode("ORGANIZATION");
|
||||||
|
|
|
@ -2,11 +2,15 @@
|
||||||
|
|
||||||
package edu.cornell.mannlib.vitro.webapp.visualization.mapofscience;
|
package edu.cornell.mannlib.vitro.webapp.visualization.mapofscience;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import mapping.ScienceMapping;
|
||||||
|
import mapping.ScienceMappingResult;
|
||||||
|
|
||||||
import org.apache.commons.lang.StringEscapeUtils;
|
import org.apache.commons.lang.StringEscapeUtils;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
|
@ -130,7 +134,7 @@ public class MapOfScienceVisualizationRequestHandler implements
|
||||||
if (VisConstants.DataVisMode.JSON.equals(visMode)) {
|
if (VisConstants.DataVisMode.JSON.equals(visMode)) {
|
||||||
return prepareStandaloneDataResponse(vitroRequest, organizationEntity);
|
return prepareStandaloneDataResponse(vitroRequest, organizationEntity);
|
||||||
} else {
|
} else {
|
||||||
return prepareDataResponse(organizationEntity);
|
return prepareDataResponse(vitroRequest, organizationEntity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -138,12 +142,13 @@ public class MapOfScienceVisualizationRequestHandler implements
|
||||||
/**
|
/**
|
||||||
* Provides response when json file containing the publication count over the
|
* Provides response when json file containing the publication count over the
|
||||||
* years is requested.
|
* years is requested.
|
||||||
|
* @param vitroRequest
|
||||||
*
|
*
|
||||||
* @param entity
|
* @param entity
|
||||||
* @param subentities
|
* @param subentities
|
||||||
* @param subOrganizationTypesResult
|
* @param subOrganizationTypesResult
|
||||||
*/
|
*/
|
||||||
private Map<String, String> prepareDataResponse(Entity entity) {
|
private Map<String, String> prepareDataResponse(VitroRequest vitroRequest, Entity entity) {
|
||||||
|
|
||||||
String entityLabel = entity.getEntityLabel();
|
String entityLabel = entity.getEntityLabel();
|
||||||
|
|
||||||
|
@ -190,7 +195,7 @@ public class MapOfScienceVisualizationRequestHandler implements
|
||||||
fileData.put(DataVisualizationController.FILE_CONTENT_TYPE_KEY,
|
fileData.put(DataVisualizationController.FILE_CONTENT_TYPE_KEY,
|
||||||
"application/octet-stream");
|
"application/octet-stream");
|
||||||
fileData.put(DataVisualizationController.FILE_CONTENT_KEY,
|
fileData.put(DataVisualizationController.FILE_CONTENT_KEY,
|
||||||
"{\"error\" : \"No Publications for this Organization found in VIVO.\"}");
|
"{\"error\" : \"No Publications for this Entity found in VIVO.\"}");
|
||||||
return fileData;
|
return fileData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -202,48 +207,29 @@ public class MapOfScienceVisualizationRequestHandler implements
|
||||||
String entityURI = vitroRequest
|
String entityURI = vitroRequest
|
||||||
.getParameter(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY);
|
.getParameter(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY);
|
||||||
|
|
||||||
/*
|
if (StringUtils.isBlank(entityURI)) {
|
||||||
* This will provide the data in json format mainly used for standalone tmeporal vis.
|
entityURI = OrganizationUtilityFunctions
|
||||||
* */
|
|
||||||
if (VisualizationFrameworkConstants.TEMPORAL_GRAPH_JSON_DATA_VIS_MODE
|
|
||||||
.equalsIgnoreCase(vitroRequest.getParameter(
|
|
||||||
VisualizationFrameworkConstants.VIS_MODE_KEY))) {
|
|
||||||
|
|
||||||
if (StringUtils.isNotBlank(entityURI)) {
|
|
||||||
|
|
||||||
return getSubjectEntityAndGenerateDataResponse(
|
|
||||||
vitroRequest,
|
|
||||||
log,
|
|
||||||
dataset,
|
|
||||||
entityURI,
|
|
||||||
VisConstants.DataVisMode.JSON);
|
|
||||||
} else {
|
|
||||||
|
|
||||||
return getSubjectEntityAndGenerateDataResponse(
|
|
||||||
vitroRequest,
|
|
||||||
log,
|
|
||||||
dataset,
|
|
||||||
OrganizationUtilityFunctions
|
|
||||||
.getStaffProvidedOrComputedHighestLevelOrganization(
|
.getStaffProvidedOrComputedHighestLevelOrganization(
|
||||||
log,
|
log,
|
||||||
dataset,
|
dataset,
|
||||||
vitroRequest),
|
vitroRequest);
|
||||||
VisConstants.DataVisMode.JSON);
|
}
|
||||||
|
|
||||||
|
VisConstants.DataVisMode currentDataVisMode = VisConstants.DataVisMode.CSV;
|
||||||
|
|
||||||
|
if (VisualizationFrameworkConstants.JSON_OUTPUT_FORMAT
|
||||||
|
.equalsIgnoreCase(vitroRequest.getParameter(
|
||||||
|
VisualizationFrameworkConstants.OUTPUT_FORMAT_KEY))) {
|
||||||
|
currentDataVisMode = VisConstants.DataVisMode.JSON;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
|
||||||
/*
|
|
||||||
* This provides csv download files for the content in the tables.
|
|
||||||
* */
|
|
||||||
|
|
||||||
return getSubjectEntityAndGenerateDataResponse(
|
return getSubjectEntityAndGenerateDataResponse(
|
||||||
vitroRequest,
|
vitroRequest,
|
||||||
log,
|
log,
|
||||||
dataset,
|
dataset,
|
||||||
entityURI,
|
entityURI,
|
||||||
VisConstants.DataVisMode.CSV);
|
currentDataVisMode);
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -251,7 +237,7 @@ public class MapOfScienceVisualizationRequestHandler implements
|
||||||
@Override
|
@Override
|
||||||
public Object generateAjaxVisualization(VitroRequest vitroRequest, Log log,
|
public Object generateAjaxVisualization(VitroRequest vitroRequest, Log log,
|
||||||
Dataset dataset) throws MalformedQueryParametersException {
|
Dataset dataset) throws MalformedQueryParametersException {
|
||||||
throw new UnsupportedOperationException("Entity Pub Count does not provide Ajax Response.");
|
throw new UnsupportedOperationException("Map of Science Vis does not provide Ajax Response.");
|
||||||
}
|
}
|
||||||
|
|
||||||
private Map<String, String> prepareStandaloneDataResponse(
|
private Map<String, String> prepareStandaloneDataResponse(
|
||||||
|
@ -299,27 +285,60 @@ public class MapOfScienceVisualizationRequestHandler implements
|
||||||
Gson json = new Gson();
|
Gson json = new Gson();
|
||||||
Set jsonContent = new HashSet();
|
Set jsonContent = new HashSet();
|
||||||
|
|
||||||
for (SubEntity subentity : subjectEntity.getSubEntities()) {
|
MapOfScience entityJson = new MapOfScience(subjectEntity.getIndividualURI());
|
||||||
|
entityJson.setLabel(subjectEntity.getIndividualLabel());
|
||||||
|
|
||||||
MapOfScience entityJson = new MapOfScience(subentity.getIndividualURI());
|
if (UtilityFunctions.isEntityAPerson(vreq, subjectEntity.getEntityURI())) {
|
||||||
|
|
||||||
entityJson.setLabel(subentity.getIndividualLabel());
|
|
||||||
|
|
||||||
entityJson.setLastCachedAtDateTime(subentity.getLastCachedAtDateTime());
|
|
||||||
|
|
||||||
if (subentity.getEntityClass().equals(VOConstants.EntityClassType.PERSON)) {
|
|
||||||
entityJson.setType("PERSON");
|
entityJson.setType("PERSON");
|
||||||
} else if (subentity.getEntityClass().equals(VOConstants.EntityClassType.ORGANIZATION)) {
|
} else {
|
||||||
entityJson.setType("ORGANIZATION");
|
entityJson.setType("ORGANIZATION");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Set<Activity> publicationsForEntity = new HashSet<Activity>();
|
||||||
|
|
||||||
|
for (SubEntity subentity : subjectEntity.getSubEntities()) {
|
||||||
|
|
||||||
|
Set<Activity> subEntityActivities = subentity.getActivities();
|
||||||
|
publicationsForEntity.addAll(subEntityActivities);
|
||||||
|
|
||||||
|
|
||||||
|
String subEntityType = "ORGANIZATION";
|
||||||
|
|
||||||
|
if (subentity.getEntityClass().equals(VOConstants.EntityClassType.PERSON)) {
|
||||||
|
subEntityType = "PERSON";
|
||||||
|
}
|
||||||
|
|
||||||
|
entityJson.addSubEntity(subentity.getIndividualURI(),
|
||||||
|
subentity.getIndividualLabel(),
|
||||||
|
subEntityType,
|
||||||
|
subEntityActivities.size());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
PublicationJournalStats publicationStats = getPublicationJournalStats(publicationsForEntity);
|
||||||
|
|
||||||
|
entityJson.setPubsWithNoJournals(publicationStats.noJournalCount);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This method side-effects entityJson by updating its counts for mapped publications,
|
||||||
|
* publications with no journal names & publications with invalid journal names &
|
||||||
|
* map of subdiscipline to activity.
|
||||||
|
* */
|
||||||
|
updateEntityMapOfScienceInformation(entityJson,
|
||||||
|
publicationStats.journalToPublicationCount);
|
||||||
|
|
||||||
|
jsonContent.add(entityJson);
|
||||||
|
|
||||||
|
return json.toJson(jsonContent);
|
||||||
|
}
|
||||||
|
|
||||||
|
private PublicationJournalStats getPublicationJournalStats(
|
||||||
|
Set<Activity> subEntityActivities) {
|
||||||
|
|
||||||
Map<String, Integer> journalToPublicationCount = new HashMap<String, Integer>();
|
Map<String, Integer> journalToPublicationCount = new HashMap<String, Integer>();
|
||||||
|
int publicationsWithNoJournalCount = 0;
|
||||||
|
|
||||||
int mappedPublicationCount = 0;
|
for (Activity activity : subEntityActivities) {
|
||||||
int unMappedPublicationCount = 0;
|
|
||||||
|
|
||||||
for (Activity activity : subentity.getActivities()) {
|
|
||||||
|
|
||||||
if (StringUtils.isNotBlank(((MapOfScienceActivity) activity).getPublishedInJournal())) {
|
if (StringUtils.isNotBlank(((MapOfScienceActivity) activity).getPublishedInJournal())) {
|
||||||
|
|
||||||
|
@ -333,23 +352,50 @@ public class MapOfScienceVisualizationRequestHandler implements
|
||||||
journalToPublicationCount.put(journalName, 1);
|
journalToPublicationCount.put(journalName, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
mappedPublicationCount++;
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
unMappedPublicationCount++;
|
publicationsWithNoJournalCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return new PublicationJournalStats(publicationsWithNoJournalCount, journalToPublicationCount);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateEntityMapOfScienceInformation(MapOfScience entityJson,
|
||||||
|
Map<String, Integer> journalToPublicationCount) {
|
||||||
|
// System.out.println("journalToPublicationCount " + journalToPublicationCount);
|
||||||
|
|
||||||
|
int mappedPublicationCount = 0;
|
||||||
|
int publicationsWithInvalidJournalCount = 0;
|
||||||
|
|
||||||
|
ScienceMappingResult result = null;
|
||||||
|
Map<Integer, Float> subdisciplineToActivity = new HashMap<Integer, Float>();
|
||||||
|
|
||||||
|
try {
|
||||||
|
result = (new ScienceMapping()).generateScienceMappingResult(journalToPublicationCount);
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
System.err.println("NumberFormatException coming from Map Of Science Vis");
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (IOException e) {
|
||||||
|
System.err.println("IOException coming from Map Of Science Vis");
|
||||||
|
e.printStackTrace();
|
||||||
|
} finally {
|
||||||
|
|
||||||
|
if (result != null) {
|
||||||
|
subdisciplineToActivity = result.getMappedResult();
|
||||||
|
publicationsWithInvalidJournalCount = Math.round(result.getUnMappedPublications());
|
||||||
|
mappedPublicationCount = Math.round(result.getMappedPublications());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// System.out.println("subdisciplineToActivity " + subdisciplineToActivity);
|
||||||
|
|
||||||
entityJson.setPubsMapped(mappedPublicationCount);
|
entityJson.setPubsMapped(mappedPublicationCount);
|
||||||
entityJson.setPubsUnmapped(unMappedPublicationCount);
|
entityJson.setPubsWithInvalidJournals(publicationsWithInvalidJournalCount);
|
||||||
entityJson.setSubdisciplineActivity(journalToPublicationCount);
|
|
||||||
|
|
||||||
jsonContent.add(entityJson);
|
entityJson.setSubdisciplineActivity(subdisciplineToActivity);
|
||||||
}
|
|
||||||
|
|
||||||
return json.toJson(jsonContent);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getEntityPublicationsPerYearCSVContent(Entity entity) {
|
private String getEntityPublicationsPerYearCSVContent(Entity entity) {
|
||||||
|
@ -373,4 +419,18 @@ public class MapOfScienceVisualizationRequestHandler implements
|
||||||
return csvFileContent.toString();
|
return csvFileContent.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private class PublicationJournalStats {
|
||||||
|
|
||||||
|
int noJournalCount;
|
||||||
|
Map<String, Integer> journalToPublicationCount;
|
||||||
|
|
||||||
|
public PublicationJournalStats(int noJournalCount,
|
||||||
|
Map<String, Integer> journalToPublicationCount) {
|
||||||
|
|
||||||
|
this.noJournalCount = noJournalCount;
|
||||||
|
this.journalToPublicationCount = journalToPublicationCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -2,7 +2,9 @@
|
||||||
package edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.json;
|
package edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.json;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
public class MapOfScience {
|
public class MapOfScience {
|
||||||
|
|
||||||
|
@ -10,9 +12,11 @@ public class MapOfScience {
|
||||||
private String label;
|
private String label;
|
||||||
private String type;
|
private String type;
|
||||||
private int pubsMapped;
|
private int pubsMapped;
|
||||||
private int pubsUnmapped;
|
private int pubsWithNoJournals;
|
||||||
|
private int pubsWithInvalidJournals;
|
||||||
private String lastCachedAtDateTime;
|
private String lastCachedAtDateTime;
|
||||||
private Map<String, Integer> subdisciplineActivity = new HashMap<String, Integer>();
|
private Map<Integer, Float> subdisciplineActivity = new HashMap<Integer, Float>();
|
||||||
|
private Set<SubEntityInfo> subEntities = new HashSet<SubEntityInfo>();
|
||||||
|
|
||||||
public MapOfScience(String uri) {
|
public MapOfScience(String uri) {
|
||||||
this.uri = uri;
|
this.uri = uri;
|
||||||
|
@ -43,16 +47,24 @@ public class MapOfScience {
|
||||||
public int getPubsMapped() {
|
public int getPubsMapped() {
|
||||||
return pubsMapped;
|
return pubsMapped;
|
||||||
}
|
}
|
||||||
public void setPubsUnmapped(int pubsUnmapped) {
|
public void setPubsWithNoJournals(int pubsUnmapped) {
|
||||||
this.pubsUnmapped = pubsUnmapped;
|
this.pubsWithNoJournals = pubsUnmapped;
|
||||||
}
|
}
|
||||||
public int getPubsUnmapped() {
|
public int getPubsWithNoJournals() {
|
||||||
return pubsUnmapped;
|
return pubsWithNoJournals;
|
||||||
}
|
}
|
||||||
public void setSubdisciplineActivity(Map<String, Integer> subdisciplineActivity) {
|
public void setPubsWithInvalidJournals(int pubsWithInvalidJournals) {
|
||||||
|
this.pubsWithInvalidJournals = pubsWithInvalidJournals;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getPubsWithInvalidJournals() {
|
||||||
|
return pubsWithInvalidJournals;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSubdisciplineActivity(Map<Integer, Float> subdisciplineActivity) {
|
||||||
this.subdisciplineActivity = subdisciplineActivity;
|
this.subdisciplineActivity = subdisciplineActivity;
|
||||||
}
|
}
|
||||||
public Map<String, Integer> getSubdisciplineActivity() {
|
public Map<Integer, Float> getSubdisciplineActivity() {
|
||||||
return subdisciplineActivity;
|
return subdisciplineActivity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,4 +76,60 @@ public class MapOfScience {
|
||||||
return lastCachedAtDateTime;
|
return lastCachedAtDateTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void addSubEntity(String uri, String label, String type, int pubs) {
|
||||||
|
this.subEntities.add(new SubEntityInfo(uri, label, type, pubs));
|
||||||
|
}
|
||||||
|
|
||||||
|
public Set<SubEntityInfo> getSubEntities() {
|
||||||
|
return subEntities;
|
||||||
|
}
|
||||||
|
|
||||||
|
private class SubEntityInfo {
|
||||||
|
|
||||||
|
private String uri;
|
||||||
|
private String label;
|
||||||
|
private String type;
|
||||||
|
private int pubs;
|
||||||
|
|
||||||
|
public SubEntityInfo(String uri, String label, String type, int pubs) {
|
||||||
|
this.uri = uri;
|
||||||
|
this.label = label;
|
||||||
|
this.type = type;
|
||||||
|
this.pubs = pubs;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUri() {
|
||||||
|
return uri;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUri(String uri) {
|
||||||
|
this.uri = uri;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLabel() {
|
||||||
|
return label;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLabel(String label) {
|
||||||
|
this.label = label;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(String type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getPubs() {
|
||||||
|
return pubs;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPubs(int pubs) {
|
||||||
|
this.pubs = pubs;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -251,10 +251,10 @@ public class UtilityFunctions {
|
||||||
return collaboratorshipNetworkURL != null ? collaboratorshipNetworkURL : "" ;
|
return collaboratorshipNetworkURL != null ? collaboratorshipNetworkURL : "" ;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isEntityAPerson(VitroRequest vreq, SubEntity subentity) {
|
public static boolean isEntityAPerson(VitroRequest vreq, String individualURI) {
|
||||||
return vreq.getWebappDaoFactory()
|
return vreq.getWebappDaoFactory()
|
||||||
.getIndividualDao()
|
.getIndividualDao()
|
||||||
.getIndividualByURI(subentity.getIndividualURI())
|
.getIndividualByURI(individualURI)
|
||||||
.isVClass("http://xmlns.com/foaf/0.1/Person");
|
.isVClass("http://xmlns.com/foaf/0.1/Person");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue