VIVO-285: visualization updates for ISF

This commit is contained in:
tworrall 2013-09-30 09:30:34 -04:00
parent d71c995e0e
commit 83b3f755d5
27 changed files with 2743 additions and 2524 deletions

View file

@ -25,11 +25,14 @@
?dateTimeEnd
WHERE {
?subject ?property ?advisory
?subject ?property ?advisory .
?advisory core:relates ?advisor .
?advisor <http://purl.obolibrary.org/obo/RO_0000053> ?advisorRole .
LET ( ?localName := afn:localname(?advisory) )
OPTIONAL { ?advisory rdfs:label ?advisoryLabel }
OPTIONAL { ?advisory core:relates ?advisee .
?advisee a foaf:Person .
?advisee <http://purl.obolibrary.org/obo/RO_0000053> ?adviseeRole
OPTIONAL { ?advisee rdfs:label ?adviseeLabel }
}
OPTIONAL { ?advisory core:relates ?degree .
@ -74,7 +77,10 @@
?subject ?property ?advisory .
?advisory a core:AdvisingRelationship .
?advisory ?advisoryProperty ?advisoryValue .
?advisory rdfs:label ?advisoryLabel
?advisory rdfs:label ?advisoryLabel .
?advisory core:relates ?advisor .
?advisor <http://purl.obolibrary.org/obo/RO_0000053> ?advisorRole .
?advisorRole a core:AdvisorRole
} WHERE {
{
?subject ?property ?advisory .
@ -88,10 +94,23 @@
?advisory a core:AdvisingRelationship .
?advisory ?advisoryProperty ?advisoryValue .
?advisory rdfs:label ?advisoryLabel
} UNION {
?subject ?property ?advisory .
?advisory a core:AdvisingRelationship .
?advisory ?advisoryProperty ?advisoryValue .
?advisory core:relates ?advisor .
?advisor <http://purl.obolibrary.org/obo/RO_0000053> ?advisorRole .
?advisorRole a core:AdvisorRole
}
}
</query-construct>
OPTIONAL { ?advisory core:relates ?advisee .
?advisee a foaf:Person .
?advisee &lt;http://purl.obolibrary.org/obo/RO_0000053&gt; ?adviseeRole
<query-construct>
PREFIX bibo: &lt;http://purl.org/ontology/bibo/&gt;
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;
@ -104,6 +123,8 @@
?advisory core:relates ?advisee .
?advisee a foaf:Person .
?advisee rdfs:label ?adviseeLabel .
?advisee &lt;http://purl.obolibrary.org/obo/RO_0000053&gt; ?adviseeRole .
?adviseeRole a core:AdviseeRole .
?advisory core:relates ?degree .
?degree a core:AcademicDegree .
?degree rdfs:label ?degreeLabel .
@ -117,11 +138,15 @@
?advisory a core:AdvisingRelationship .
?advisory core:relates ?advisee .
?advisee a foaf:Person .
?advisee &lt;http://purl.obolibrary.org/obo/RO_0000053&gt; ?adviseeRole .
?adviseeRole a core:AdviseeRole
} UNION {
?subject ?property ?advisory .
?advisory a core:AdvisingRelationship .
?advisory core:relates ?advisee .
?advisee a foaf:Person .
?advisee &lt;http://purl.obolibrary.org/obo/RO_0000053&gt; ?adviseeRole .
?adviseeRole a core:AdviseeRole .
?advisee rdfs:label ?adviseeLabel
} UNION {
?subject ?property ?advisory .

View file

@ -3,12 +3,14 @@
<#-- Template for sparkline visualization on individual profile page -->
<#-- Determine whether this person is an author -->
<#assign isAuthor = p.hasStatements(propertyGroups, "${core}authorInAuthorship") />
<#assign isAuthor = p.hasVisualizationStatements(propertyGroups, "${core}relatedBy", "${core}Authorship") />
<#-- Determine whether this person is involved in any grants -->
<#assign isInvestigator = ( p.hasStatements(propertyGroups, "${core}hasInvestigatorRole") ||
p.hasStatements(propertyGroups, "${core}hasPrincipalInvestigatorRole") ||
p.hasStatements(propertyGroups, "${core}hasCo-PrincipalInvestigatorRole") ) >
<#assign obo_RO53 = "http://purl.obolibrary.org/obo/RO_0000053">
<#assign isInvestigator = ( p.hasVisualizationStatements(propertyGroups, "${obo_RO53}", "${core}InvestigatorRole") ||
p.hasVisualizationStatements(propertyGroups, "${obo_RO53}", "${core}PrincipalInvestigatorRole") ||
p.hasVisualizationStatements(propertyGroups, "${obo_RO53}", "${core}CoPrincipalInvestigatorRole") ) >
<#if (isAuthor || isInvestigator)>

View file

@ -16,7 +16,7 @@
<h1 id="noPubsOrGrants-header">${organizationLabel}</h1>
<h3 id="alternative-vis-info">${textForCurrentEntityComparisonType?capitalize} ${i18n().temporal_graph_capitalized}
<span id="noPubsOrGrants-span">|&nbsp;<a href="${temporalGraphURL}" title="${i18n().view}">${i18n().view} ${textForOtherEntityComparisonType} ${i18n().temporal_graph}</a></span>
<span id="noPubsOrGrants-span">|&nbsp;<a href="${temporalGraphURL}" title="${i18n().view}">${i18n().view}&nbsp${textForOtherEntityComparisonType}&nbsp;${i18n().temporal_graph}</a></span>
</h3>
<div id="error-body">
<p>${i18n().entity_comp_error_text1}

View file

@ -5,7 +5,7 @@
<h2>${i18n().visualization_tools}</h2>
<a href="${refreshCacheURL}">${i18n().refresh_cached_vis_model}</a>
<a href="${refreshCacheURL}">${i18n().refresh_cached_vis_models}</a>
<section class="visualizationTools">
<h3>${i18n().why_needed}</h3>
<p>${i18n().vis_tools_note_one}</p>

View file

@ -453,7 +453,7 @@ local:eventWithinConfig a :ObjectPropertyDisplayConfig ;
local:includesEventContext a :ConfigContext ;
:hasConfiguration local:includesEventConfig ;
:configContextFor <http://purl.obolibrary.org/obo/BFO_0000050> ;
:configContextFor <http://purl.obolibrary.org/obo/BFO_0000051> ;
:qualifiedByDomain <http://purl.org/NET/c4dm/event.owl#Event> ;
:qualifiedBy <http://purl.org/NET/c4dm/event.owl#Event> .
@ -467,11 +467,11 @@ local:includesEventConfig a :ObjectPropertyDisplayConfig ;
local:inEventSeriesContext a :ConfigContext ;
:hasConfiguration local:inEventSeriesConfig ;
:configContextFor <http://purl.obolibrary.org/obo/BFO_0000051> ;
:configContextFor <http://purl.obolibrary.org/obo/BFO_0000050> ;
:qualifiedByDomain <http://purl.org/NET/c4dm/event.owl#Event> ;
:qualifiedBy <http://purl.org/NET/c4dm/event.owl#EventSeries> .
local:includesEventConfig a :ObjectPropertyDisplayConfig ;
local:inEventSeriesConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-default.xml"^^xsd:string ;
:displayName "in event series" ;
vitro:displayRankAnnot 3;
@ -479,3 +479,16 @@ local:includesEventConfig a :ObjectPropertyDisplayConfig ;
vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ;
:propertyGroup <http://vivoweb.org/ontology#vitroPropertyGroupoverview> .
local:awardAssignedByContext a :ConfigContext ;
:hasConfiguration local:awardAssignedByConfig ;
:configContextFor <http://vivoweb.org/ontology/core#assignedBy> ;
:qualifiedByDomain <http://vivoweb.org/ontology/core#Award> ;
:qualifiedBy <http://vivoweb.org/ontology/core#Award> .
local:awardAssignedByConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-default.xml"^^xsd:string ;
:displayName "award conferred by" ;
vitro:displayRankAnnot 3;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ;
:propertyGroup <http://vivoweb.org/ontology#vitroPropertyGroupoverview> .

View file

@ -65,12 +65,14 @@ public class ManagePeopleForOrganizationController extends FreemarkerHttpServlet
+ "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n"
+ "PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> \n"
+ "PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#> \n"
+ "PREFIX foaf: <http://xmlns.com/foaf/0.1/> \n"
+ "SELECT DISTINCT ?subclass ?position (str(?label) as ?name) ?person ?hideThis WHERE { \n"
+ " ?subject core:organizationForPosition ?position . \n"
+ " OPTIONAL { ?position core:positionForPerson ?person . "
+ " ?subject core:relatedBy ?position . \n"
+ " ?position a core:Position . \n"
+ " OPTIONAL { ?position core:relates ?person . "
+ " ?person a foaf:Person . \n"
+ " ?person rdfs:label ?label } \n"
+ " OPTIONAL { ?position vitro:mostSpecificType ?subclass . \n"
+ " ?subclass rdfs:subClassOf core:Position } \n"
+ " OPTIONAL { ?position vitro:mostSpecificType ?subclass } \n"
+ " OPTIONAL { ?position core:hideFromDisplay ?hideThis } \n "
+ "} ORDER BY ?subclass ?name";

View file

@ -209,25 +209,25 @@ public class PersonHasAwardOrHonorGenerator extends VivoBaseGenerator implements
"?awardReceipt <"+ descriptionPred +"> ?description .";
final static String n3ForExistingOrgNewAwardAssertion =
"?award <" + awardConferredByPred +"> ?existingOrg . \n" +
"?existingOrg <" + awardConferredPred + "> ?award . \n" +
"?awardReceipt <" + awardConferredByPred +"> ?existingOrg . \n" +
"?existingOrg <" + awardConferredPred + "> ?awardReceipt . \n" +
"?award <"+ label + "> ?awardLabel .";
final static String n3ForExistingOrgExistingAwardAssertion =
"?existingAward <" + awardConferredByPred +"> ?existingOrg . \n" +
"?existingOrg <" + awardConferredPred + "> ?existingAward . ";
"?awardReceipt <" + awardConferredByPred +"> ?existingOrg . \n" +
"?existingOrg <" + awardConferredPred + "> ?awardReceipt . ";
final static String n3ForNewOrgNewAwardAssertion =
"?newOrg a <" + orgClass + "> . \n" +
"?award <" + awardConferredByPred +"> ?newOrg . \n" +
"?newOrg <" + awardConferredPred + "> ?award . \n" +
"?awardReceipt <" + awardConferredByPred +"> ?newOrg . \n" +
"?newOrg <" + awardConferredPred + "> ?awardReceipt . \n" +
"?award <"+ label + "> ?awardLabel . \n" +
"?newOrg <"+ label + "> ?orgLabel .";
final static String n3ForNewOrgExistingAwardAssertion =
"?newOrg a <" + orgClass + "> . \n" +
"?existingAward <" + awardConferredByPred +"> ?newOrg . \n" +
"?newOrg <" + awardConferredPred + "> ?existingAward . \n" +
"?awardReceipt <" + awardConferredByPred +"> ?newOrg . \n" +
"?newOrg <" + awardConferredPred + "> ?awardReceipt . \n" +
"?newOrg <"+ label + "> ?orgLabel .";
final static String n3ForYearAwarded =

View file

@ -240,6 +240,8 @@ public class PersonHasEducationalTraining extends VivoBaseGenerator implements
"?newOrg <http://vivoweb.org/ontology/core#assigns> ?newAwardedDegree . \n" +
"?newOrg a ?orgType . \n" +
"?newOrg <"+ label +"> ?orgLabel . \n" +
"?edTraining <http://purl.obolibrary.org/obo/RO_0000057> ?newOrg . \n" +
"?newOrg <http://purl.obolibrary.org/obo/RO_0000056> ?edTraining . \n" +
"?newAwardedDegree <http://vivoweb.org/ontology/core#relates> ?degreeType .\n"+
"?degreeType <http://vivoweb.org/ontology/core#relatedBy> ?newAwardedDegree . \n"+
"?newAwardedDegree a core:AwardedDegree .";
@ -254,6 +256,8 @@ public class PersonHasEducationalTraining extends VivoBaseGenerator implements
"?existingOrg <http://vivoweb.org/ontology/core#assigns> ?newAwardedDegree . \n" +
"?newAwardedDegree <http://vivoweb.org/ontology/core#assignedBy> ?existingOrg . \n" +
"?newAwardedDegree <http://vivoweb.org/ontology/core#relates> ?degreeType .\n"+
"?edTraining <http://purl.obolibrary.org/obo/RO_0000057> ?existingOrg . \n" +
"?existingOrg <http://purl.obolibrary.org/obo/RO_0000056> ?edTraining . \n" +
"?degreeType <http://vivoweb.org/ontology/core#relatedBy> ?newAwardedDegree . \n"+
"?newAwardedDegree a core:AwardedDegree .";

View file

@ -398,11 +398,14 @@ public class CoAuthorshipQueryRunner implements QueryRunner<CollaborationData> {
+ "WHERE { \n"
+ "<" + queryURI + "> rdf:type foaf:Person ;"
+ " rdfs:label ?authorLabel ;"
+ " core:authorInAuthorship ?authorshipNode . \n"
+ " core:relatedBy ?authorshipNode . \n"
+ "?authorshipNode rdf:type core:Authorship ;"
+ " core:linkedInformationResource ?document . \n"
+ "?document core:informationResourceInAuthorship ?coAuthorshipNode . \n"
+ "?coAuthorshipNode core:linkedAuthor ?coAuthorPerson . \n"
+ " core:relates ?document . \n"
+ "?document rdf:type bibo:Document . \n"
+ "?document core:relatedBy ?coAuthorshipNode . \n"
+ "?coAuthorshipNode rdf:type core:Authorship . \n"
+ "?coAuthorshipNode core:relates ?coAuthorPerson . \n"
+ "?coAuthorPerson rdf:type foaf:Person . \n"
+ "?coAuthorPerson rdfs:label ?coAuthorPersonLabel . \n"
+ "OPTIONAL { ?document core:dateTimeValue ?dateTimeValue . \n"
+ " ?dateTimeValue core:dateTime ?publicationDate } .\n"

View file

@ -38,9 +38,9 @@ public class CoPIGrantCountConstructQueryRunner implements ModelConstructor {
.getLog(CoPIGrantCountConstructQueryRunner.class.getName());
private static final String SPARQL_QUERY_COMMON_CONSTRUCT_AND_WHERE_STRING =
"?Role core:roleContributesTo ?Grant . "
// + "?Grant rdfs:label ?GrantLabel . "
+ "?Grant core:contributingRole ?RelatedRole . ";
"?Role core:relatedBy ?Grant . "
+ "?Grant rdf:type core:Grant ."
+ "?Grant core:relates ?RelatedRole . ";
public CoPIGrantCountConstructQueryRunner(String egoURI, Dataset dataset,
Log log) {
@ -59,23 +59,31 @@ public class CoPIGrantCountConstructQueryRunner implements ModelConstructor {
}
private String generateConstructQueryForInvestigatorRoleOfProperty(
String queryURI, String preboundProperty) {
String queryURI, String preboundProperty, String preboundRoleType) {
String sparqlQuery = "CONSTRUCT { " + "<" + queryURI + ">"
+ preboundProperty + " ?Role . "
+ "?Role rdf:type " + preboundRoleType + " . "
+ SPARQL_QUERY_COMMON_CONSTRUCT_AND_WHERE_STRING
+ "?RelatedRole core:investigatorRoleOf ?coInvestigator ."
+ "?RelatedRole rdf:type core:InvestigatorRole ."
+ "?RelatedRole <http://purl.obolibrary.org/obo/RO_0000052> ?coInvestigator ."
+ "?coInvestigator rdf:type foaf:Person ."
+ "?coInvestigator rdfs:label ?coInvestigatorLabel . " + "}"
+ "WHERE { " + "<" + queryURI + ">" + preboundProperty
+ " ?Role . " + SPARQL_QUERY_COMMON_CONSTRUCT_AND_WHERE_STRING
+ "?RelatedRole core:investigatorRoleOf ?coInvestigator ."
+ "?coInvestigator rdfs:label ?coInvestigatorLabel . " + "}";
+ "WHERE { " + "<" + queryURI + ">" + preboundProperty + " ?Role . "
+ "?Role rdf:type " + preboundRoleType + " . "
+ SPARQL_QUERY_COMMON_CONSTRUCT_AND_WHERE_STRING
+ "?RelatedRole rdf:type core:InvestigatorRole ."
+ "?RelatedRole vitro:mostSpecificType ?subclass ."
+ "?RelatedRole <http://purl.obolibrary.org/obo/RO_0000052> ?coInvestigator ."
+ "?coInvestigator rdf:type foaf:Person ."
+ "?coInvestigator rdfs:label ?coInvestigatorLabel . "
+ "FILTER (?subclass != core:PrincipalInvestigatorRole && ?subclass != core:CoPrincipalInvestigatorRole)}";
return sparqlQuery;
}
private String generateConstructQueryForPrincipalInvestigatorRoleOfProperty(
String queryURI, String preboundProperty) {
String queryURI, String preboundProperty, String preboundRoleType) {
String sparqlQuery = "CONSTRUCT { "
+ "<"
@ -83,8 +91,11 @@ public class CoPIGrantCountConstructQueryRunner implements ModelConstructor {
+ ">"
+ preboundProperty
+ " ?Role . "
+ "?Role rdf:type " + preboundRoleType + " . "
+ SPARQL_QUERY_COMMON_CONSTRUCT_AND_WHERE_STRING
+ "?RelatedRole core:principalInvestigatorRoleOf ?coInvestigator ."
+ "?RelatedRole rdf:type core:PrincipalInvestigatorRole ."
+ "?RelatedRole <http://purl.obolibrary.org/obo/RO_0000052> ?coInvestigator ."
+ "?coInvestigator rdf:type foaf:Person ."
+ "?coInvestigator rdfs:label ?coInvestigatorLabel . "
+ "}"
+ "WHERE { "
@ -93,15 +104,18 @@ public class CoPIGrantCountConstructQueryRunner implements ModelConstructor {
+ ">"
+ preboundProperty
+ " ?Role . "
+ "?Role rdf:type " + preboundRoleType + " . "
+ SPARQL_QUERY_COMMON_CONSTRUCT_AND_WHERE_STRING
+ "?RelatedRole core:principalInvestigatorRoleOf ?coInvestigator ."
+ "?RelatedRole rdf:type core:PrincipalInvestigatorRole ."
+ "?RelatedRole <http://purl.obolibrary.org/obo/RO_0000052> ?coInvestigator ."
+ "?coInvestigator rdf:type foaf:Person ."
+ "?coInvestigator rdfs:label ?coInvestigatorLabel . " + "}";
return sparqlQuery;
}
private String generateConstructQueryForCoPrincipalInvestigatorRoleOfProperty(
String queryURI, String preboundProperty) {
String queryURI, String preboundProperty, String preboundRoleType) {
String sparqlQuery = "CONSTRUCT { "
+ "<"
@ -109,8 +123,11 @@ public class CoPIGrantCountConstructQueryRunner implements ModelConstructor {
+ ">"
+ preboundProperty
+ " ?Role . "
+ "?Role rdf:type " + preboundRoleType + " . "
+ SPARQL_QUERY_COMMON_CONSTRUCT_AND_WHERE_STRING
+ "?RelatedRole core:co-PrincipalInvestigatorRoleOf ?coInvestigator ."
+ "?RelatedRole rdf:type core:CoPrincipalInvestigatorRole ."
+ "?RelatedRole <http://purl.obolibrary.org/obo/RO_0000052> ?coInvestigator ."
+ "?coInvestigator rdf:type foaf:Person ."
+ "?coInvestigator rdfs:label ?coInvestigatorLabel . "
+ "}"
+ "WHERE { "
@ -119,18 +136,22 @@ public class CoPIGrantCountConstructQueryRunner implements ModelConstructor {
+ ">"
+ preboundProperty
+ " ?Role . "
+ "?Role rdf:type " + preboundRoleType + " . "
+ SPARQL_QUERY_COMMON_CONSTRUCT_AND_WHERE_STRING
+ "?RelatedRole core:co-PrincipalInvestigatorRoleOf ?coInvestigator ."
+ "?RelatedRole rdf:type core:CoPrincipalInvestigatorRole ."
+ "?RelatedRole <http://purl.obolibrary.org/obo/RO_0000052> ?coInvestigator ."
+ "?coInvestigator rdf:type foaf:Person ."
+ "?coInvestigator rdfs:label ?coInvestigatorLabel . " + "}";
return sparqlQuery;
}
private String generateConstructQueryForDateTimeValueofRole(
String queryURI, String preboundProperty) {
String queryURI, String preboundProperty, String preboundRoleType) {
String sparqlQuery = "CONSTRUCT { " + "<" + queryURI + ">"
+ preboundProperty + " ?Role . "
+ "?Role rdf:type " + preboundRoleType + " . "
+ "?Role core:dateTimeInterval ?dateTimeIntervalValue . "
+ "?dateTimeIntervalValue core:start ?startDate . "
+ "?startDate core:dateTime ?startDateTimeValue . "
@ -139,6 +160,7 @@ public class CoPIGrantCountConstructQueryRunner implements ModelConstructor {
+ "}"
+ "WHERE { " + "{" + "<" + queryURI + ">" + preboundProperty
+ " ?Role . "
+ "?Role rdf:type " + preboundRoleType + " . "
+ "?Role core:dateTimeInterval ?dateTimeIntervalValue . "
+ "?dateTimeIntervalValue core:start ?startDate . "
+ "?startDate core:dateTime ?startDateTimeValue . "
@ -153,14 +175,16 @@ public class CoPIGrantCountConstructQueryRunner implements ModelConstructor {
}
private String generateConstructQueryForDateTimeValueofGrant(
String queryURI, String preboundProperty) {
String queryURI, String preboundProperty, String preboundRoleType) {
String sparqlQuery = "CONSTRUCT { " + "<"
+ queryURI
+ ">"
+ preboundProperty
+ " ?Role . "
+ "?Role core:roleContributesTo ?Grant ."
+ "?Role rdf:type " + preboundRoleType + " . "
+ "?Role core:relatedBy ?Grant ."
+ "?Grant rdf:type core:Grant ."
+ "?Grant core:dateTimeInterval ?dateTimeIntervalValueForGrant . "
+ "?dateTimeIntervalValueForGrant core:start ?startDateForGrant . "
+ "?startDateForGrant core:dateTime ?startDateTimeValueForGrant . "
@ -174,7 +198,9 @@ public class CoPIGrantCountConstructQueryRunner implements ModelConstructor {
+ ">"
+ preboundProperty
+ " ?Role . "
+ "?Role core:roleContributesTo ?Grant ."
+ "?Role rdf:type " + preboundRoleType + " . "
+ "?Role core:relatedBy ?Grant ."
+ "?Grant rdf:type core:Grant ."
+ "?Grant core:dateTimeInterval ?dateTimeIntervalValueForGrant . "
+ "?dateTimeIntervalValueForGrant core:start ?startDateForGrant . "
+ "?startDateForGrant core:dateTime ?startDateTimeValueForGrant . "
@ -268,45 +294,45 @@ public class CoPIGrantCountConstructQueryRunner implements ModelConstructor {
.add(generateConstructQueryForInvestigatorLabel(this.egoURI));
constructQueries
.add(generateConstructQueryForInvestigatorRoleOfProperty(
this.egoURI, "core:hasInvestigatorRole"));
this.egoURI, "<http://purl.obolibrary.org/obo/RO_0000053>", "core:InvestigatorRole"));
constructQueries
.add(generateConstructQueryForCoPrincipalInvestigatorRoleOfProperty(
this.egoURI, "core:hasInvestigatorRole"));
this.egoURI, "<http://purl.obolibrary.org/obo/RO_0000053>", "core:InvestigatorRole"));
constructQueries
.add(generateConstructQueryForPrincipalInvestigatorRoleOfProperty(
this.egoURI, "core:hasInvestigatorRole"));
this.egoURI, "<http://purl.obolibrary.org/obo/RO_0000053>", "core:InvestigatorRole"));
constructQueries.add(generateConstructQueryForDateTimeValueofRole(
this.egoURI, "core:hasInvestigatorRole"));
this.egoURI, "<http://purl.obolibrary.org/obo/RO_0000053>", "core:InvestigatorRole"));
constructQueries.add(generateConstructQueryForDateTimeValueofGrant(
this.egoURI, "core:hasInvestigatorRole"));
this.egoURI, "<http://purl.obolibrary.org/obo/RO_0000053>", "core:InvestigatorRole"));
constructQueries
.add(generateConstructQueryForInvestigatorRoleOfProperty(
this.egoURI, "core:hasPrincipalInvestigatorRole"));
this.egoURI, "<http://purl.obolibrary.org/obo/RO_0000053>", "core:PrincipalInvestigatorRole"));
constructQueries
.add(generateConstructQueryForCoPrincipalInvestigatorRoleOfProperty(
this.egoURI, "core:hasPrincipalInvestigatorRole"));
this.egoURI, "<http://purl.obolibrary.org/obo/RO_0000053>", "core:PrincipalInvestigatorRole"));
constructQueries
.add(generateConstructQueryForPrincipalInvestigatorRoleOfProperty(
this.egoURI, "core:hasPrincipalInvestigatorRole"));
this.egoURI, "<http://purl.obolibrary.org/obo/RO_0000053>", "core:PrincipalInvestigatorRole"));
constructQueries.add(generateConstructQueryForDateTimeValueofRole(
this.egoURI, "core:hasPrincipalInvestigatorRole"));
this.egoURI, "<http://purl.obolibrary.org/obo/RO_0000053>", "core:PrincipalInvestigatorRole"));
constructQueries.add(generateConstructQueryForDateTimeValueofGrant(
this.egoURI, "core:hasPrincipalInvestigatorRole"));
this.egoURI, "<http://purl.obolibrary.org/obo/RO_0000053>", "core:PrincipalInvestigatorRole"));
constructQueries
.add(generateConstructQueryForInvestigatorRoleOfProperty(
this.egoURI, "core:hasCo-PrincipalInvestigatorRole"));
this.egoURI, "<http://purl.obolibrary.org/obo/RO_0000053>", "core:CoPrincipalInvestigatorRole"));
constructQueries
.add(generateConstructQueryForCoPrincipalInvestigatorRoleOfProperty(
this.egoURI, "core:hasCo-PrincipalInvestigatorRole"));
this.egoURI, "<http://purl.obolibrary.org/obo/RO_0000053>", "core:CoPrincipalInvestigatorRole"));
constructQueries
.add(generateConstructQueryForPrincipalInvestigatorRoleOfProperty(
this.egoURI, "core:hasCo-PrincipalInvestigatorRole"));
this.egoURI, "<http://purl.obolibrary.org/obo/RO_0000053>", "core:CoPrincipalInvestigatorRole"));
constructQueries.add(generateConstructQueryForDateTimeValueofRole(
this.egoURI, "core:hasCo-PrincipalInvestigatorRole"));
this.egoURI, "<http://purl.obolibrary.org/obo/RO_0000053>", "core:CoPrincipalInvestigatorRole"));
constructQueries.add(generateConstructQueryForDateTimeValueofGrant(
this.egoURI, "core:hasCo-PrincipalInvestigatorRole"));
this.egoURI, "<http://purl.obolibrary.org/obo/RO_0000053>", "core:CoPrincipalInvestigatorRole"));
}
}

View file

@ -113,13 +113,21 @@ public class CoPIGrantCountQueryRunner implements QueryRunner<CollaborationData>
+ "<" + queryURI + "> rdfs:label ?PILabel . "
+ "{ "
+ "<" + queryURI + "> core:hasCo-PrincipalInvestigatorRole ?Role . "
+ "<" + queryURI + "> <http://purl.obolibrary.org/obo/RO_0000053> ?Role . "
+ "?Role core:roleContributesTo ?Grant . "
+ "?Role rdf:type core:CoPrincipalInvestigatorRole . "
+ "?Grant core:contributingRole ?RelatedRole . "
+ "?Role core:relatedBy ?Grant . "
+ "?RelatedRole core:principalInvestigatorRoleOf ?CoPI . "
+ "?Grant rdf:type core:Grant . "
+ "?Grant core:relates ?RelatedRole . "
+ "?RelatedRole rdf:type core:PrincipalInvestigatorRole . "
+ "?RelatedRole <http://purl.obolibrary.org/obo/RO_0000052> ?CoPI . "
+ "?CoPI rdf:type foaf:Person . "
+ "?CoPI rdfs:label ?CoPILabel . "
@ -133,13 +141,21 @@ public class CoPIGrantCountQueryRunner implements QueryRunner<CollaborationData>
+ "{ "
+ "<" + queryURI + "> core:hasCo-PrincipalInvestigatorRole ?Role . "
+ "<" + queryURI + "> <http://purl.obolibrary.org/obo/RO_0000053> ?Role . "
+ "?Role core:roleContributesTo ?Grant . "
+ "?Role rdf:type core:CoPrincipalInvestigatorRole . "
+ "?Grant core:contributingRole ?RelatedRole . "
+ "?Role core:relatedBy ?Grant . "
+ "?RelatedRole core:investigatorRoleOf ?CoPI . "
+ "?Grant rdf:type core:Grant . "
+ "?Grant core:relates ?RelatedRole . "
+ "?RelatedRole rdf:type core:InvestigatorRole . "
+ "?RelatedRole <http://purl.obolibrary.org/obo/RO_0000052> ?CoPI . "
+ "?CoPI rdf:type foaf:Person . "
+ "?CoPI rdfs:label ?CoPILabel . "
@ -154,13 +170,21 @@ public class CoPIGrantCountQueryRunner implements QueryRunner<CollaborationData>
+ "{ "
+ "<" + queryURI + "> core:hasCo-PrincipalInvestigatorRole ?Role . "
+ "<" + queryURI + "> <http://purl.obolibrary.org/obo/RO_0000053> ?Role . "
+ "?Role core:roleContributesTo ?Grant . "
+ "?Role rdf:type core:CoPrincipalInvestigatorRole . "
+ "?Grant core:contributingRole ?RelatedRole . "
+ "?Role core:relatedBy ?Grant . "
+ "?RelatedRole core:co-PrincipalInvestigatorRoleOf ?CoPI . "
+ "?Grant rdf:type core:Grant . "
+ "?Grant core:relates ?RelatedRole . "
+ "?RelatedRole rdf:type core:CoPrincipalInvestigatorRole . "
+ "?RelatedRole <http://purl.obolibrary.org/obo/RO_0000052> ?CoPI . "
+ "?CoPI rdf:type foaf:Person . "
+ "?CoPI rdfs:label ?CoPILabel . "
@ -176,13 +200,21 @@ public class CoPIGrantCountQueryRunner implements QueryRunner<CollaborationData>
+ "{ "
+ "<" + queryURI + "> core:hasPrincipalInvestigatorRole ?Role . "
+ "<" + queryURI + "> <http://purl.obolibrary.org/obo/RO_0000053> ?Role . "
+ "?Role core:roleContributesTo ?Grant . "
+ "?Role rdf:type core:PrincipalInvestigatorRole . "
+ "?Grant core:contributingRole ?RelatedRole . "
+ "?Role core:relatedBy ?Grant . "
+ "?RelatedRole core:principalInvestigatorRoleOf ?CoPI . "
+ "?Grant rdf:type core:Grant . "
+ "?Grant core:relates ?RelatedRole . "
+ "?RelatedRole rdf:type core:PrincipalInvestigatorRole . "
+ "?RelatedRole <http://purl.obolibrary.org/obo/RO_0000052> ?CoPI . "
+ "?CoPI rdf:type foaf:Person . "
+ "?CoPI rdfs:label ?CoPILabel . "
@ -197,13 +229,21 @@ public class CoPIGrantCountQueryRunner implements QueryRunner<CollaborationData>
+ "{ "
+ "<" + queryURI + "> core:hasPrincipalInvestigatorRole ?Role . "
+ "<" + queryURI + "> <http://purl.obolibrary.org/obo/RO_0000053> ?Role . "
+ "?Role core:roleContributesTo ?Grant . "
+ "?Role rdf:type core:PrincipalInvestigatorRole . "
+ "?Grant core:contributingRole ?RelatedRole . "
+ "?Role core:relatedBy ?Grant . "
+ "?RelatedRole core:investigatorRoleOf ?CoPI . "
+ "?Grant rdf:type core:Grant . "
+ "?Grant core:relates ?RelatedRole . "
+ "?RelatedRole rdf:type core:InvestigatorRole . "
+ "?RelatedRole <http://purl.obolibrary.org/obo/RO_0000052> ?CoPI . "
+ "?CoPI rdf:type foaf:Person . "
+ "?CoPI rdfs:label ?CoPILabel . "
@ -218,13 +258,21 @@ public class CoPIGrantCountQueryRunner implements QueryRunner<CollaborationData>
+ "{ "
+ "<" + queryURI + "> core:hasPrincipalInvestigatorRole ?Role . "
+ "<" + queryURI + "> <http://purl.obolibrary.org/obo/RO_0000053> ?Role . "
+ "?Role core:roleContributesTo ?Grant . "
+ "?Role rdf:type core:PrincipalInvestigatorRole . "
+ "?Grant core:contributingRole ?RelatedRole . "
+ "?Role core:relatedBy ?Grant . "
+ "?RelatedRole core:co-PrincipalInvestigatorRoleOf ?CoPI . "
+ "?Grant rdf:type core:Grant . "
+ "?Grant core:relates ?RelatedRole . "
+ "?RelatedRole rdf:type core:CoPrincipalInvestigatorRole . "
+ "?RelatedRole <http://purl.obolibrary.org/obo/RO_0000052> ?CoPI . "
+ "?CoPI rdf:type foaf:Person . "
+ "?CoPI rdfs:label ?CoPILabel . "
@ -239,13 +287,21 @@ public class CoPIGrantCountQueryRunner implements QueryRunner<CollaborationData>
+ "{ "
+ "<" + queryURI + "> core:hasInvestigatorRole ?Role . "
+ "<" + queryURI + "> <http://purl.obolibrary.org/obo/RO_0000053> ?Role . "
+ "?Role core:roleContributesTo ?Grant . "
+ "?Role rdf:type core:InvestigatorRole . "
+ "?Grant core:contributingRole ?RelatedRole . "
+ "?Role core:relatedBy ?Grant . "
+ "?RelatedRole core:investigatorRoleOf ?CoPI . "
+ "?Grant rdf:type core:Grant . "
+ "?Grant core:relates ?RelatedRole . "
+ "?RelatedRole rdf:type core:InvestigatorRole . "
+ "?RelatedRole <http://purl.obolibrary.org/obo/RO_0000052> ?CoPI . "
+ "?CoPI rdf:type foaf:Person . "
+ "?CoPI rdfs:label ?CoPILabel . "
@ -260,13 +316,21 @@ public class CoPIGrantCountQueryRunner implements QueryRunner<CollaborationData>
+ "{ "
+ "<" + queryURI + "> core:hasInvestigatorRole ?Role . "
+ "<" + queryURI + "> <http://purl.obolibrary.org/obo/RO_0000053> ?Role . "
+ "?Role core:roleContributesTo ?Grant . "
+ "?Role rdf:type core:InvestigatorRole . "
+ "?Grant core:contributingRole ?RelatedRole . "
+ "?Role core:relatedBy ?Grant . "
+ "?RelatedRole core:co-PrincipalInvestigatorRoleOf ?CoPI . "
+ "?Grant rdf:type core:Grant . "
+ "?Grant core:relates ?RelatedRole . "
+ "?RelatedRole rdf:type core:CoPrincipalInvestigatorRole . "
+ "?RelatedRole <http://purl.obolibrary.org/obo/RO_0000052> ?CoPI . "
+ "?CoPI rdf:type foaf:Person . "
+ "?CoPI rdfs:label ?CoPILabel . "
@ -281,13 +345,21 @@ public class CoPIGrantCountQueryRunner implements QueryRunner<CollaborationData>
+ "{ "
+ "<" + queryURI + "> core:hasInvestigatorRole ?Role . "
+ "<" + queryURI + "> <http://purl.obolibrary.org/obo/RO_0000053> ?Role . "
+ "?Role core:roleContributesTo ?Grant . "
+ "?Role rdf:type core:InvestigatorRole . "
+ "?Grant core:contributingRole ?RelatedRole . "
+ "?Role core:relatedBy ?Grant . "
+ "?RelatedRole core:principalInvestigatorRoleOf ?CoPI . "
+ "?Grant rdf:type core:Grant . "
+ "?Grant core:relates ?RelatedRole . "
+ "?RelatedRole rdf:type core:PrincipalInvestigatorRole . "
+ "?RelatedRole <http://purl.obolibrary.org/obo/RO_0000052> ?CoPI . "
+ "?CoPI rdf:type foaf:Person . "
+ "?CoPI rdfs:label ?CoPILabel . "

View file

@ -53,8 +53,9 @@ public class OrganizationAssociatedPeopleModelWithTypesConstructor implements Mo
+ " <" + organizationURI + "> rdf:type foaf:Organization . "
+ " <" + organizationURI + "> rdfs:label ?organizationLabel . "
+ " OPTIONAL { "
+ " <" + organizationURI + "> core:organizationForPosition ?Position . "
+ " ?Position core:positionForPerson ?Person . "
+ " <" + organizationURI + "> core:relatedBy ?Position . "
+ " ?Position rdf:type core:Position . "
+ " ?Position core:relates ?Person . "
+ " ?Person rdfs:label ?personLabel. "
+ " ?Person rdf:type ?personType . "
+ " ?personType rdfs:label ?personTypeLabel . "

View file

@ -50,7 +50,8 @@ public class OrganizationModelWithTypesConstructor implements ModelConstructor {
+ " CONSTRUCT { "
+ " ?organization rdf:type foaf:Organization . "
+ " ?organization rdfs:label ?organizationLabel . "
+ " ?organization core:hasSubOrganization ?subOrganization . "
+ " ?organization <http://purl.obolibrary.org/obo/BFO_0000051> ?subOrganization . "
+ " ?subOrganization rdf:type foaf:Organization . "
+ " ?subOrganization rdfs:label ?subOrganizationLabel . "
+ " ?subOrganization rdf:type ?subOrganizationType . "
+ " ?subOrganizationType rdfs:label ?subOrganizationTypeLabel . "
@ -60,7 +61,8 @@ public class OrganizationModelWithTypesConstructor implements ModelConstructor {
+ " ?organization rdfs:label ?organizationLabel . "
+ " "
+ " OPTIONAL { "
+ " ?organization core:hasSubOrganization ?subOrganization . "
+ " ?organization <http://purl.obolibrary.org/obo/BFO_0000051> ?subOrganization . "
+ " ?subOrganization rdf:type foaf:Organization . "
+ " ?subOrganization rdfs:label ?subOrganizationLabel . "
+ " ?subOrganization rdf:type ?subOrganizationType . "
+ " ?subOrganizationType rdfs:label ?subOrganizationTypeLabel . "

View file

@ -40,7 +40,7 @@ public class OrganizationToGrantsForSubOrganizationsModelConstructor implements
this.dataset = dataset;
}
private Set<String> constructOrganizationGrantsQueryTemplate(String constructProperty, String roleTypeProperty) {
private Set<String> constructOrganizationGrantsQueryTemplate(String constructProperty, String roleType) {
Set<String> differentPerspectiveQueries = new HashSet<String>();
@ -56,11 +56,16 @@ public class OrganizationToGrantsForSubOrganizationsModelConstructor implements
+ " } "
+ " WHERE { "
+ " <" + organizationURI + "> rdfs:label ?organizationLabel . "
+ " <" + organizationURI + "> core:hasSubOrganization* ?subOrganization . "
+ " ?subOrganization core:organizationForPosition ?Position . "
+ " ?Position core:positionForPerson ?Person . "
+ " ?Person core:" + roleTypeProperty + " ?Role . "
+ " ?Role core:roleContributesTo ?Grant . "
+ " <" + organizationURI + "> <http://purl.obolibrary.org/obo/BFO_0000051>* ?subOrganization . "
+ " ?subOrganization rdf:type foaf:Organization . "
+ " ?subOrganization core:relatedBy ?Position . "
+ " ?Position rdf:type core:Position . "
+ " ?Position core:relates ?Person . "
+ " ?Person rdf:type foaf:Person . "
+ " ?Person <http://purl.obolibrary.org/obo/RO_0000053> ?Role . "
+ " ?Role rdf:type core:" + roleType + " . "
+ " ?Role core:relatedBy ?Grant . "
+ " ?Grant rdf:type core:Grant . "
+ " ?Grant rdfs:label ?grantLabel . "
+ " "
+ " LET(?now := afn:now()) "
@ -77,11 +82,16 @@ public class OrganizationToGrantsForSubOrganizationsModelConstructor implements
+ " } "
+ " WHERE { "
+ " <" + organizationURI + "> rdfs:label ?organizationLabel . "
+ " <" + organizationURI + "> core:hasSubOrganization* ?subOrganization . "
+ " ?subOrganization core:organizationForPosition ?Position . "
+ " ?Position core:positionForPerson ?Person . "
+ " ?Person core:" + roleTypeProperty + " ?Role . "
+ " ?Role core:roleContributesTo ?Grant . "
+ " <" + organizationURI + "> <http://purl.obolibrary.org/obo/BFO_0000051>* ?subOrganization . "
+ " ?subOrganization rdf:type foaf:Organization . "
+ " ?subOrganization core:relatedBy ?Position . "
+ " ?Position rdf:type core:Position . "
+ " ?Position core:relates ?Person . "
+ " ?Person rdf:type foaf:Person . "
+ " ?Person <http://purl.obolibrary.org/obo/RO_0000053> ?Role . "
+ " ?Role rdf:type core:" + roleType + " . "
+ " ?Role core:relatedBy ?Grant . "
+ " ?Grant rdf:type core:Grant . "
+ " "
+ " ?Grant core:dateTimeInterval ?dateTimeIntervalValueForGrant . "
// + " OPTIONAL { "
@ -106,11 +116,16 @@ public class OrganizationToGrantsForSubOrganizationsModelConstructor implements
+ " } "
+ " WHERE { "
+ " <" + organizationURI + "> rdfs:label ?organizationLabel . "
+ " <" + organizationURI + "> core:hasSubOrganization* ?subOrganization . "
+ " ?subOrganization core:organizationForPosition ?Position . "
+ " ?Position core:positionForPerson ?Person . "
+ " ?Person core:" + roleTypeProperty + " ?Role . "
+ " ?Role core:roleContributesTo ?Grant . "
+ " <" + organizationURI + "> <http://purl.obolibrary.org/obo/BFO_0000051>* ?subOrganization . "
+ " ?subOrganization rdf:type foaf:Organization . "
+ " ?subOrganization core:relatedBy ?Position . "
+ " ?Position rdf:type core:Position . "
+ " ?Position core:relates ?Person . "
+ " ?Person rdf:type foaf:Person . "
+ " ?Person <http://purl.obolibrary.org/obo/RO_0000053> ?Role . "
+ " ?Role rdf:type core:" + roleType + " . "
+ " ?Role core:relatedBy ?Grant . "
+ " ?Grant rdf:type core:Grant . "
+ " "
+ " ?Role core:dateTimeInterval ?dateTimeIntervalValue . "
// + " OPTIONAL { "
@ -137,9 +152,9 @@ public class OrganizationToGrantsForSubOrganizationsModelConstructor implements
Set<String> differentInvestigatorTypeQueries = new HashSet<String>();
Set<String> investigatorRoleQuery = constructOrganizationGrantsQueryTemplate("hasInvestigatorWithGrant", "hasInvestigatorRole");
Set<String> piRoleQuery = constructOrganizationGrantsQueryTemplate("hasPIWithGrant", "hasPrincipalInvestigatorRole");
Set<String> coPIRoleQuery = constructOrganizationGrantsQueryTemplate("hascoPIWithGrant", "hasCo-PrincipalInvestigatorRole");
Set<String> investigatorRoleQuery = constructOrganizationGrantsQueryTemplate("hasInvestigatorWithGrant", "InvestigatorRole");
Set<String> piRoleQuery = constructOrganizationGrantsQueryTemplate("hasPIWithGrant", "PrincipalInvestigatorRole");
Set<String> coPIRoleQuery = constructOrganizationGrantsQueryTemplate("hascoPIWithGrant", "CoPrincipalInvestigatorRole");
differentInvestigatorTypeQueries.addAll(investigatorRoleQuery);
differentInvestigatorTypeQueries.addAll(piRoleQuery);

View file

@ -53,11 +53,16 @@ public class OrganizationToPublicationsForSubOrganizationsModelConstructor imple
+ " } "
+ " WHERE { "
+ " <" + organizationURI + "> rdfs:label ?organizationLabel . "
+ " <" + organizationURI + "> core:hasSubOrganization* ?subOrganization . "
+ " ?subOrganization core:organizationForPosition ?Position . "
+ " ?Position core:positionForPerson ?Person . "
+ " ?Person core:authorInAuthorship ?Resource . "
+ " ?Resource core:linkedInformationResource ?Document . "
+ " <" + organizationURI + "> <http://purl.obolibrary.org/obo/BFO_0000051>* ?subOrganization . "
+ " ?subOrganization rdf:type foaf:Organization . "
+ " ?subOrganization core:relatedBy ?Position . "
+ " ?Position rdf:type core:Position . "
+ " ?Position core:relates ?Person . "
+ " ?Person rdf:type foaf:Person . "
+ " ?Person core:relatedBy ?Resource . "
+ " ?Resource rdf:type core:Authorship . "
+ " ?Resource core:relates ?Document . "
+ " ?Document rdf:type bibo:Document . "
+ " ?Document rdfs:label ?DocumentLabel . "
+ " "
+ " OPTIONAL { "

View file

@ -37,22 +37,24 @@ public class PeopleToGrantsModelConstructor implements ModelConstructor {
this.dataset = dataset;
}
private Set<String> constructPersonGrantsQueryTemplate(String constructProperty, String roleTypeProperty) {
private Set<String> constructPersonGrantsQueryTemplate(String constructProperty, String roleType) {
Set<String> differentPerspectiveQueries = new HashSet<String>();
String justGrantsQuery = ""
+ " CONSTRUCT { "
+ " ?person vivosocnet:lastCachedAt ?now . "
+ " ?person vivosocnet:" + constructProperty + " ?Grant . "
+ " ?Person vivosocnet:lastCachedAt ?now . "
+ " ?Person vivosocnet:" + constructProperty + " ?Grant . "
+ " "
+ " ?Grant rdf:type core:Grant . "
+ " ?Grant rdfs:label ?grantLabel . "
+ " "
+ " } "
+ " WHERE { "
+ " ?person core:" + roleTypeProperty + " ?Role . "
+ " ?Role core:roleContributesTo ?Grant . "
+ " ?Person <http://purl.obolibrary.org/obo/RO_0000053> ?Role . "
+ " ?Role rdf:type core:" + roleType + " . "
+ " ?Role core:relatedBy ?Grant . "
+ " ?Grant rdf:type core:Grant . "
+ " ?Grant rdfs:label ?grantLabel . "
+ " "
+ " LET(?now := afn:now()) "
@ -60,14 +62,16 @@ private Set<String> constructPersonGrantsQueryTemplate(String constructProperty,
String justDateTimeOnGrantsQuery = ""
+ " CONSTRUCT { "
+ " ?person vivosocnet:lastCachedAt ?now . "
+ " ?Person vivosocnet:lastCachedAt ?now . "
+ " ?Grant vivosocnet:startDateTimeOnGrant ?startDateTimeValueForGrant . "
// + " ?Grant vivosocnet:endDateTimeOnGrant ?endDateTimeValueForGrant . "
+ " "
+ " } "
+ " WHERE { "
+ " ?person core:" + roleTypeProperty + " ?Role . "
+ " ?Role core:roleContributesTo ?Grant . "
+ " ?Person <http://purl.obolibrary.org/obo/RO_0000053> ?Role . "
+ " ?Role rdf:type core:" + roleType + " . "
+ " ?Role core:relatedBy ?Grant . "
+ " ?Grant rdf:type core:Grant . "
+ " "
+ " ?Grant core:dateTimeInterval ?dateTimeIntervalValueForGrant . "
// + " OPTIONAL { "
@ -84,13 +88,15 @@ private Set<String> constructPersonGrantsQueryTemplate(String constructProperty,
String justDateTimeOnRolesQuery = ""
+ " CONSTRUCT { "
+ " ?person vivosocnet:lastCachedAt ?now . "
+ " ?Person vivosocnet:lastCachedAt ?now . "
+ " ?Grant vivosocnet:startDateTimeOnRole ?startDateTimeValue . "
// + " ?Grant vivosocnet:endDateTimeOnRole ?endDateTimeValue . "
+ " } "
+ " WHERE { "
+ " ?person core:" + roleTypeProperty + " ?Role . "
+ " ?Role core:roleContributesTo ?Grant . "
+ " ?Person <http://purl.obolibrary.org/obo/RO_0000053> ?Role . "
+ " ?Role rdf:type core:" + roleType + " . "
+ " ?Role core:relatedBy ?Grant . "
+ " ?Grant rdf:type core:Grant . "
+ " "
+ " ?Role core:dateTimeInterval ?dateTimeIntervalValue . "
// + " OPTIONAL { "
@ -117,9 +123,9 @@ private Set<String> constructPersonGrantsQueryTemplate(String constructProperty,
Set<String> differentInvestigatorTypeQueries = new HashSet<String>();
Set<String> investigatorRoleQuery = constructPersonGrantsQueryTemplate("hasGrantAsAnInvestigator", "hasInvestigatorRole");
Set<String> piRoleQuery = constructPersonGrantsQueryTemplate("hasGrantAsPI", "hasPrincipalInvestigatorRole");
Set<String> coPIRoleQuery = constructPersonGrantsQueryTemplate("hasGrantAsCoPI", "hasCo-PrincipalInvestigatorRole");
Set<String> investigatorRoleQuery = constructPersonGrantsQueryTemplate("hasGrantAsAnInvestigator", "InvestigatorRole");
Set<String> piRoleQuery = constructPersonGrantsQueryTemplate("hasGrantAsPI", "PrincipalInvestigatorRole");
Set<String> coPIRoleQuery = constructPersonGrantsQueryTemplate("hasGrantAsCoPI", "CoPrincipalInvestigatorRole");
differentInvestigatorTypeQueries.addAll(investigatorRoleQuery);
differentInvestigatorTypeQueries.addAll(piRoleQuery);

View file

@ -48,8 +48,11 @@ public class PeopleToPublicationsModelConstructor implements ModelConstructor {
+ " ?journal rdfs:label ?journalLabel . "
+ " } "
+ " WHERE { "
+ " ?person core:authorInAuthorship ?Resource . "
+ " ?Resource core:linkedInformationResource ?Document . "
+ " ?person core:relatedBy ?Resource . "
+ " ?person rdf:type foaf:Person . "
+ " ?Resource rdf:type core:Authorship . "
+ " ?Resource core:relates ?Document . "
+ " ?Document rdf:type bibo:Document . "
+ " ?Document rdfs:label ?DocumentLabel . "
+ " "
+ " OPTIONAL { "

View file

@ -40,7 +40,7 @@ public class PersonToGrantsModelConstructor implements ModelConstructor {
this.dataset = dataset;
}
private Set<String> constructPersonGrantsQueryTemplate(String constructProperty, String roleTypeProperty) {
private Set<String> constructPersonGrantsQueryTemplate(String constructProperty, String roleType) {
Set<String> differentPerspectiveQueries = new HashSet<String>();
@ -54,8 +54,10 @@ private Set<String> constructPersonGrantsQueryTemplate(String constructProperty,
+ " "
+ " } "
+ " WHERE { "
+ " <" + personURI + "> core:" + roleTypeProperty + " ?Role . "
+ " ?Role core:roleContributesTo ?Grant . "
+ " <" + personURI + "> <http://purl.obolibrary.org/obo/RO_0000053> ?Role . "
+ " ?Role rdf:type core:" + roleType + " . "
+ " ?Role core:relatedBy ?Grant . "
+ " ?Grant rdf:type core:Grant . "
+ " ?Grant rdfs:label ?grantLabel . "
+ " "
+ " LET(?now := afn:now()) "
@ -69,8 +71,10 @@ private Set<String> constructPersonGrantsQueryTemplate(String constructProperty,
+ " "
+ " } "
+ " WHERE { "
+ " <" + personURI + "> core:" + roleTypeProperty + " ?Role . "
+ " ?Role core:roleContributesTo ?Grant . "
+ " <" + personURI + "> <http://purl.obolibrary.org/obo/RO_0000053> ?Role . "
+ " ?Role rdf:type core:" + roleType + " . "
+ " ?Role core:relatedBy ?Grant . "
+ " ?Grant rdf:type core:Grant . "
+ " "
+ " ?Grant core:dateTimeInterval ?dateTimeIntervalValueForGrant . "
// + " OPTIONAL { "
@ -92,8 +96,10 @@ private Set<String> constructPersonGrantsQueryTemplate(String constructProperty,
// + " ?Grant vivosocnet:endDateTimeOnRole ?endDateTimeValue . "
+ " } "
+ " WHERE { "
+ " <" + personURI + "> core:" + roleTypeProperty + " ?Role . "
+ " ?Role core:roleContributesTo ?Grant . "
+ " <" + personURI + "> <http://purl.obolibrary.org/obo/RO_0000053> ?Role . "
+ " ?Role rdf:type core:" + roleType + " . "
+ " ?Role core:relatedBy ?Grant . "
+ " ?Grant rdf:type core:Grant . "
+ " "
+ " ?Role core:dateTimeInterval ?dateTimeIntervalValue . "
// + " OPTIONAL { "
@ -120,9 +126,9 @@ private Set<String> constructPersonGrantsQueryTemplate(String constructProperty,
Set<String> differentInvestigatorTypeQueries = new HashSet<String>();
Set<String> investigatorRoleQuery = constructPersonGrantsQueryTemplate("hasGrantAsAnInvestigator", "hasInvestigatorRole");
Set<String> piRoleQuery = constructPersonGrantsQueryTemplate("hasGrantAsPI", "hasPrincipalInvestigatorRole");
Set<String> coPIRoleQuery = constructPersonGrantsQueryTemplate("hasGrantAsCoPI", "hasCo-PrincipalInvestigatorRole");
Set<String> investigatorRoleQuery = constructPersonGrantsQueryTemplate("hasGrantAsAnInvestigator", "InvestigatorRole");
Set<String> piRoleQuery = constructPersonGrantsQueryTemplate("hasGrantAsPI", "PrincipalInvestigatorRole");
Set<String> coPIRoleQuery = constructPersonGrantsQueryTemplate("hasGrantAsCoPI", "CoPrincipalInvestigatorRole");
differentInvestigatorTypeQueries.addAll(investigatorRoleQuery);
differentInvestigatorTypeQueries.addAll(piRoleQuery);

View file

@ -51,8 +51,10 @@ public class PersonToPublicationsModelConstructor implements ModelConstructor {
+ " ?journal rdfs:label ?journalLabel . "
+ " } "
+ " WHERE { "
+ " <" + personURI + "> core:authorInAuthorship ?Resource . "
+ " ?Resource core:linkedInformationResource ?Document . "
+ " <" + personURI + "> core:relatedBy ?Resource . "
+ " ?Resource rdf:type core:Authorship . "
+ " ?Resource core:relates ?Document . "
+ " ?Document rdf:type bibo:Document . "
+ " ?Document rdfs:label ?DocumentLabel . "
+ " "
+ " OPTIONAL { "

View file

@ -50,7 +50,8 @@ public class SubOrganizationWithinModelConstructor implements ModelConstructor {
+ " CONSTRUCT { "
+ " ?organization rdf:type foaf:Organization . "
+ " ?organization rdfs:label ?organizationLabel . "
+ " ?organization core:subOrganizationWithin ?parentOrganization . "
+ " ?organization <http://purl.obolibrary.org/obo/BFO_0000050> ?parentOrganization . "
+ " ?parentOrganization rdf:type foaf:Organization . "
+ " ?parentOrganization rdfs:label ?parentOrganizationLabel . "
+ " } "
+ " WHERE { "
@ -58,7 +59,8 @@ public class SubOrganizationWithinModelConstructor implements ModelConstructor {
+ " ?organization rdfs:label ?organizationLabel . "
+ " "
+ " OPTIONAL { "
+ " ?organization core:subOrganizationWithin ?parentOrganization . "
+ " ?organization <http://purl.obolibrary.org/obo/BFO_0000050> ?parentOrganization . "
+ " ?parentOrganization rdf:type foaf:Organization . "
+ " ?parentOrganization rdfs:label ?parentOrganizationLabel . "
+ " } "
+ " } ";

View file

@ -121,9 +121,10 @@ public class PersonPublicationCountQueryRunner implements QueryRunner<Set<Activi
+ "WHERE { \n"
+ "<" + queryURI + "> rdf:type foaf:Person ;\n"
+ " rdfs:label ?authorLabel \n;"
+ " core:authorInAuthorship ?authorshipNode . \n"
+ " core:relatedBy ?authorshipNode . \n"
+ " ?authorshipNode rdf:type core:Authorship ;"
+ " core:linkedInformationResource ?document . \n"
+ " core:relates ?document . \n"
+ " ?document rdf:type bibo:Document . \n"
+ SPARQL_QUERY_COMMON_WHERE_CLAUSE
+ "}\n";

View file

@ -80,8 +80,10 @@ public class OrganizationUtilityFunctions {
String whereClause = "?organization rdf:type foaf:Organization ;"
+ " rdfs:label ?organizationLabel . \n"
+ "OPTIONAL { ?organization core:hasSubOrganization ?subOrg } . \n"
+ "OPTIONAL { ?organization core:subOrganizationWithin ?parent } . \n"
+ "OPTIONAL { ?organization <http://purl.obolibrary.org/obo/BFO_0000051> ?subOrg . \n"
+ " ?subOrg rdf:type foaf:Organization } . \n"
+ "OPTIONAL { ?organization <http://purl.obolibrary.org/obo/BFO_0000050> ?parent . \n"
+ " ?parent rdf:type foaf:Organization } . \n"
+ "FILTER ( !bound(?parent) ). \n";
String groupOrderClause = "GROUP BY ?organization ?organizationLabel \n"

View file

@ -123,9 +123,10 @@ public class UtilitiesRequestHandler implements VisualizationRequestHandler {
String whereClause =
"<" + individualURI + "> rdf:type foaf:Person ;"
+ " core:authorInAuthorship ?authorshipNode . \n"
+ " core:relatedBy ?authorshipNode . \n"
+ "?authorshipNode rdf:type core:Authorship ;"
+ " core:linkedInformationResource ?document .";
+ " core:relates ?document . \n"
+ "?document rdf:type bibo:Document .";
String groupOrderClause = "GROUP BY ?" + QueryFieldLabels.AUTHOR_URL + " \n";
@ -152,16 +153,22 @@ public class UtilitiesRequestHandler implements VisualizationRequestHandler {
ObjectProperty predicate = ModelUtils.getPropertyForRoleInClass(grantType, vitroRequest.getWebappDaoFactory());
String roleToGrantPredicate = "<" + predicate.getURI() + ">";
String whereClause = "{ <" + individualURI + "> rdf:type foaf:Person ;"
+ " core:hasCo-PrincipalInvestigatorRole ?Role . \n"
+ " <http://purl.obolibrary.org/obo/RO_0000053> ?Role . \n"
+ "?Role rdf:type core:PrincipalInvestigatorRole . \n"
+ "?Role " + roleToGrantPredicate + " ?Grant . }"
+ "UNION \n"
+ "{ <" + individualURI + "> rdf:type foaf:Person ;"
+ " core:hasPrincipalInvestigatorRole ?Role . \n"
+ " <http://purl.obolibrary.org/obo/RO_0000053> ?Role . \n"
+ "?Role rdf:type core:CoPrincipalInvestigatorRole . \n"
+ "?Role " + roleToGrantPredicate + " ?Grant . }"
+ "UNION \n"
+ "{ <" + individualURI + "> rdf:type foaf:Person ;"
+ " core:hasInvestigatorRole ?Role . \n"
+ "?Role " + roleToGrantPredicate + " ?Grant . }";
+ " <http://purl.obolibrary.org/obo/RO_0000053> ?Role . \n"
+ "?Role rdf:type core:InvestigatorRole. \n"
+ "?Role vitro:mostSpecificType ?subclass . \n"
+ "?Role " + roleToGrantPredicate + " ?Grant . \n"
+ "FILTER (?subclass != core:PrincipalInvestigatorRole && "
+ "?subclass != core:CoPrincipalInvestigatorRole)}";
QueryRunner<ResultSet> numberOfGrantsQueryHandler =
new GenericQueryRunner(fieldLabelToOutputFieldLabel,
@ -302,9 +309,11 @@ public class UtilitiesRequestHandler implements VisualizationRequestHandler {
String whereClause = "?organization rdf:type foaf:Organization ;"
+ " rdfs:label ?organizationLabel . \n"
+ "OPTIONAL { ?organization core:hasSubOrganization ?subOrg } . \n"
+ "OPTIONAL { ?organization core:subOrganizationWithin ?parent } . \n"
+ "FILTER ( !bound(?parent) ). \n";
+ "OPTIONAL { ?organization core:http://purl.obolibrary.org/obo/BFO_0000051 ?subOrg . \n"
+ " ?subOrg rdf:type foaf:Organization } . \n"
+ "OPTIONAL { ?organization core:http://purl.obolibrary.org/obo/BFO_0000050 ?parent } . \n"
+ " ?parent rdf:type foaf:Organization } . \n"
+ "FILTER ( !bound(?parent) ). \n";
String groupOrderClause = "GROUP BY ?organization ?organizationLabel \n"
+ "ORDER BY DESC(?numOfChildren)\n"

View file

@ -3,7 +3,9 @@
package edu.cornell.mannlib.vitro.webapp.visualization.visutils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.hp.hpl.jena.iri.IRI;
import com.hp.hpl.jena.iri.IRIFactory;
@ -38,7 +40,7 @@ public class AllPropertiesQueryRunner implements QueryRunner<GenericQueryMap> {
private String filterRule, individualURI;
private Dataset dataset;
private Log log;
private Log log = LogFactory.getLog(AllPropertiesQueryRunner.class.getName());
public AllPropertiesQueryRunner(String individualURI,
String filterRule,
@ -102,6 +104,8 @@ public class AllPropertiesQueryRunner implements QueryRunner<GenericQueryMap> {
+ filterClause
+ "}";
log.debug("sparqlQuery = " + sparqlQuery.toString());
return sparqlQuery;
}

View file

@ -4,6 +4,8 @@ package edu.cornell.mannlib.vitro.webapp.visualization.visutils;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.hp.hpl.jena.query.Dataset;
import com.hp.hpl.jena.query.Query;
@ -33,6 +35,8 @@ public class GenericQueryRunner implements QueryRunner<ResultSet> {
private Map<String, String> fieldLabelToOutputFieldLabel;
private Log log = LogFactory.getLog(GenericQueryRunner.class.getName());
private String groupOrderClause;
private String aggregationRules;
@ -84,6 +88,8 @@ public class GenericQueryRunner implements QueryRunner<ResultSet> {
sparqlQuery.append(this.groupOrderClause);
log.debug("sparqlQuery = " + sparqlQuery.toString());
return sparqlQuery.toString();
}

View file

@ -4,6 +4,9 @@ package edu.cornell.mannlib.vitro.webapp.visualization.visutils;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.hp.hpl.jena.query.Query;
import com.hp.hpl.jena.query.QueryExecution;
import com.hp.hpl.jena.query.QueryExecutionFactory;
@ -32,6 +35,8 @@ public class GenericQueryRunnerOnModel implements QueryRunner<ResultSet> {
private Map<String, String> fieldLabelToOutputFieldLabel;
private Log log = LogFactory.getLog(GenericQueryRunnerOnModel.class.getName());
private String groupOrderClause;
private String aggregationRules;
@ -83,6 +88,7 @@ public class GenericQueryRunnerOnModel implements QueryRunner<ResultSet> {
sparqlQuery.append(this.groupOrderClause);
log.debug("sparqlQuery = " + sparqlQuery.toString());
return sparqlQuery.toString();
}

View file

@ -52,7 +52,8 @@ public class SelectOnModelUtilities {
String whereClause = ""
+ " <" + subjectEntityURI + "> rdfs:label ?organizationLabel . "
+ " <" + subjectEntityURI + "> core:hasSubOrganization ?subOrganization . "
+ " <" + subjectEntityURI + "> <http://purl.obolibrary.org/obo/BFO_0000051> ?subOrganization . "
+ " ?subOrganization rdf:type foaf:Organization . "
+ " ?subOrganization rdfs:label ?subOrganizationLabel . "
+ " ?subOrganization rdf:type ?subOrgType . "
+ " ?subOrgType rdfs:label ?subOrganizationTypeLabel . ";
@ -136,7 +137,8 @@ public class SelectOnModelUtilities {
String whereClause = ""
+ " <" + subjectEntityURI + "> rdfs:label ?organizationLabel . "
+ " <" + subjectEntityURI + "> core:subOrganizationWithin ?parentOrganization . "
+ " <" + subjectEntityURI + "> <http://purl.obolibrary.org/obo/BFO_0000050> ?parentOrganization . "
+ " ?parentOrganization rdf:type foaf:Organization . "
+ " ?parentOrganization rdfs:label ?parentOrganizationLabel . ";
QueryRunner<ResultSet> parentOrganizationsQuery =