NIHVIVO-2186 Filter out incomplete object property statements for non-editing users.

This commit is contained in:
ryounes 2011-03-22 18:52:39 +00:00
parent 044964176c
commit b9b6c50e87
5 changed files with 9 additions and 23 deletions

View file

@ -64,24 +64,6 @@ public abstract class BaseObjectPropertyDataPostProcessor implements
}
}
/* This is a temporary measure to handle the fact that the current Individual.getMoniker()
* method returns the individual's VClass if moniker is null. We want to replicate that
* behavior here, but in future the moniker property (along with other Vitro namespace
* properties) will be removed. In addition, this type of logic (display x if it exists, otherwise y)
* will be moved into the display modules (Editing and Display Configuration Improvements).
*/
// rjy7 Now Individual.getMoniker() returns only the moniker, not the VClass, so no reason to call the method
// if the sparql query returns a null moniker.
// protected void addMoniker(Map<String, String> map, String monikerKey, String objectKey) {
// String moniker = map.get(monikerKey);
// if (moniker == null) {
// Individual ind = getIndividual(map.get(objectKey));
// if (ind != null) {
// map.put(monikerKey, ind.getMoniker());
// }
// }
// }
protected Individual getIndividual(String uri) {
return wdf.getIndividualDao().getIndividualByURI(uri);
}

View file

@ -13,12 +13,16 @@
SELECT <collated> ?subclass </collated>
?object ?name ?moniker WHERE {
?subject ?property ?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 }
OPTIONAL { ?object vitro:moniker ?moniker }
<linked-individual-required>
FILTER ( bound(?name) )
</linked-individual-required>
} ORDER BY <collated> ?subclass </collated> ?name ?object
</query-select>

View file

@ -18,6 +18,9 @@
OPTIONAL { ?link vitro:linkAnchor ?anchor }
OPTIONAL { ?link vitro:linkURL ?url }
OPTIONAL { ?link vitro:linkDisplayRank ?rank }
<linked-individual-required>
FILTER ( bound(?anchor) &amp;&amp; bound(?url) )
</linked-individual-required>
} ORDER BY ?rank
</query-select>

View file

@ -11,5 +11,5 @@
<#if statement.url??>
<a href="${statement.url}">${linkText}</a>
<#else>
<a href="${profileUrl(statement.link)}">${linkText}</a> (no url provided for link)
${linkText} (no url provided for link)
</#if>

View file

@ -3,6 +3,3 @@
<#-- FreeMarker test cases -->
<h2>${title}</h2>