Due to changes from the ontology, this have to be fixed. We should customize this to be flexible adopt to future ontology changes

- Change core:roleIn to core:roleContributesTo
- Change core:relatedRole to core:contributingRole
Remove no publication venue from CSV while there it's value is zero.
This commit is contained in:
kongchinhua 2011-12-06 22:14:40 +00:00
parent ce85a51d9b
commit b1db3b2daa
6 changed files with 38 additions and 36 deletions

View file

@ -38,9 +38,9 @@ public class CoPIGrantCountConstructQueryRunner implements ModelConstructor {
.getLog(CoPIGrantCountConstructQueryRunner.class.getName()); .getLog(CoPIGrantCountConstructQueryRunner.class.getName());
private static final String SPARQL_QUERY_COMMON_CONSTRUCT_AND_WHERE_STRING = private static final String SPARQL_QUERY_COMMON_CONSTRUCT_AND_WHERE_STRING =
"?Role core:roleIn ?Grant . " "?Role core:roleContributesTo ?Grant . "
// + "?Grant rdfs:label ?GrantLabel . " // + "?Grant rdfs:label ?GrantLabel . "
+ "?Grant core:relatedRole ?RelatedRole . "; + "?Grant core:contributingRole ?RelatedRole . ";
public CoPIGrantCountConstructQueryRunner(String egoURI, Dataset dataset, public CoPIGrantCountConstructQueryRunner(String egoURI, Dataset dataset,
Log log) { Log log) {
@ -160,7 +160,7 @@ public class CoPIGrantCountConstructQueryRunner implements ModelConstructor {
+ ">" + ">"
+ preboundProperty + preboundProperty
+ " ?Role . " + " ?Role . "
+ "?Role core:roleIn ?Grant ." + "?Role core:roleContributesTo ?Grant ."
+ "?Grant core:dateTimeInterval ?dateTimeIntervalValueForGrant . " + "?Grant core:dateTimeInterval ?dateTimeIntervalValueForGrant . "
+ "?dateTimeIntervalValueForGrant core:start ?startDateForGrant . " + "?dateTimeIntervalValueForGrant core:start ?startDateForGrant . "
+ "?startDateForGrant core:dateTime ?startDateTimeValueForGrant . " + "?startDateForGrant core:dateTime ?startDateTimeValueForGrant . "
@ -174,7 +174,7 @@ public class CoPIGrantCountConstructQueryRunner implements ModelConstructor {
+ ">" + ">"
+ preboundProperty + preboundProperty
+ " ?Role . " + " ?Role . "
+ "?Role core:roleIn ?Grant ." + "?Role core:roleContributesTo ?Grant ."
+ "?Grant core:dateTimeInterval ?dateTimeIntervalValueForGrant . " + "?Grant core:dateTimeInterval ?dateTimeIntervalValueForGrant . "
+ "?dateTimeIntervalValueForGrant core:start ?startDateForGrant . " + "?dateTimeIntervalValueForGrant core:start ?startDateForGrant . "
+ "?startDateForGrant core:dateTime ?startDateTimeValueForGrant . " + "?startDateForGrant core:dateTime ?startDateTimeValueForGrant . "
@ -185,7 +185,7 @@ public class CoPIGrantCountConstructQueryRunner implements ModelConstructor {
// + ">" // + ">"
// + preboundProperty // + preboundProperty
// + " ?Role . " // + " ?Role . "
// + "?Role core:roleIn ?Grant ." // + "?Role core:roleContributesTo ?Grant ."
// + "?Grant core:dateTimeInterval ?dateTimeIntervalValueForGrant . " // + "?Grant core:dateTimeInterval ?dateTimeIntervalValueForGrant . "
// + "?dateTimeIntervalValueForGrant core:end ?endDateForGrant . " // + "?dateTimeIntervalValueForGrant core:end ?endDateForGrant . "
// + "?endDateForGrant core:dateTime ?endDateTimeValueForGrant . " // + "?endDateForGrant core:dateTime ?endDateTimeValueForGrant . "

View file

@ -115,9 +115,9 @@ public class CoPIGrantCountQueryRunner implements QueryRunner<CollaborationData>
+ "<" + queryURI + "> core:hasCo-PrincipalInvestigatorRole ?Role . " + "<" + queryURI + "> core:hasCo-PrincipalInvestigatorRole ?Role . "
+ "?Role core:roleIn ?Grant . " + "?Role core:roleContributesTo ?Grant . "
+ "?Grant core:relatedRole ?RelatedRole . " + "?Grant core:contributingRole ?RelatedRole . "
+ "?RelatedRole core:principalInvestigatorRoleOf ?CoPI . " + "?RelatedRole core:principalInvestigatorRoleOf ?CoPI . "
@ -135,9 +135,9 @@ public class CoPIGrantCountQueryRunner implements QueryRunner<CollaborationData>
+ "<" + queryURI + "> core:hasCo-PrincipalInvestigatorRole ?Role . " + "<" + queryURI + "> core:hasCo-PrincipalInvestigatorRole ?Role . "
+ "?Role core:roleIn ?Grant . " + "?Role core:roleContributesTo ?Grant . "
+ "?Grant core:relatedRole ?RelatedRole . " + "?Grant core:contributingRole ?RelatedRole . "
+ "?RelatedRole core:investigatorRoleOf ?CoPI . " + "?RelatedRole core:investigatorRoleOf ?CoPI . "
@ -156,9 +156,9 @@ public class CoPIGrantCountQueryRunner implements QueryRunner<CollaborationData>
+ "<" + queryURI + "> core:hasCo-PrincipalInvestigatorRole ?Role . " + "<" + queryURI + "> core:hasCo-PrincipalInvestigatorRole ?Role . "
+ "?Role core:roleIn ?Grant . " + "?Role core:roleContributesTo ?Grant . "
+ "?Grant core:relatedRole ?RelatedRole . " + "?Grant core:contributingRole ?RelatedRole . "
+ "?RelatedRole core:co-PrincipalInvestigatorRoleOf ?CoPI . " + "?RelatedRole core:co-PrincipalInvestigatorRoleOf ?CoPI . "
@ -178,9 +178,9 @@ public class CoPIGrantCountQueryRunner implements QueryRunner<CollaborationData>
+ "<" + queryURI + "> core:hasPrincipalInvestigatorRole ?Role . " + "<" + queryURI + "> core:hasPrincipalInvestigatorRole ?Role . "
+ "?Role core:roleIn ?Grant . " + "?Role core:roleContributesTo ?Grant . "
+ "?Grant core:relatedRole ?RelatedRole . " + "?Grant core:contributingRole ?RelatedRole . "
+ "?RelatedRole core:principalInvestigatorRoleOf ?CoPI . " + "?RelatedRole core:principalInvestigatorRoleOf ?CoPI . "
@ -199,9 +199,9 @@ public class CoPIGrantCountQueryRunner implements QueryRunner<CollaborationData>
+ "<" + queryURI + "> core:hasPrincipalInvestigatorRole ?Role . " + "<" + queryURI + "> core:hasPrincipalInvestigatorRole ?Role . "
+ "?Role core:roleIn ?Grant . " + "?Role core:roleContributesTo ?Grant . "
+ "?Grant core:relatedRole ?RelatedRole . " + "?Grant core:contributingRole ?RelatedRole . "
+ "?RelatedRole core:investigatorRoleOf ?CoPI . " + "?RelatedRole core:investigatorRoleOf ?CoPI . "
@ -220,9 +220,9 @@ public class CoPIGrantCountQueryRunner implements QueryRunner<CollaborationData>
+ "<" + queryURI + "> core:hasPrincipalInvestigatorRole ?Role . " + "<" + queryURI + "> core:hasPrincipalInvestigatorRole ?Role . "
+ "?Role core:roleIn ?Grant . " + "?Role core:roleContributesTo ?Grant . "
+ "?Grant core:relatedRole ?RelatedRole . " + "?Grant core:contributingRole ?RelatedRole . "
+ "?RelatedRole core:co-PrincipalInvestigatorRoleOf ?CoPI . " + "?RelatedRole core:co-PrincipalInvestigatorRoleOf ?CoPI . "
@ -241,9 +241,9 @@ public class CoPIGrantCountQueryRunner implements QueryRunner<CollaborationData>
+ "<" + queryURI + "> core:hasInvestigatorRole ?Role . " + "<" + queryURI + "> core:hasInvestigatorRole ?Role . "
+ "?Role core:roleIn ?Grant . " + "?Role core:roleContributesTo ?Grant . "
+ "?Grant core:relatedRole ?RelatedRole . " + "?Grant core:contributingRole ?RelatedRole . "
+ "?RelatedRole core:investigatorRoleOf ?CoPI . " + "?RelatedRole core:investigatorRoleOf ?CoPI . "
@ -262,9 +262,9 @@ public class CoPIGrantCountQueryRunner implements QueryRunner<CollaborationData>
+ "<" + queryURI + "> core:hasInvestigatorRole ?Role . " + "<" + queryURI + "> core:hasInvestigatorRole ?Role . "
+ "?Role core:roleIn ?Grant . " + "?Role core:roleContributesTo ?Grant . "
+ "?Grant core:relatedRole ?RelatedRole . " + "?Grant core:contributingRole ?RelatedRole . "
+ "?RelatedRole core:co-PrincipalInvestigatorRoleOf ?CoPI . " + "?RelatedRole core:co-PrincipalInvestigatorRoleOf ?CoPI . "
@ -283,9 +283,9 @@ public class CoPIGrantCountQueryRunner implements QueryRunner<CollaborationData>
+ "<" + queryURI + "> core:hasInvestigatorRole ?Role . " + "<" + queryURI + "> core:hasInvestigatorRole ?Role . "
+ "?Role core:roleIn ?Grant . " + "?Role core:roleContributesTo ?Grant . "
+ "?Grant core:relatedRole ?RelatedRole . " + "?Grant core:contributingRole ?RelatedRole . "
+ "?RelatedRole core:principalInvestigatorRoleOf ?CoPI . " + "?RelatedRole core:principalInvestigatorRoleOf ?CoPI . "

View file

@ -568,10 +568,12 @@ public class MapOfScienceVisualizationRequestHandler implements
DecimalFormat percentageActivityFormat = new DecimalFormat("#.#"); DecimalFormat percentageActivityFormat = new DecimalFormat("#.#");
if (stats.noJournalCount > 0) {
csvFileContent.append(StringEscapeUtils.escapeCsv("No Publication Venue Given")); csvFileContent.append(StringEscapeUtils.escapeCsv("No Publication Venue Given"));
csvFileContent.append(", "); csvFileContent.append(", ");
csvFileContent.append(percentageActivityFormat.format(stats.noJournalCount)); csvFileContent.append(percentageActivityFormat.format(stats.noJournalCount));
csvFileContent.append("\n"); csvFileContent.append("\n");
}
if (result != null) { if (result != null) {

View file

@ -60,7 +60,7 @@ public class OrganizationToGrantsForSubOrganizationsModelConstructor implements
+ " ?subOrganization core:organizationForPosition ?Position . " + " ?subOrganization core:organizationForPosition ?Position . "
+ " ?Position core:positionForPerson ?Person . " + " ?Position core:positionForPerson ?Person . "
+ " ?Person core:" + roleTypeProperty + " ?Role . " + " ?Person core:" + roleTypeProperty + " ?Role . "
+ " ?Role core:roleIn ?Grant . " + " ?Role core:roleContributesTo ?Grant . "
+ " ?Grant rdfs:label ?grantLabel . " + " ?Grant rdfs:label ?grantLabel . "
+ " " + " "
+ " LET(?now := afn:now()) " + " LET(?now := afn:now()) "
@ -81,7 +81,7 @@ public class OrganizationToGrantsForSubOrganizationsModelConstructor implements
+ " ?subOrganization core:organizationForPosition ?Position . " + " ?subOrganization core:organizationForPosition ?Position . "
+ " ?Position core:positionForPerson ?Person . " + " ?Position core:positionForPerson ?Person . "
+ " ?Person core:" + roleTypeProperty + " ?Role . " + " ?Person core:" + roleTypeProperty + " ?Role . "
+ " ?Role core:roleIn ?Grant . " + " ?Role core:roleContributesTo ?Grant . "
+ " " + " "
+ " ?Grant core:dateTimeInterval ?dateTimeIntervalValueForGrant . " + " ?Grant core:dateTimeInterval ?dateTimeIntervalValueForGrant . "
// + " OPTIONAL { " // + " OPTIONAL { "
@ -110,7 +110,7 @@ public class OrganizationToGrantsForSubOrganizationsModelConstructor implements
+ " ?subOrganization core:organizationForPosition ?Position . " + " ?subOrganization core:organizationForPosition ?Position . "
+ " ?Position core:positionForPerson ?Person . " + " ?Position core:positionForPerson ?Person . "
+ " ?Person core:" + roleTypeProperty + " ?Role . " + " ?Person core:" + roleTypeProperty + " ?Role . "
+ " ?Role core:roleIn ?Grant . " + " ?Role core:roleContributesTo ?Grant . "
+ " " + " "
+ " ?Role core:dateTimeInterval ?dateTimeIntervalValue . " + " ?Role core:dateTimeInterval ?dateTimeIntervalValue . "
// + " OPTIONAL { " // + " OPTIONAL { "

View file

@ -52,7 +52,7 @@ private Set<String> constructPersonGrantsQueryTemplate(String constructProperty,
+ " } " + " } "
+ " WHERE { " + " WHERE { "
+ " ?person core:" + roleTypeProperty + " ?Role . " + " ?person core:" + roleTypeProperty + " ?Role . "
+ " ?Role core:roleIn ?Grant . " + " ?Role core:roleContributesTo ?Grant . "
+ " ?Grant rdfs:label ?grantLabel . " + " ?Grant rdfs:label ?grantLabel . "
+ " " + " "
+ " LET(?now := afn:now()) " + " LET(?now := afn:now()) "
@ -67,7 +67,7 @@ private Set<String> constructPersonGrantsQueryTemplate(String constructProperty,
+ " } " + " } "
+ " WHERE { " + " WHERE { "
+ " ?person core:" + roleTypeProperty + " ?Role . " + " ?person core:" + roleTypeProperty + " ?Role . "
+ " ?Role core:roleIn ?Grant . " + " ?Role core:roleContributesTo ?Grant . "
+ " " + " "
+ " ?Grant core:dateTimeInterval ?dateTimeIntervalValueForGrant . " + " ?Grant core:dateTimeInterval ?dateTimeIntervalValueForGrant . "
// + " OPTIONAL { " // + " OPTIONAL { "
@ -90,7 +90,7 @@ private Set<String> constructPersonGrantsQueryTemplate(String constructProperty,
+ " } " + " } "
+ " WHERE { " + " WHERE { "
+ " ?person core:" + roleTypeProperty + " ?Role . " + " ?person core:" + roleTypeProperty + " ?Role . "
+ " ?Role core:roleIn ?Grant . " + " ?Role core:roleContributesTo ?Grant . "
+ " " + " "
+ " ?Role core:dateTimeInterval ?dateTimeIntervalValue . " + " ?Role core:dateTimeInterval ?dateTimeIntervalValue . "
// + " OPTIONAL { " // + " OPTIONAL { "

View file

@ -55,7 +55,7 @@ private Set<String> constructPersonGrantsQueryTemplate(String constructProperty,
+ " } " + " } "
+ " WHERE { " + " WHERE { "
+ " <" + personURI + "> core:" + roleTypeProperty + " ?Role . " + " <" + personURI + "> core:" + roleTypeProperty + " ?Role . "
+ " ?Role core:roleIn ?Grant . " + " ?Role core:roleContributesTo ?Grant . "
+ " ?Grant rdfs:label ?grantLabel . " + " ?Grant rdfs:label ?grantLabel . "
+ " " + " "
+ " LET(?now := afn:now()) " + " LET(?now := afn:now()) "
@ -70,7 +70,7 @@ private Set<String> constructPersonGrantsQueryTemplate(String constructProperty,
+ " } " + " } "
+ " WHERE { " + " WHERE { "
+ " <" + personURI + "> core:" + roleTypeProperty + " ?Role . " + " <" + personURI + "> core:" + roleTypeProperty + " ?Role . "
+ " ?Role core:roleIn ?Grant . " + " ?Role core:roleContributesTo ?Grant . "
+ " " + " "
+ " ?Grant core:dateTimeInterval ?dateTimeIntervalValueForGrant . " + " ?Grant core:dateTimeInterval ?dateTimeIntervalValueForGrant . "
// + " OPTIONAL { " // + " OPTIONAL { "
@ -93,7 +93,7 @@ private Set<String> constructPersonGrantsQueryTemplate(String constructProperty,
+ " } " + " } "
+ " WHERE { " + " WHERE { "
+ " <" + personURI + "> core:" + roleTypeProperty + " ?Role . " + " <" + personURI + "> core:" + roleTypeProperty + " ?Role . "
+ " ?Role core:roleIn ?Grant . " + " ?Role core:roleContributesTo ?Grant . "
+ " " + " "
+ " ?Role core:dateTimeInterval ?dateTimeIntervalValue . " + " ?Role core:dateTimeInterval ?dateTimeIntervalValue . "
// + " OPTIONAL { " // + " OPTIONAL { "