VIVO-387: clean up post-migration issues

This commit is contained in:
tworrall 2013-10-21 12:59:24 -04:00
parent 3c62901245
commit cd9120050f
4 changed files with 34 additions and 44 deletions

View file

@ -37,8 +37,7 @@
?adviseeRole a core:AdviseeRole . ?adviseeRole a core:AdviseeRole .
OPTIONAL { ?advisee rdfs:label ?adviseeLabel } OPTIONAL { ?advisee rdfs:label ?adviseeLabel }
} }
OPTIONAL { ?advisingRel core:relates ?degree . OPTIONAL { ?advisingRel core:degreeCandidacy ?degree .
?degree a core:AcademicDegree .
OPTIONAL { ?degree rdfs:label ?degreeLabel } OPTIONAL { ?degree rdfs:label ?degreeLabel }
OPTIONAL { ?degree core:abbreviation ?degreeAbbr } OPTIONAL { ?degree core:abbreviation ?degreeAbbr }
} }
@ -163,24 +162,7 @@
?advisorRole core:relatedBy ?advisingRel . ?advisorRole core:relatedBy ?advisingRel .
?subject core:relatedBy ?advisingRel . ?subject core:relatedBy ?advisingRel .
?advisingRel a core:AdvisingRelationship . ?advisingRel a core:AdvisingRelationship .
?advisingRel core:relates ?degree . ?advisingRel core:degreeCandidacy ?degree .
?degree a core:AcademicDegree .
} UNION {
?subject ?property ?advisorRole .
?advisorRole a core:AdvisorRole .
?advisorRole core:relatedBy ?advisingRel .
?subject core:relatedBy ?advisingRel .
?advisingRel a core:AdvisingRelationship .
?advisingRel core:relates ?degree .
?degree a core:AcademicDegree .
?degree rdfs:label ?degreeLabel
} UNION {
?subject ?property ?advisorRole .
?advisorRole a core:AdvisorRole .
?advisorRole core:relatedBy ?advisingRel .
?subject core:relatedBy ?advisingRel .
?advisingRel a core:AdvisingRelationship .
?advisingRel core:relates ?degree .
?degree a core:AcademicDegree . ?degree a core:AcademicDegree .
?degree rdfs:label ?degreeLabel . ?degree rdfs:label ?degreeLabel .
?degree core:abbreviation ?degreeAbbr ?degree core:abbreviation ?degreeAbbr
@ -196,16 +178,16 @@
?advisorRole core:relatedBy ?advisingRel . ?advisorRole core:relatedBy ?advisingRel .
?subject core:relatedBy ?advisingRel . ?subject core:relatedBy ?advisingRel .
?advisingRel a core:AdvisingRelationship . ?advisingRel a core:AdvisingRelationship .
?award core:dateTimeInterval ?dateTimeInterval . ?advisingRel core:dateTimeInterval ?dateTimeInterval .
?dateTimeInterval core:start ?dateTimeStartValue . ?dateTimeInterval core:start ?dateTimeStartValue .
?dateTimeStartValue core:dateTime ?dateTimeStart ?dateTimeStartValue core:dateTime ?dateTimeStart
} WHERE { } WHERE {
?subject ?property ?advisingRel . ?subject ?property ?advisorRole .
?advisorRole a core:AdvisorRole . ?advisorRole a core:AdvisorRole .
?advisorRole core:relatedBy ?advisingRel . ?advisorRole core:relatedBy ?advisingRel .
?subject core:relatedBy ?advisingRel . ?subject core:relatedBy ?advisingRel .
?advisingRel a core:AdvisingRelationship . ?advisingRel a core:AdvisingRelationship .
?award core:dateTimeInterval ?dateTimeInterval . ?advisingRel core:dateTimeInterval ?dateTimeInterval .
?dateTimeInterval core:start ?dateTimeStartValue . ?dateTimeInterval core:start ?dateTimeStartValue .
?dateTimeStartValue core:dateTime ?dateTimeStart ?dateTimeStartValue core:dateTime ?dateTimeStart
} }
@ -219,7 +201,7 @@
?advisorRole core:relatedBy ?advisingRel . ?advisorRole core:relatedBy ?advisingRel .
?subject core:relatedBy ?advisingRel . ?subject core:relatedBy ?advisingRel .
?advisingRel a core:AdvisingRelationship . ?advisingRel a core:AdvisingRelationship .
?award core:dateTimeInterval ?dateTimeInterval . ?advisingRel core:dateTimeInterval ?dateTimeInterval .
?dateTimeInterval core:end ?dateTimeEndValue . ?dateTimeInterval core:end ?dateTimeEndValue .
?dateTimeEndValue core:dateTime ?dateTimeEnd ?dateTimeEndValue core:dateTime ?dateTimeEnd
} WHERE { } WHERE {
@ -228,7 +210,7 @@
?advisorRole core:relatedBy ?advisingRel . ?advisorRole core:relatedBy ?advisingRel .
?subject core:relatedBy ?advisingRel . ?subject core:relatedBy ?advisingRel .
?advisingRel a core:AdvisingRelationship . ?advisingRel a core:AdvisingRelationship .
?award core:dateTimeInterval ?dateTimeInterval . ?advisingRel core:dateTimeInterval ?dateTimeInterval .
?dateTimeInterval core:end ?dateTimeEndValue . ?dateTimeInterval core:end ?dateTimeEndValue .
?dateTimeEndValue core:dateTime ?dateTimeEnd ?dateTimeEndValue core:dateTime ?dateTimeEnd
} }

View file

@ -14,8 +14,11 @@
PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#>
SELECT DISTINCT ?issuedCredential SELECT DISTINCT ?issuedCredential
?issuedCredentialLocal
?issuedCredentialLabel
?credential ?credential
?credentialLabel ?credentialLabel
?credentialLocal
?dateTimeStart ?dateTimeStart
?dateTimeEnd ?dateTimeEnd
?dateTime ?dateTime
@ -23,8 +26,11 @@
WHERE { WHERE {
?subject ?property ?issuedCredential . ?subject ?property ?issuedCredential .
?issuedCredential a core:IssuedCredential . ?issuedCredential a core:IssuedCredential .
LET (?issuedCredentialLocal := afn:localname(?issuedCredential))
OPTIONAL { ?issuedCredential rdfs:label ?issuedCredentialLabel }
OPTIONAL { ?issuedCredential core:relates ?credential . OPTIONAL { ?issuedCredential core:relates ?credential .
?credential a core:Credential . ?credential a core:Credential .
LET (?credentialLocal := afn:localname(?credential))
?credential core:relatedBy ?issuedCredential ?credential core:relatedBy ?issuedCredential
OPTIONAL { ?credential rdfs:label ?credentialLabel } OPTIONAL { ?credential rdfs:label ?credentialLabel }
} }
@ -53,6 +59,7 @@
CONSTRUCT { CONSTRUCT {
?subject ?property ?issuedCredential . ?subject ?property ?issuedCredential .
?issuedCredential a core:IssuedCredential . ?issuedCredential a core:IssuedCredential .
?issuedCredential rdfs:label ?issuedCredentialLabel .
?issuedCredential core:relates ?credential . ?issuedCredential core:relates ?credential .
?credential a core:Credential . ?credential a core:Credential .
?credential core:relatedBy ?issuedCredential . ?credential core:relatedBy ?issuedCredential .
@ -61,6 +68,10 @@
{ {
?subject ?property ?issuedCredential . ?subject ?property ?issuedCredential .
?issuedCredential a core:IssuedCredential . ?issuedCredential a core:IssuedCredential .
} UNION {
?subject ?property ?issuedCredential .
?issuedCredential a core:IssuedCredential .
?issuedCredential rdfs:label ?issuedCredentialLabel .
} UNION { } UNION {
?subject ?property ?issuedCredential . ?subject ?property ?issuedCredential .
?issuedCredential a core:IssuedCredential . ?issuedCredential a core:IssuedCredential .

View file

@ -15,9 +15,9 @@
<#local linkedIndividual> <#local linkedIndividual>
<#if statement.credential??> <#if statement.credential??>
<a href="${profileUrl(statement.uri("credential"))}" title="${i18n().credential_name}">${statement.credentialLabel!statement.localName!}</a> <a href="${profileUrl(statement.uri("credential"))}" title="${i18n().credential_name}">${statement.credentialLabel!statement.issuedCredentialLabel!statement.credentialLocal!}</a>
<#else> <#else>
<a href="${profileUrl(statement.uri("issuedCredential"))}" title="${i18n().credential_name}">${statement.issuedCredential!}</a> <a href="${profileUrl(statement.uri("issuedCredential"))}" title="${i18n().credential_name}">${statement.issuedCredentialLabel!"missing credential"}</a>
</#if> </#if>
</#local> </#local>

View file

@ -249,14 +249,14 @@ public class PersonHasAdvisorRelationshipGenerator extends VivoBaseGenerator imp
"?vcardName vcard:familyName ?lastName ."; "?vcardName vcard:familyName ?lastName .";
final static String degreeAssertion = final static String degreeAssertion =
"?advisingRelationship <http://vivoweb.org/ontology/core#relates> ?degree . \n" + "?advisingRelationship <http://vivoweb.org/ontology/core#degreeCandidacy> ?degree . \n" +
"?degree <http://vivoweb.org/ontology/core#relatedBy> ?advisingRelationship . "; " ";
//This is for an existing subject area //This is for an existing subject area
//Where we only need the existing subject area label //Where we only need the existing subject area label
final static String n3ForExistingSubjAreaAssertion = final static String n3ForExistingSubjAreaAssertion =
"?advisingRelationship <http://vivoweb.org/ontology/core#relates> ?existingSubjArea . \n" + "?advisingRelationship <http://vivoweb.org/ontology/core#hasSubjectArea> ?existingSubjArea . \n" +
"?existingSubjArea <http://vivoweb.org/ontology/core#relatedBy> ?advisingRelationship . "; "?existingSubjArea <http://vivoweb.org/ontology/core#subjectAreaOf> ?advisingRelationship";
//For new subject area, we include all new information //For new subject area, we include all new information
//new subject area should always be a new resource //new subject area should always be a new resource
//and the following should only get evaluated //and the following should only get evaluated
@ -300,15 +300,15 @@ public class PersonHasAdvisorRelationshipGenerator extends VivoBaseGenerator imp
"}"; "}";
final static String existingAdvisorRoleQuery = final static String existingAdvisorRoleQuery =
"SELECT ?advisorRole WHERE { \n" + "SELECT ?existingAdvisorRole WHERE { \n" +
"?advisingRelationship <http://vivoweb.org/ontology/core#relates> ?advisorRole . \n" + "?advisingRelationship <http://vivoweb.org/ontology/core#relates> ?existingAdvisorRole . \n" +
"?advisorRole a <" + advisorRoleClass + "> . \n" + "?existingAdvisorRole a <" + advisorRoleClass + "> . \n" +
"}"; "}";
final static String existingAdviseeRoleQuery = final static String existingAdviseeRoleQuery =
"SELECT ?adviseeRole WHERE { \n" + "SELECT ?existingAdviseeRole WHERE { \n" +
" ?advisingRelationship <http://vivoweb.org/ontology/core#relates> ?adviseeRole . \n" + " ?advisingRelationship <http://vivoweb.org/ontology/core#relates> ?existingAdviseeRole . \n" +
" ?adviseeRole a <" + adviseeRoleClass + "> . \n" + " ?existingAdviseeRole a <" + adviseeRoleClass + "> . \n" +
"}"; "}";
final static String adviseeLabelQuery = final static String adviseeLabelQuery =
@ -321,19 +321,17 @@ public class PersonHasAdvisorRelationshipGenerator extends VivoBaseGenerator imp
final static String subjAreaQuery = final static String subjAreaQuery =
"SELECT ?existingSubjArea WHERE { \n" + "SELECT ?existingSubjArea WHERE { \n" +
" ?advisingRelationship <http://vivoweb.org/ontology/core#relates> ?existingSubjArea . \n" + " ?advisingRelationship <http://vivoweb.org/ontology/core#hasSubjectArea> ?existingSubjArea . \n" +
" ?existingSubjArea a <http://www.w3.org/2004/02/skos/core#Concept> . \n" + " ?existingSubjArea a <http://www.w3.org/2004/02/skos/core#Concept> . \n" +
" ?existingSubjArea <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#mostSpecificType> ?type \n" + " ?existingSubjArea <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#mostSpecificType> ?type \n" +
" FILTER (?type != <http://vivoweb.org/ontology/core#AcademicDegree>) . \n" +
"}"; "}";
final static String subjAreaLabelQuery = final static String subjAreaLabelQuery =
"SELECT ?existingSubjAreaLabel WHERE { \n" + "SELECT ?existingSubjAreaLabel WHERE { \n" +
" ?advisingRelationship <http://vivoweb.org/ontology/core#relates> ?existingSubjArea . \n" + " ?advisingRelationship <http://vivoweb.org/ontology/core#hasSubjectArea> ?existingSubjArea . \n" +
" ?existingSubjArea a <http://www.w3.org/2004/02/skos/core#Concept> . \n" + " ?existingSubjArea a <http://www.w3.org/2004/02/skos/core#Concept> . \n" +
" ?existingSubjArea <" + label + "> ?existingSubjAreaLabel . \n" + " ?existingSubjArea <" + label + "> ?existingSubjAreaLabel . \n" +
" ?existingSubjArea <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#mostSpecificType> ?type \n" + " ?existingSubjArea <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#mostSpecificType> ?type \n" +
" FILTER (?type != <http://vivoweb.org/ontology/core#AcademicDegree>) . \n" +
"}"; "}";
final static String advisingRelLabelQuery = final static String advisingRelLabelQuery =
@ -343,11 +341,10 @@ public class PersonHasAdvisorRelationshipGenerator extends VivoBaseGenerator imp
final static String degreeQuery = final static String degreeQuery =
"SELECT ?existingDegree WHERE {\n"+ "SELECT ?existingDegree WHERE {\n"+
" ?advisingRelationship <http://vivoweb.org/ontology/core#relates> ?existingDegree . \n" + " ?advisingRelationship <http://vivoweb.org/ontology/core#degreeCandidacy> ?existingDegree . \n" +
" ?existingDegree a <" + degreeClass + "> . \n" + " ?existingDegree a <" + degreeClass + "> . \n" +
"}"; "}";
final static String existingStartDateQuery = final static String existingStartDateQuery =
"SELECT ?existingDateStart WHERE { \n" + "SELECT ?existingDateStart WHERE { \n" +
" ?advisingRelationship <" + advisingRelToInterval + "> ?intervalNode . \n" + " ?advisingRelationship <" + advisingRelToInterval + "> ?intervalNode . \n" +