NIHVIVO-1341, NIHVIVO-1336 Implement strategies for handling missing linked individual in custom list views.
This commit is contained in:
parent
9b158001da
commit
44c4dc9f5b
4 changed files with 53 additions and 33 deletions
|
@ -11,31 +11,30 @@
|
||||||
sending it to the template
|
sending it to the template
|
||||||
|
|
||||||
Query requirements:
|
Query requirements:
|
||||||
- WHERE clause must contain a statement ?subject ?property ?objectvariable, with the variables
|
- WHERE clause must contain a statement ?subject ?property ?object, with the variables
|
||||||
?subject and ?property named as such. The objectvariable can be given any name, but it must be
|
?subject and ?property named as such. The object can be given any name, but it must be
|
||||||
included in the SELECT terms retrieved by the query. This is the statement that will be edited
|
included in the SELECT terms retrieved by the query. This is the statement that will be edited
|
||||||
from the edit links.
|
from the edit links.
|
||||||
|
- 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 linked individual.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<list-view-config>
|
<list-view-config>
|
||||||
|
<!--
|
||||||
<query>
|
<query>
|
||||||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
||||||
PREFIX core: <http://vivoweb.org/ontology/core#>
|
PREFIX core: <http://vivoweb.org/ontology/core#>
|
||||||
|
|
||||||
SELECT DISTINCT ?edTraining ?org ?orgName ?degreeName ?degreeAbbr ?majorField ?deptOrSchool ?info ?dateTime WHERE {
|
SELECT DISTINCT ?subClass ?authorship ?infoResource ?infoResourceName ?dateTime WHERE {
|
||||||
?subject ?property ?edTraining .
|
?subject ?property ?authorship .
|
||||||
?edTraining core:trainingAtOrganization ?org .
|
?authorship core:linkedInformationResource ?infoResource .
|
||||||
?org rdfs:label ?orgName .
|
?infoResource rdfs:label ?infoResourceName .
|
||||||
OPTIONAL { ?edTraining core:degreeEarned ?degree . }
|
?subClass rdfs:subClassOf core:InformationResource .
|
||||||
OPTIONAL { ?degree rdfs:label ?degreeName . }
|
OPTIONAL { ?infoResource core:hasDateTimeValue ?dateTimeValue .
|
||||||
OPTIONAL { ?degree core:abbreviation ?degreeAbbr . }
|
|
||||||
OPTIONAL { ?edTraining core:majorField ?majorField . }
|
|
||||||
OPTIONAL { ?edTraining core:departmentOrSchool ?deptOrSchool . }
|
|
||||||
OPTIONAL { ?edTraining core:supplementalInformation ?info . }
|
|
||||||
OPTIONAL { ?edTraining core:hasDateTimeValue ?dateTimeValue .
|
|
||||||
?dateTimeValue core:dateTime ?dateTime . }
|
?dateTimeValue core:dateTime ?dateTime . }
|
||||||
} ORDER BY DESC(?dateTime)
|
} ORDER BY ?subClass DESC(?dateTime) ?infoResourceName
|
||||||
</query>
|
</query>
|
||||||
|
-->
|
||||||
<template>propStatement-authorInAuthorship.ftl</template>
|
<template>propStatement-authorInAuthorship.ftl</template>
|
||||||
</list-view-config>
|
</list-view-config>
|
|
@ -11,21 +11,28 @@
|
||||||
sending it to the template
|
sending it to the template
|
||||||
|
|
||||||
Query requirements:
|
Query requirements:
|
||||||
- WHERE clause must contain a statement ?subject ?property ?objectvariable, with the variables
|
- WHERE clause must contain a statement ?subject ?property ?object, with the variables
|
||||||
?subject and ?property named as such. The objectvariable can be given any name, but it must be
|
?subject and ?property named as such. The object can be given any name, but it must be
|
||||||
included in the SELECT terms retrieved by the query. This is the statement that will be edited
|
included in the SELECT terms retrieved by the query. This is the statement that will be edited
|
||||||
from the edit links.
|
from the edit links.
|
||||||
|
- 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 linked individual. An alternative is to use the localName() method provided to the template
|
||||||
|
instead.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<list-view-config>
|
<list-view-config>
|
||||||
<query>
|
<query>
|
||||||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
||||||
PREFIX core: <http://vivoweb.org/ontology/core#>
|
PREFIX core: <http://vivoweb.org/ontology/core#>
|
||||||
|
PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#>
|
||||||
|
|
||||||
SELECT DISTINCT ?edTraining ?org ?orgName ?degreeName ?degreeAbbr ?majorField ?deptOrSchool ?info ?dateTime WHERE {
|
SELECT DISTINCT ?edTraining (afn:localname(?edTraining) AS ?edTrainingName) ?org ?orgName
|
||||||
|
?degreeName ?degreeAbbr ?majorField ?deptOrSchool ?info ?dateTime
|
||||||
|
WHERE {
|
||||||
?subject ?property ?edTraining .
|
?subject ?property ?edTraining .
|
||||||
?edTraining core:trainingAtOrganization ?org .
|
OPTIONAL { ?edTraining core:trainingAtOrganization ?org .
|
||||||
?org rdfs:label ?orgName .
|
?org rdfs:label ?orgName . }
|
||||||
OPTIONAL { ?edTraining core:degreeEarned ?degree . }
|
OPTIONAL { ?edTraining core:degreeEarned ?degree . }
|
||||||
OPTIONAL { ?degree rdfs:label ?degreeName . }
|
OPTIONAL { ?degree rdfs:label ?degreeName . }
|
||||||
OPTIONAL { ?degree core:abbreviation ?degreeAbbr . }
|
OPTIONAL { ?degree core:abbreviation ?degreeAbbr . }
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
|
||||||
|
|
||||||
|
<#-- Custom object property statement view for http://vivoweb.org/ontology/core#educationalTraining -->
|
||||||
|
|
||||||
|
<#import "lib-sequence.ftl" as s>
|
||||||
|
<#import "lib-datetime.ftl" as dt>
|
||||||
|
|
|
@ -11,10 +11,17 @@
|
||||||
</#if>
|
</#if>
|
||||||
</#assign>
|
</#assign>
|
||||||
|
|
||||||
<#assign org><a href="${url(statement.org)}">${statement.orgName}</a></#assign>
|
<#assign linkedIndividual>
|
||||||
|
<#if statement.org??>
|
||||||
|
<a href="${url(statement.org)}">${statement.orgName}</a>
|
||||||
|
<#else>
|
||||||
|
<#-- This shouldn't happen, but we must provide for it -->
|
||||||
|
<a href="${url(statement.edTraining)}">educational training ${statement.edTrainingName}</a>
|
||||||
|
</#if>
|
||||||
|
</#assign>
|
||||||
|
|
||||||
<#if statement.dateTime??>
|
<#if statement.dateTime??>
|
||||||
<#assign dateTime = dt.xsdDateTimeToYear(statement.dateTime)>
|
<#assign dateTime = dt.xsdDateTimeToYear(statement.dateTime)>
|
||||||
</#if>
|
</#if>
|
||||||
|
|
||||||
<@s.join [ degree, org, statement.deptOrSchool!, statement.info!, dateTime! ] />
|
<@s.join [ degree, linkedIndividual, statement.deptOrSchool!, statement.info!, dateTime! ] />
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue