[VIVO-1237] Add citation meta tags

This commit is contained in:
Graham Triggs 2016-07-05 17:53:27 +01:00
parent b649eb09f2
commit 19d40bf2a4
6 changed files with 29 additions and 9 deletions

View file

@ -20,12 +20,11 @@
?label
?localName
?type
?objectType
?specificObjectType
?title
WHERE
{
?subject ?property ?object .
?object a ?objectType .
LET (?localName := afn:localname(?object))
OPTIONAL
@ -33,6 +32,11 @@
?object rdfs:label ?label .
}
OPTIONAL
{
?object vitro:mostSpecificType ?specificObjectType .
}
OPTIONAL
{
# Get mostSpecificType only for Persons
@ -72,7 +76,6 @@
CONSTRUCT
{
?subject ?property ?object .
?object a ?objectType .
?object rdfs:label ?label .
?object vitro:mostSpecificType ?subclass .
?subclass rdfs:label ?type .
@ -84,7 +87,6 @@
{
{
?subject ?property ?object .
?object a ?objectType .
}
UNION
{
@ -92,6 +94,11 @@
?object rdfs:label ?label .
}
UNION
{
?subject ?property ?object .
?object vitro:mostSpecificType ?subclass .
}
UNION
{
?subject ?property ?object .
?object vitro:mostSpecificType ?subclass .

View file

@ -6,14 +6,15 @@
is also used to generate the property statement during a deletion.
-->
<#import "lib-datetime.ftl" as dt>
<#import "lib-meta-tags.ftl" as lmt>
<#if property.rangeDatatypeURI?? && property.rangeDatatypeURI?contains("#")>
<#assign datatype = property.rangeDatatypeURI?substring(property.rangeDatatypeURI?last_index_of("#")+1) />
<#else>
<#assign datatype = "none" />
</#if>
<@showStatement statement datatype />
<@showStatement statement property datatype />
<#macro showStatement statement datatype>
<#macro showStatement statement property datatype>
<#assign theValue = statement.value />
<#if theValue?contains("<ul>") >
@ -43,6 +44,7 @@
<#else>
${theValue} <#if !datatype?contains("none")> <@validateFormat theValue datatype/> </#if>
</#if>
<@lmt.addCitationMetaTag uri=(property.uri!) content=(theValue!) />
</#macro>
<#macro validateFormat value datatype >
<#if datatype?? >

View file

@ -7,10 +7,12 @@
-->
<#import "lib-datetime.ftl" as dt>
<#import "lib-meta-tags.ftl" as lmt>
<#-- No core:dateTime data property assigned. Display a link to the core:DateTimeValue object -->
<#if ! statement.dateTime??>
<a href="${profileUrl(statement.uri("dateTimeValue"))}" title="${i18n().incomplete_date_time_value}">${i18n().incomplete_date_time_value}</a>
<#else>
${dt.formatXsdDateTimeLong(statement.dateTime, statement.precision!)}
<@lmt.addCitationMetaTag uri="http://vivoweb.org/ontology/core#dateTimeValue" content=dt.formatXsdDateTimeLong(statement.dateTime, statement.precision!) />
</#if>

View file

@ -6,6 +6,8 @@
is also used to generate the property statement during a deletion.
-->
<#import "lib-meta-tags.ftl" as lmt>
<@showStatement statement />
<#macro showStatement statement>
@ -15,4 +17,5 @@
<#else>
<a href="${profileUrl(statement.uri("object"))}" title="${i18n().name}">${statement.label!statement.localName!}</a>&nbsp; ${statement.title!statement.type!}
</#if>
<@lmt.addCitationMetaTag uri=(statement.specificObjectType) content=(statement.label!) />
</#macro>

View file

@ -5,10 +5,13 @@
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 />
<#import "lib-meta-tags.ftl" as lmt>
<#macro showStatement statement>
<@showStatement statement property />
<#macro showStatement statement property>
<a href="http://dx.doi.org/${statement.value!}" title="${i18n().doi_link}" target="_blank">${statement.value!}</a>
<@lmt.addCitationMetaTag uri=(property.uri!) content=(statement.value!) />
</#macro>

View file

@ -7,6 +7,8 @@
-->
<#import "lib-sequence.ftl" as s>
<#import "lib-meta-tags.ftl" as lmt>
<@showAuthorship statement />
<#-- Use a macro to keep variable assignments local; otherwise the values carry over to the
@ -22,6 +24,7 @@
<#else>
<a href="${profileUrl(statement.uri("author"))}" title="${i18n().author_name}">${statement.authorName}</a>
</#if>
<@lmt.addCitationMetaTag uri="http://vivoweb.org/ontology/core#Authorship" content=statement.authorName />
<#else>
<#-- This shouldn't happen, but we must provide for it -->
<a href="${profileUrl(statement.uri("authorship"))}" title="${i18n().missing_author}">${i18n().missing_author}</a>