diff --git a/productMods/config/listViewConfig-default.xml b/productMods/config/listViewConfig-default.xml new file mode 100644 index 00000000..053ce02a --- /dev/null +++ b/productMods/config/listViewConfig-default.xml @@ -0,0 +1,92 @@ + + + + + + + + PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#> + PREFIX core: <http://vivoweb.org/ontology/core#> + PREFIX foaf: <http://xmlns.com/foaf/0.1/> + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> + + SELECT ?subclass + ?object + ?label + ?localName + ?type + ?title WHERE { + + ?subject ?property ?object + LET (?localName := afn:localname(?object)) + + OPTIONAL { ?object rdfs:label ?label } + + OPTIONAL { + # Get mostSpecificType only for Persons + ?object a foaf:Person . + ?object vitro:mostSpecificType ?typeUri . + ?typeUri rdfs:label ?type . + } + + OPTIONAL { ?object core:preferredTitle ?title } + + + OPTIONAL { ?object a ?subclass } + FILTER ( afn:namespace(?subclass) != "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#" ) + + + # Order by ?type is important, because if the object has more than one mostSpecificType, + # they all get returned, but postprocessing culls out all but one. Ordering by ?type + # will ensure that at least we'll get the same one every time. + } ORDER BY ?subclass ?label ?localName ?type + + + + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> + + CONSTRUCT { + ?subject ?property ?object . + ?object a ?subclass . + ?object rdfs:label ?label . + } WHERE { + { + ?subject ?property ?object . + } UNION { + ?subject ?property ?object . + ?object a ?subclass . + } UNION { + ?subject ?property ?object . + ?object rdfs:label ?label . + } + } + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> + + CONSTRUCT { + ?subject ?property ?object . + ?object vitro:mostSpecificType ?typeUri . + ?typeUri rdfs:label ?type . + ?object core:preferredTitle ?title . + } WHERE { + { + ?subject ?property ?object . + ?object vitro:mostSpecificType ?typeUri . + ?typeUri rdfs:label ?type . + } UNION { + ?subject ?property ?object . + ?object core:preferredTitle ?title . + } + } + + + + diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-default.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-default.ftl new file mode 100644 index 00000000..e648600d --- /dev/null +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-default.ftl @@ -0,0 +1,19 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> + +<#-- VIVO-specific default object property statement template. + + This template must be self-contained and not rely on other variables set for the individual page, because it + is also used to generate the property statement during a deletion. + --> + +<@showStatement statement /> + +<#macro showStatement statement> + <#-- The query retrieves a type only for Persons. Post-processing will remove all but one. --> + ${statement.label!statement.localName!} ${statement.title!statement.type!} + + + + + +