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(
|
ParamMap params = new ParamMap(
|
||||||
"subjectUri", subjectUri,
|
"subjectUri", subjectUri,
|
||||||
"predicateUri", propertyUri);
|
"predicateUri", propertyUri);
|
||||||
//Check if special parameters being sent
|
|
||||||
|
|
||||||
|
//Check if special parameters being sent
|
||||||
HashMap<String, String> specialParams = UrlBuilder.getSpecialParams(vitroRequest);
|
HashMap<String, String> specialParams = UrlBuilder.getSpecialParams(vitroRequest);
|
||||||
if(specialParams.size() > 0) {
|
if(specialParams.size() > 0) {
|
||||||
params.putAll(specialParams);
|
params.putAll(specialParams);
|
||||||
|
|
|
@ -16,7 +16,6 @@ public class DefaultListViewDataPostProcessor extends
|
||||||
private static final Log log = LogFactory.getLog(DefaultListViewDataPostProcessor.class);
|
private static final Log log = LogFactory.getLog(DefaultListViewDataPostProcessor.class);
|
||||||
|
|
||||||
private static final String KEY_NAME = "name";
|
private static final String KEY_NAME = "name";
|
||||||
// private static final String KEY_MONIKER = "moniker";
|
|
||||||
private static final String KEY_OBJECT = "object";
|
private static final String KEY_OBJECT = "object";
|
||||||
|
|
||||||
public DefaultListViewDataPostProcessor(ObjectPropertyTemplateModel optm, WebappDaoFactory wdf) {
|
public DefaultListViewDataPostProcessor(ObjectPropertyTemplateModel optm, WebappDaoFactory wdf) {
|
||||||
|
@ -27,7 +26,6 @@ public class DefaultListViewDataPostProcessor extends
|
||||||
/* Apply processing specific to this postprocessor */
|
/* Apply processing specific to this postprocessor */
|
||||||
protected void process(Map<String, String> map) {
|
protected void process(Map<String, String> map) {
|
||||||
addName(map, KEY_NAME, KEY_OBJECT);
|
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#>
|
PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#>
|
||||||
|
|
||||||
SELECT <collated> ?subclass </collated>
|
SELECT <collated> ?subclass </collated>
|
||||||
?object ?name ?moniker WHERE {
|
?object ?label ?localName WHERE {
|
||||||
|
|
||||||
?subject ?property ?object
|
?subject ?property ?object
|
||||||
|
LET (?localName := afn:localname(?object))
|
||||||
<collated> OPTIONAL { ?object a ?subclass }
|
<collated> OPTIONAL { ?object a ?subclass }
|
||||||
FILTER ( afn:namespace(?subclass) != "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#" )
|
FILTER ( afn:namespace(?subclass) != "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#" )
|
||||||
</collated>
|
</collated>
|
||||||
OPTIONAL { ?object rdfs:label ?name }
|
OPTIONAL { ?object rdfs:label ?label }
|
||||||
OPTIONAL { ?object vitro:moniker ?moniker }
|
} ORDER BY <collated> ?subclass </collated> ?label ?label ?localName
|
||||||
} ORDER BY <collated> ?subclass </collated> ?name ?object
|
|
||||||
</query-select>
|
</query-select>
|
||||||
|
|
||||||
<query-construct>
|
<query-construct>
|
||||||
|
@ -30,8 +30,7 @@
|
||||||
CONSTRUCT {
|
CONSTRUCT {
|
||||||
?subject ?property ?object .
|
?subject ?property ?object .
|
||||||
?object a ?subclass .
|
?object a ?subclass .
|
||||||
?object rdfs:label ?name .
|
?object rdfs:label ?label .
|
||||||
?object vitro:moniker ?moniker
|
|
||||||
} WHERE {
|
} WHERE {
|
||||||
{
|
{
|
||||||
?subject ?property ?object
|
?subject ?property ?object
|
||||||
|
@ -42,16 +41,11 @@
|
||||||
}
|
}
|
||||||
UNION {
|
UNION {
|
||||||
?subject ?property ?object .
|
?subject ?property ?object .
|
||||||
?object rdfs:label ?name .
|
?object rdfs:label ?label .
|
||||||
}
|
}
|
||||||
UNION {
|
|
||||||
?subject ?property ?object .
|
|
||||||
?object vitro:moniker ?moniker .
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</query-construct>
|
</query-construct>
|
||||||
|
|
||||||
<postprocessor>edu.cornell.mannlib.vitro.webapp.web.templatemodels.individual.DefaultListViewDataPostProcessor</postprocessor>
|
|
||||||
|
|
||||||
<template>propStatement-default.ftl</template>
|
<template>propStatement-default.ftl</template>
|
||||||
</list-view-config>
|
</list-view-config>
|
||||||
|
|
|
@ -6,4 +6,4 @@
|
||||||
is also used to generate the property statement during a deletion.
|
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