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

View file

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

View file

@ -16,7 +16,7 @@
<h1 id="noPubsOrGrants-header">${organizationLabel}</h1> <h1 id="noPubsOrGrants-header">${organizationLabel}</h1>
<h3 id="alternative-vis-info">${textForCurrentEntityComparisonType?capitalize} ${i18n().temporal_graph_capitalized} <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> </h3>
<div id="error-body"> <div id="error-body">
<p>${i18n().entity_comp_error_text1} <p>${i18n().entity_comp_error_text1}

View file

@ -5,7 +5,7 @@
<h2>${i18n().visualization_tools}</h2> <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"> <section class="visualizationTools">
<h3>${i18n().why_needed}</h3> <h3>${i18n().why_needed}</h3>
<p>${i18n().vis_tools_note_one}</p> <p>${i18n().vis_tools_note_one}</p>

View file

@ -453,7 +453,7 @@ local:eventWithinConfig a :ObjectPropertyDisplayConfig ;
local:includesEventContext a :ConfigContext ; local:includesEventContext a :ConfigContext ;
:hasConfiguration local:includesEventConfig ; :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> ; :qualifiedByDomain <http://purl.org/NET/c4dm/event.owl#Event> ;
:qualifiedBy <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 ; local:inEventSeriesContext a :ConfigContext ;
:hasConfiguration local:inEventSeriesConfig ; :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> ; :qualifiedByDomain <http://purl.org/NET/c4dm/event.owl#Event> ;
:qualifiedBy <http://purl.org/NET/c4dm/event.owl#EventSeries> . :qualifiedBy <http://purl.org/NET/c4dm/event.owl#EventSeries> .
local:includesEventConfig a :ObjectPropertyDisplayConfig ; local:inEventSeriesConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-default.xml"^^xsd:string ; :listViewConfigFile "listViewConfig-default.xml"^^xsd:string ;
:displayName "in event series" ; :displayName "in event series" ;
vitro:displayRankAnnot 3; vitro:displayRankAnnot 3;
@ -479,3 +479,16 @@ local:includesEventConfig a :ObjectPropertyDisplayConfig ;
vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ; vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ;
:propertyGroup <http://vivoweb.org/ontology#vitroPropertyGroupoverview> . :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 rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n"
+ "PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> \n" + "PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> \n"
+ "PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#> \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" + "SELECT DISTINCT ?subclass ?position (str(?label) as ?name) ?person ?hideThis WHERE { \n"
+ " ?subject core:organizationForPosition ?position . \n" + " ?subject core:relatedBy ?position . \n"
+ " OPTIONAL { ?position core:positionForPerson ?person . " + " ?position a core:Position . \n"
+ " OPTIONAL { ?position core:relates ?person . "
+ " ?person a foaf:Person . \n"
+ " ?person rdfs:label ?label } \n" + " ?person rdfs:label ?label } \n"
+ " OPTIONAL { ?position vitro:mostSpecificType ?subclass . \n" + " OPTIONAL { ?position vitro:mostSpecificType ?subclass } \n"
+ " ?subclass rdfs:subClassOf core:Position } \n"
+ " OPTIONAL { ?position core:hideFromDisplay ?hideThis } \n " + " OPTIONAL { ?position core:hideFromDisplay ?hideThis } \n "
+ "} ORDER BY ?subclass ?name"; + "} ORDER BY ?subclass ?name";

View file

@ -209,25 +209,25 @@ public class PersonHasAwardOrHonorGenerator extends VivoBaseGenerator implements
"?awardReceipt <"+ descriptionPred +"> ?description ."; "?awardReceipt <"+ descriptionPred +"> ?description .";
final static String n3ForExistingOrgNewAwardAssertion = final static String n3ForExistingOrgNewAwardAssertion =
"?award <" + awardConferredByPred +"> ?existingOrg . \n" + "?awardReceipt <" + awardConferredByPred +"> ?existingOrg . \n" +
"?existingOrg <" + awardConferredPred + "> ?award . \n" + "?existingOrg <" + awardConferredPred + "> ?awardReceipt . \n" +
"?award <"+ label + "> ?awardLabel ."; "?award <"+ label + "> ?awardLabel .";
final static String n3ForExistingOrgExistingAwardAssertion = final static String n3ForExistingOrgExistingAwardAssertion =
"?existingAward <" + awardConferredByPred +"> ?existingOrg . \n" + "?awardReceipt <" + awardConferredByPred +"> ?existingOrg . \n" +
"?existingOrg <" + awardConferredPred + "> ?existingAward . "; "?existingOrg <" + awardConferredPred + "> ?awardReceipt . ";
final static String n3ForNewOrgNewAwardAssertion = final static String n3ForNewOrgNewAwardAssertion =
"?newOrg a <" + orgClass + "> . \n" + "?newOrg a <" + orgClass + "> . \n" +
"?award <" + awardConferredByPred +"> ?newOrg . \n" + "?awardReceipt <" + awardConferredByPred +"> ?newOrg . \n" +
"?newOrg <" + awardConferredPred + "> ?award . \n" + "?newOrg <" + awardConferredPred + "> ?awardReceipt . \n" +
"?award <"+ label + "> ?awardLabel . \n" + "?award <"+ label + "> ?awardLabel . \n" +
"?newOrg <"+ label + "> ?orgLabel ."; "?newOrg <"+ label + "> ?orgLabel .";
final static String n3ForNewOrgExistingAwardAssertion = final static String n3ForNewOrgExistingAwardAssertion =
"?newOrg a <" + orgClass + "> . \n" + "?newOrg a <" + orgClass + "> . \n" +
"?existingAward <" + awardConferredByPred +"> ?newOrg . \n" + "?awardReceipt <" + awardConferredByPred +"> ?newOrg . \n" +
"?newOrg <" + awardConferredPred + "> ?existingAward . \n" + "?newOrg <" + awardConferredPred + "> ?awardReceipt . \n" +
"?newOrg <"+ label + "> ?orgLabel ."; "?newOrg <"+ label + "> ?orgLabel .";
final static String n3ForYearAwarded = 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 <http://vivoweb.org/ontology/core#assigns> ?newAwardedDegree . \n" +
"?newOrg a ?orgType . \n" + "?newOrg a ?orgType . \n" +
"?newOrg <"+ label +"> ?orgLabel . \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"+ "?newAwardedDegree <http://vivoweb.org/ontology/core#relates> ?degreeType .\n"+
"?degreeType <http://vivoweb.org/ontology/core#relatedBy> ?newAwardedDegree . \n"+ "?degreeType <http://vivoweb.org/ontology/core#relatedBy> ?newAwardedDegree . \n"+
"?newAwardedDegree a core:AwardedDegree ."; "?newAwardedDegree a core:AwardedDegree .";
@ -254,6 +256,8 @@ public class PersonHasEducationalTraining extends VivoBaseGenerator implements
"?existingOrg <http://vivoweb.org/ontology/core#assigns> ?newAwardedDegree . \n" + "?existingOrg <http://vivoweb.org/ontology/core#assigns> ?newAwardedDegree . \n" +
"?newAwardedDegree <http://vivoweb.org/ontology/core#assignedBy> ?existingOrg . \n" + "?newAwardedDegree <http://vivoweb.org/ontology/core#assignedBy> ?existingOrg . \n" +
"?newAwardedDegree <http://vivoweb.org/ontology/core#relates> ?degreeType .\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"+ "?degreeType <http://vivoweb.org/ontology/core#relatedBy> ?newAwardedDegree . \n"+
"?newAwardedDegree a core:AwardedDegree ."; "?newAwardedDegree a core:AwardedDegree .";

View file

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

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -52,7 +52,8 @@ public class SelectOnModelUtilities {
String whereClause = "" String whereClause = ""
+ " <" + subjectEntityURI + "> rdfs:label ?organizationLabel . " + " <" + 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 rdfs:label ?subOrganizationLabel . "
+ " ?subOrganization rdf:type ?subOrgType . " + " ?subOrganization rdf:type ?subOrgType . "
+ " ?subOrgType rdfs:label ?subOrganizationTypeLabel . "; + " ?subOrgType rdfs:label ?subOrganizationTypeLabel . ";
@ -136,7 +137,8 @@ public class SelectOnModelUtilities {
String whereClause = "" String whereClause = ""
+ " <" + subjectEntityURI + "> rdfs:label ?organizationLabel . " + " <" + 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 . "; + " ?parentOrganization rdfs:label ?parentOrganizationLabel . ";
QueryRunner<ResultSet> parentOrganizationsQuery = QueryRunner<ResultSet> parentOrganizationsQuery =