NIHVIVO-2186 Modify custom list view queries to filter out statements with no linked individual when user is not editing the page. Involves pruning the grouped property list of properties and groups which are thereby empty.
This commit is contained in:
parent
77a7ce801a
commit
f80de8c1ba
9 changed files with 60 additions and 51 deletions
|
@ -9,28 +9,26 @@
|
|||
PREFIX core: <http://vivoweb.org/ontology/core#>
|
||||
PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#>
|
||||
|
||||
SELECT DISTINCT <collation-fragment> ?subclass </collation-fragment>
|
||||
SELECT DISTINCT <collated> ?subclass </collated>
|
||||
?authorship
|
||||
?infoResource ?infoResourceName
|
||||
?dateTime WHERE {
|
||||
?subject ?property ?authorship .
|
||||
<linked-individual-optional>
|
||||
OPTIONAL {
|
||||
</linked-individual-optional>
|
||||
?authorship core:linkedInformationResource ?infoResource .
|
||||
?subject ?property ?authorship
|
||||
OPTIONAL { ?authorship core:linkedInformationResource ?infoResource .
|
||||
?infoResource rdfs:label ?infoResourceName
|
||||
<collation-fragment>
|
||||
<collated>
|
||||
OPTIONAL { ?subclass rdfs:subClassOf core:InformationResource .
|
||||
?infoResource a ?subclass
|
||||
}
|
||||
</collation-fragment>
|
||||
</collated>
|
||||
OPTIONAL { ?infoResource core:dateTimeValue ?dateTimeValue .
|
||||
?dateTimeValue core:dateTime ?dateTime
|
||||
}
|
||||
<linked-individual-optional>
|
||||
}
|
||||
</linked-individual-optional>
|
||||
} ORDER BY <collation-fragment> ?subclass </collation-fragment> ?infoResourceName
|
||||
<linked-individual-required>
|
||||
FILTER ( bound(?infoResource) )
|
||||
</linked-individual-required>
|
||||
} ORDER BY <collated> ?subclass </collated> ?infoResourceName
|
||||
</query-select>
|
||||
|
||||
<query-construct>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#>
|
||||
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
|
||||
|
||||
SELECT DISTINCT <collation-fragment> ?subclass </collation-fragment>
|
||||
SELECT DISTINCT <collated> ?subclass </collated>
|
||||
?edTraining
|
||||
?org ?orgName
|
||||
?degreeName ?degreeAbbr
|
||||
|
@ -20,11 +20,11 @@
|
|||
?subject ?property ?edTraining
|
||||
OPTIONAL { ?edTraining core:trainingAtOrganization ?org .
|
||||
?org rdfs:label ?orgName
|
||||
<collation-fragment>
|
||||
<collated>
|
||||
OPTIONAL { ?subclass rdfs:subClassOf foaf:Organization .
|
||||
?org a ?subclass
|
||||
}
|
||||
</collation-fragment>
|
||||
</collated>
|
||||
}
|
||||
OPTIONAL { ?edTraining core:degreeEarned ?degree
|
||||
OPTIONAL { ?degree rdfs:label ?degreeName }
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
PREFIX core: <http://vivoweb.org/ontology/core#>
|
||||
PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#>
|
||||
|
||||
SELECT DISTINCT <collation-fragment>?subclass</collation-fragment>
|
||||
SELECT DISTINCT <collated>?subclass</collated>
|
||||
?role
|
||||
?roleLabel
|
||||
?activity ?activityName
|
||||
|
@ -18,11 +18,11 @@
|
|||
OPTIONAL { ?role core:roleIn ?activity .
|
||||
?activity rdfs:label ?activityName
|
||||
}
|
||||
<collation-fragment>
|
||||
<collated>
|
||||
OPTIONAL { ?role a ?subclass .
|
||||
?subclass rdfs:subClassOf core:Role
|
||||
}
|
||||
</collation-fragment>
|
||||
</collated>
|
||||
OPTIONAL { ?role rdfs:label ?roleLabel }
|
||||
OPTIONAL { ?role core:dateTimeInterval ?dateTimeInterval
|
||||
OPTIONAL { ?dateTimeInterval core:start ?dateTimeStartValue .
|
||||
|
@ -32,7 +32,10 @@
|
|||
?dateTimeEndValue core:dateTime ?dateTimeEnd
|
||||
}
|
||||
}
|
||||
} ORDER BY <collation-fragment>?subclass</collation-fragment> DESC(?dateTimeEnd) DESC(?dateTimeStart) ?activityName
|
||||
<linked-individual-required>
|
||||
FILTER ( bound(?activity) )
|
||||
</linked-individual-required>
|
||||
} ORDER BY <collated>?subclass</collated> DESC(?dateTimeEnd) DESC(?dateTimeStart) ?activityName
|
||||
</query-select>
|
||||
|
||||
<query-construct>
|
||||
|
|
|
@ -10,20 +10,23 @@
|
|||
PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#>
|
||||
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
|
||||
|
||||
SELECT DISTINCT <collation-fragment> ?subclass </collation-fragment>
|
||||
SELECT DISTINCT <collated> ?subclass </collated>
|
||||
?authorship
|
||||
?person ?personName WHERE {
|
||||
?subject ?property ?authorship
|
||||
OPTIONAL { ?authorship core:authorRank ?rank }
|
||||
OPTIONAL { ?authorship core:linkedAuthor ?person .
|
||||
?person rdfs:label ?personName
|
||||
<collation-fragment>
|
||||
<collated>
|
||||
OPTIONAL { ?person a ?subclass .
|
||||
?subclass rdfs:subClassOf foaf:Person
|
||||
}
|
||||
</collation-fragment>
|
||||
</collated>
|
||||
}
|
||||
} ORDER BY <collation-fragment> ?subclass </collation-fragment> ?rank ?personName
|
||||
<linked-individual-required>
|
||||
FILTER ( bound(?person) )
|
||||
</linked-individual-required>
|
||||
} ORDER BY <collated> ?subclass </collated> ?rank ?personName
|
||||
</query-select>
|
||||
|
||||
<query-construct>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
PREFIX core: <http://vivoweb.org/ontology/core#>
|
||||
PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#>
|
||||
|
||||
SELECT DISTINCT <collation-fragment> ?subclass </collation-fragment>
|
||||
SELECT DISTINCT <collated> ?subclass </collated>
|
||||
?position
|
||||
?positionTitle
|
||||
?person ?personName
|
||||
|
@ -18,11 +18,11 @@
|
|||
OPTIONAL { ?position core:positionForPerson ?person .
|
||||
?person rdfs:label ?personName
|
||||
}
|
||||
<collation-fragment>
|
||||
<collated>
|
||||
OPTIONAL { ?position a ?subclass .
|
||||
?subclass rdfs:subClassOf core:Position
|
||||
}
|
||||
</collation-fragment>
|
||||
</collated>
|
||||
OPTIONAL { ?position rdfs:label ?positionTitle }
|
||||
OPTIONAL { ?position core:dateTimeInterval ?dateTimeInterval
|
||||
OPTIONAL { ?dateTimeInterval core:start ?dateTimeStartValue .
|
||||
|
@ -31,10 +31,13 @@
|
|||
OPTIONAL { ?dateTimeInterval core:end ?dateTimeEndValue .
|
||||
?dateTimeEndValue core:dateTime ?dateTimeEnd
|
||||
}
|
||||
# Current positions only: end date is either null or not in the past
|
||||
# Get current positions only: end date is either null or not in the past
|
||||
} FILTER ( !bound(?dateTimeEnd) ||
|
||||
afn:substring(str(?dateTimeEnd), 0, 4) >= afn:substring(str(afn:now()), 0, 4) )
|
||||
} ORDER BY <collation-fragment> ?subclass </collation-fragment> ?personName
|
||||
<linked-individual-required>
|
||||
FILTER ( bound(?person) )
|
||||
</linked-individual-required>
|
||||
} ORDER BY <collated> ?subclass </collated> ?personName
|
||||
</query-select>
|
||||
|
||||
<query-construct>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
PREFIX core: <http://vivoweb.org/ontology/core#>
|
||||
PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#>
|
||||
|
||||
SELECT DISTINCT <collation-fragment>?subclass</collation-fragment>
|
||||
SELECT DISTINCT <collated>?subclass</collated>
|
||||
?position
|
||||
?positionTitle
|
||||
?hrJobTitle
|
||||
|
@ -29,12 +29,15 @@
|
|||
?dateTimeEndValue core:dateTime ?dateTimeEnd
|
||||
}
|
||||
}
|
||||
<collation-fragment>
|
||||
<collated>
|
||||
OPTIONAL { ?position a ?subclass .
|
||||
?subclass rdfs:subClassOf core:Position
|
||||
}
|
||||
</collation-fragment>
|
||||
} ORDER BY <collation-fragment>?subclass</collation-fragment> DESC(?dateTimeEnd) DESC(?dateTimeStart) ?orgName
|
||||
</collated>
|
||||
<linked-individual-required>
|
||||
FILTER ( bound(?org) )
|
||||
</linked-individual-required>
|
||||
} ORDER BY <collated>?subclass</collated> DESC(?dateTimeEnd) DESC(?dateTimeStart) ?orgName
|
||||
</query-select>
|
||||
|
||||
<query-construct>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
PREFIX core: <http://vivoweb.org/ontology/core#>
|
||||
PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#>
|
||||
|
||||
SELECT DISTINCT <collation-fragment>?subclass</collation-fragment>
|
||||
SELECT DISTINCT <collated>?subclass</collated>
|
||||
?role
|
||||
?roleLabel ?roleTypeLabel
|
||||
?indivInRole (afn:localname(?indivInRole) AS ?indivName)
|
||||
|
@ -39,8 +39,10 @@
|
|||
?dateTimeEndValue core:dateTime ?dateTimeEnd
|
||||
}
|
||||
}
|
||||
|
||||
} ORDER BY <collation-fragment>?subclass</collation-fragment>?indivName ?indivLabel ?roleLabel ?roleTypeLabel
|
||||
<linked-individual-required>
|
||||
FILTER ( bound(?indivInRole) )
|
||||
</linked-individual-required>
|
||||
} ORDER BY <collated>?subclass</collated> ?indivLabel ?roleLabel ?roleTypeLabel ?indivName
|
||||
</query-select>
|
||||
|
||||
<query-construct>
|
||||
|
|
|
@ -5,11 +5,11 @@
|
|||
<#import "lib-sequence.ftl" as s>
|
||||
<#import "lib-datetime.ftl" as dt>
|
||||
|
||||
<@showEducationalTraining statement />
|
||||
<@showEducationalTraining statement individual />
|
||||
|
||||
<#-- Use a macro to keep variable assignments local; otherwise the values carry over to the
|
||||
next statement -->
|
||||
<#macro showEducationalTraining statement>
|
||||
<#macro showEducationalTraining statement individual>
|
||||
|
||||
<#local degree>
|
||||
<#if statement.degreeName??>
|
||||
|
@ -25,12 +25,12 @@
|
|||
<#local linkedIndividual>
|
||||
<#if statement.org??>
|
||||
<a href="${profileUrl(statement.org)}">${statement.orgName}</a>
|
||||
<#else>
|
||||
<#-- This shouldn't happen, but we must provide for it -->
|
||||
<#elseif individual.editable>
|
||||
<#-- Show the link to the context node only if the user is editing the page. -->
|
||||
<a href="${profileUrl(statement.edTraining)}">missing organization</a>
|
||||
</#if>
|
||||
</#local>
|
||||
|
||||
<@s.join [ degree, linkedIndividual, statement.deptOrSchool!, statement.info! ] /> <@dt.yearIntervalSpan "${statement.dateTimeStart!}" "${statement.dateTimeEnd!}" false/>
|
||||
<@s.join [ degree, linkedIndividual!, statement.deptOrSchool!, statement.info! ] /> <@dt.yearIntervalSpan "${statement.dateTimeStart!}" "${statement.dateTimeEnd!}" false/>
|
||||
|
||||
</#macro>
|
|
@ -2,9 +2,6 @@
|
|||
|
||||
package edu.cornell.mannlib.vitro.webapp.web.templatemodels.individual;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue