NIHVIVO-1335, NIHVIVO-1510 Working on authorship list view and collated object properties: some reorganization to handle collated properties, but not displaying as collated yet.

This commit is contained in:
rjy7 2010-12-22 22:17:09 +00:00
parent 5a4d336077
commit a0c88c859c
4 changed files with 35 additions and 13 deletions

View file

@ -18,23 +18,27 @@
- If the linked individual may be missing, the query should select the object's localname using - If the linked individual may be missing, the query should select the object's localname using
the ARQ localname function, so that the template can display the local name in the absence of the ARQ localname function, so that the template can display the local name in the absence of
the linked individual. the linked individual.
- Each assertion or set of optional assertions must reference a different graph variable, so that
we do not impose a requirement about which assertions are in the same graph.
--> -->
<list-view-config> <list-view-config>
<!--
<query> <query>
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt; PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt; PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;
PREFIX afn: &lt;http://jena.hpl.hp.com/ARQ/function#&gt;
SELECT DISTINCT ?subClass ?authorship ?infoResource ?infoResourceName ?dateTime WHERE { SELECT DISTINCT ?subClass ?authorship (afn:localname(?authorship) AS ?authorshipName)
?infoResource ?infoResourceName ?dateTime WHERE {
GRAPH ?g1 { ?subject ?property ?authorship } GRAPH ?g1 { ?subject ?property ?authorship }
GRAPH ?g2 { ?authorship core:linkedInformationResource ?infoResource } GRAPH ?g2 { ?authorship core:linkedInformationResource ?infoResource }
GRAPH ?g3 { ?infoResource rdfs:label ?infoResourceName } GRAPH ?g3 { ?infoResource rdfs:label ?infoResourceName }
GRAPH ?g4 { ?subClass rdfs:subClassOf core:InformationResource } OPTIONAL { GRAPH ?g4 { ?subclass rdfs:subClassOf core:InformationResource }
OPTIONAL { GRAPH ?g5 { ?infoResource core:hasDateTimeValue ?dateTimeValue . GRAPH ?g5 { ?infoResource a ?subclass } }
?dateTimeValue core:dateTime ?dateTime . } } OPTIONAL { GRAPH ?g6 { ?infoResource core:hasDateTimeValue ?dateTimeValue .
?dateTimeValue core:dateTime ?dateTime . } }
} ORDER BY ?subClass DESC(?dateTime) ?infoResourceName } ORDER BY ?subClass DESC(?dateTime) ?infoResourceName
</query> </query>
-->
<template>propStatement-authorInAuthorship.ftl</template> <template>propStatement-authorInAuthorship.ftl</template>
</list-view-config> </list-view-config>

View file

@ -19,6 +19,8 @@
the ARQ localname function, so that the template can display the local name in the absence of the ARQ localname function, so that the template can display the local name in the absence of
the linked individual. An alternative is to use the localName() method provided to the template the linked individual. An alternative is to use the localName() method provided to the template
instead. instead.
- Each assertion or set of optional assertions must reference a different graph variable, so that
we do not impose a requirement about which assertions are in the same graph.
--> -->
<list-view-config> <list-view-config>
@ -30,9 +32,10 @@
SELECT DISTINCT ?edTraining (afn:localname(?edTraining) AS ?edTrainingName) ?org ?orgName SELECT DISTINCT ?edTraining (afn:localname(?edTraining) AS ?edTrainingName) ?org ?orgName
?degreeName ?degreeAbbr ?majorField ?deptOrSchool ?info ?dateTime ?degreeName ?degreeAbbr ?majorField ?deptOrSchool ?info ?dateTime
WHERE { WHERE {
GRAPH ?g1 { ?subject ?property ?edTraining } GRAPH ?g1 { ?subject ?property ?edTraining }
OPTIONAL { GRAPH ?g2 { ?edTraining core:trainingAtOrganization ?org . OPTIONAL { GRAPH ?g2 { ?edTraining core:trainingAtOrganization ?org .
?org rdfs:label ?orgName . } } ?org rdfs:label ?orgName . } }
OPTIONAL { GRAPH ?g3 { ?edTraining core:degreeEarned ?degree } } OPTIONAL { GRAPH ?g3 { ?edTraining core:degreeEarned ?degree } }
OPTIONAL { GRAPH ?g4 { ?degree rdfs:label ?degreeName } } OPTIONAL { GRAPH ?g4 { ?degree rdfs:label ?degreeName } }
OPTIONAL { GRAPH ?g5 { ?degree core:abbreviation ?degreeAbbr } } OPTIONAL { GRAPH ?g5 { ?degree core:abbreviation ?degreeAbbr } }
@ -40,7 +43,8 @@
OPTIONAL { GRAPH ?g7 { ?edTraining core:departmentOrSchool ?deptOrSchool } } OPTIONAL { GRAPH ?g7 { ?edTraining core:departmentOrSchool ?deptOrSchool } }
OPTIONAL { GRAPH ?g8 { ?edTraining core:supplementalInformation ?info } } OPTIONAL { GRAPH ?g8 { ?edTraining core:supplementalInformation ?info } }
OPTIONAL { GRAPH ?g9 { ?edTraining core:hasDateTimeValue ?dateTimeValue . OPTIONAL { GRAPH ?g9 { ?edTraining core:hasDateTimeValue ?dateTimeValue .
?dateTimeValue core:dateTime ?dateTime } } ?dateTimeValue core:dateTime ?dateTime } }
} ORDER BY DESC(?dateTime) } ORDER BY DESC(?dateTime)
</query> </query>

View file

@ -5,3 +5,17 @@
<#import "lib-sequence.ftl" as s> <#import "lib-sequence.ftl" as s>
<#import "lib-datetime.ftl" as dt> <#import "lib-datetime.ftl" as dt>
<#assign linkedIndividual>
<#if statement.infoResource??>
<a href="${url(statement.infoResource)}">${statement.infoResourceName}</a>
<#else>
<#-- This shouldn't happen, but we must provide for it -->
<a href="${url(statement.authorship)}">(no linked publication) ${statement.authorshipName}</a>
</#if>
</#assign>
<#if statement.dateTime??>
<#assign year = dt.xsdDateTimeToYear(statement.dateTime)>
</#if>
<@s.join [ linkedIndividual, year! ] />

View file

@ -16,12 +16,12 @@
<a href="${url(statement.org)}">${statement.orgName}</a> <a href="${url(statement.org)}">${statement.orgName}</a>
<#else> <#else>
<#-- This shouldn't happen, but we must provide for it --> <#-- This shouldn't happen, but we must provide for it -->
<a href="${url(statement.edTraining)}">educational training ${statement.edTrainingName}</a> <a href="${url(statement.edTraining)}">(no linked organization) ${statement.edTrainingName}</a>
</#if> </#if>
</#assign> </#assign>
<#if statement.dateTime??> <#if statement.dateTime??>
<#assign dateTime = dt.xsdDateTimeToYear(statement.dateTime)> <#assign year = dt.xsdDateTimeToYear(statement.dateTime)>
</#if> </#if>
<@s.join [ degree, linkedIndividual, statement.deptOrSchool!, statement.info!, dateTime! ] /> <@s.join [ degree, linkedIndividual, statement.deptOrSchool!, statement.info!, year! ] />