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

View file

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

View file

@ -15,9 +15,9 @@
<#local linkedIndividual>
<#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>
<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>
</#local>

View file

@ -249,14 +249,14 @@ public class PersonHasAdvisorRelationshipGenerator extends VivoBaseGenerator imp
"?vcardName vcard:familyName ?lastName .";
final static String degreeAssertion =
"?advisingRelationship <http://vivoweb.org/ontology/core#relates> ?degree . \n" +
"?degree <http://vivoweb.org/ontology/core#relatedBy> ?advisingRelationship . ";
"?advisingRelationship <http://vivoweb.org/ontology/core#degreeCandidacy> ?degree . \n" +
" ";
//This is for an existing subject area
//Where we only need the existing subject area label
final static String n3ForExistingSubjAreaAssertion =
"?advisingRelationship <http://vivoweb.org/ontology/core#relates> ?existingSubjArea . \n" +
"?existingSubjArea <http://vivoweb.org/ontology/core#relatedBy> ?advisingRelationship . ";
"?advisingRelationship <http://vivoweb.org/ontology/core#hasSubjectArea> ?existingSubjArea . \n" +
"?existingSubjArea <http://vivoweb.org/ontology/core#subjectAreaOf> ?advisingRelationship";
//For new subject area, we include all new information
//new subject area should always be a new resource
//and the following should only get evaluated
@ -300,15 +300,15 @@ public class PersonHasAdvisorRelationshipGenerator extends VivoBaseGenerator imp
"}";
final static String existingAdvisorRoleQuery =
"SELECT ?advisorRole WHERE { \n" +
"?advisingRelationship <http://vivoweb.org/ontology/core#relates> ?advisorRole . \n" +
"?advisorRole a <" + advisorRoleClass + "> . \n" +
"SELECT ?existingAdvisorRole WHERE { \n" +
"?advisingRelationship <http://vivoweb.org/ontology/core#relates> ?existingAdvisorRole . \n" +
"?existingAdvisorRole a <" + advisorRoleClass + "> . \n" +
"}";
final static String existingAdviseeRoleQuery =
"SELECT ?adviseeRole WHERE { \n" +
" ?advisingRelationship <http://vivoweb.org/ontology/core#relates> ?adviseeRole . \n" +
" ?adviseeRole a <" + adviseeRoleClass + "> . \n" +
"SELECT ?existingAdviseeRole WHERE { \n" +
" ?advisingRelationship <http://vivoweb.org/ontology/core#relates> ?existingAdviseeRole . \n" +
" ?existingAdviseeRole a <" + adviseeRoleClass + "> . \n" +
"}";
final static String adviseeLabelQuery =
@ -321,19 +321,17 @@ public class PersonHasAdvisorRelationshipGenerator extends VivoBaseGenerator imp
final static String subjAreaQuery =
"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 <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 =
"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 <" + label + "> ?existingSubjAreaLabel . \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 =
@ -343,11 +341,10 @@ public class PersonHasAdvisorRelationshipGenerator extends VivoBaseGenerator imp
final static String degreeQuery =
"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" +
"}";
final static String existingStartDateQuery =
"SELECT ?existingDateStart WHERE { \n" +
" ?advisingRelationship <" + advisingRelToInterval + "> ?intervalNode . \n" +