Updates to default list view: remove moniker, and handle label vs. local name from sparql query rather than a data postprocessor
This commit is contained in:
parent
87dc7698e1
commit
0f3491f42d
4 changed files with 9 additions and 17 deletions
|
@ -89,8 +89,8 @@ public class DataPropertyTemplateModel extends PropertyTemplateModel {
|
|||
ParamMap params = new ParamMap(
|
||||
"subjectUri", subjectUri,
|
||||
"predicateUri", propertyUri);
|
||||
//Check if special parameters being sent
|
||||
|
||||
//Check if special parameters being sent
|
||||
HashMap<String, String> specialParams = UrlBuilder.getSpecialParams(vitroRequest);
|
||||
if(specialParams.size() > 0) {
|
||||
params.putAll(specialParams);
|
||||
|
|
|
@ -16,7 +16,6 @@ public class DefaultListViewDataPostProcessor extends
|
|||
private static final Log log = LogFactory.getLog(DefaultListViewDataPostProcessor.class);
|
||||
|
||||
private static final String KEY_NAME = "name";
|
||||
// private static final String KEY_MONIKER = "moniker";
|
||||
private static final String KEY_OBJECT = "object";
|
||||
|
||||
public DefaultListViewDataPostProcessor(ObjectPropertyTemplateModel optm, WebappDaoFactory wdf) {
|
||||
|
@ -27,7 +26,6 @@ public class DefaultListViewDataPostProcessor extends
|
|||
/* Apply processing specific to this postprocessor */
|
||||
protected void process(Map<String, String> map) {
|
||||
addName(map, KEY_NAME, KEY_OBJECT);
|
||||
// addMoniker(map, KEY_MONIKER, KEY_OBJECT);
|
||||
}
|
||||
|
||||
}
|
|
@ -12,15 +12,15 @@
|
|||
PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#>
|
||||
|
||||
SELECT <collated> ?subclass </collated>
|
||||
?object ?name ?moniker WHERE {
|
||||
?object ?label ?localName WHERE {
|
||||
|
||||
?subject ?property ?object
|
||||
LET (?localName := afn:localname(?object))
|
||||
<collated> OPTIONAL { ?object a ?subclass }
|
||||
FILTER ( afn:namespace(?subclass) != "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#" )
|
||||
</collated>
|
||||
OPTIONAL { ?object rdfs:label ?name }
|
||||
OPTIONAL { ?object vitro:moniker ?moniker }
|
||||
} ORDER BY <collated> ?subclass </collated> ?name ?object
|
||||
OPTIONAL { ?object rdfs:label ?label }
|
||||
} ORDER BY <collated> ?subclass </collated> ?label ?label ?localName
|
||||
</query-select>
|
||||
|
||||
<query-construct>
|
||||
|
@ -30,8 +30,7 @@
|
|||
CONSTRUCT {
|
||||
?subject ?property ?object .
|
||||
?object a ?subclass .
|
||||
?object rdfs:label ?name .
|
||||
?object vitro:moniker ?moniker
|
||||
?object rdfs:label ?label .
|
||||
} WHERE {
|
||||
{
|
||||
?subject ?property ?object
|
||||
|
@ -42,16 +41,11 @@
|
|||
}
|
||||
UNION {
|
||||
?subject ?property ?object .
|
||||
?object rdfs:label ?name .
|
||||
}
|
||||
UNION {
|
||||
?subject ?property ?object .
|
||||
?object vitro:moniker ?moniker .
|
||||
?object rdfs:label ?label .
|
||||
}
|
||||
|
||||
}
|
||||
</query-construct>
|
||||
|
||||
<postprocessor>edu.cornell.mannlib.vitro.webapp.web.templatemodels.individual.DefaultListViewDataPostProcessor</postprocessor>
|
||||
|
||||
<template>propStatement-default.ftl</template>
|
||||
</list-view-config>
|
||||
|
|
|
@ -6,4 +6,4 @@
|
|||
is also used to generate the property statement during a deletion.
|
||||
-->
|
||||
|
||||
<a href="${profileUrl(statement.object)}">${statement.name!}</a> ${statement.moniker!}
|
||||
<a href="${profileUrl(statement.object)}">${statement.label!statement.localName!}</a>
|
||||
|
|
Loading…
Add table
Reference in a new issue