[VIVO-1237] Add citation meta tags
This commit is contained in:
parent
b649eb09f2
commit
19d40bf2a4
6 changed files with 29 additions and 9 deletions
|
@ -20,12 +20,11 @@
|
||||||
?label
|
?label
|
||||||
?localName
|
?localName
|
||||||
?type
|
?type
|
||||||
?objectType
|
?specificObjectType
|
||||||
?title
|
?title
|
||||||
WHERE
|
WHERE
|
||||||
{
|
{
|
||||||
?subject ?property ?object .
|
?subject ?property ?object .
|
||||||
?object a ?objectType .
|
|
||||||
LET (?localName := afn:localname(?object))
|
LET (?localName := afn:localname(?object))
|
||||||
|
|
||||||
OPTIONAL
|
OPTIONAL
|
||||||
|
@ -33,6 +32,11 @@
|
||||||
?object rdfs:label ?label .
|
?object rdfs:label ?label .
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OPTIONAL
|
||||||
|
{
|
||||||
|
?object vitro:mostSpecificType ?specificObjectType .
|
||||||
|
}
|
||||||
|
|
||||||
OPTIONAL
|
OPTIONAL
|
||||||
{
|
{
|
||||||
# Get mostSpecificType only for Persons
|
# Get mostSpecificType only for Persons
|
||||||
|
@ -72,7 +76,6 @@
|
||||||
CONSTRUCT
|
CONSTRUCT
|
||||||
{
|
{
|
||||||
?subject ?property ?object .
|
?subject ?property ?object .
|
||||||
?object a ?objectType .
|
|
||||||
?object rdfs:label ?label .
|
?object rdfs:label ?label .
|
||||||
?object vitro:mostSpecificType ?subclass .
|
?object vitro:mostSpecificType ?subclass .
|
||||||
?subclass rdfs:label ?type .
|
?subclass rdfs:label ?type .
|
||||||
|
@ -84,7 +87,6 @@
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
?subject ?property ?object .
|
?subject ?property ?object .
|
||||||
?object a ?objectType .
|
|
||||||
}
|
}
|
||||||
UNION
|
UNION
|
||||||
{
|
{
|
||||||
|
@ -92,6 +94,11 @@
|
||||||
?object rdfs:label ?label .
|
?object rdfs:label ?label .
|
||||||
}
|
}
|
||||||
UNION
|
UNION
|
||||||
|
{
|
||||||
|
?subject ?property ?object .
|
||||||
|
?object vitro:mostSpecificType ?subclass .
|
||||||
|
}
|
||||||
|
UNION
|
||||||
{
|
{
|
||||||
?subject ?property ?object .
|
?subject ?property ?object .
|
||||||
?object vitro:mostSpecificType ?subclass .
|
?object vitro:mostSpecificType ?subclass .
|
||||||
|
|
|
@ -6,14 +6,15 @@
|
||||||
is also used to generate the property statement during a deletion.
|
is also used to generate the property statement during a deletion.
|
||||||
-->
|
-->
|
||||||
<#import "lib-datetime.ftl" as dt>
|
<#import "lib-datetime.ftl" as dt>
|
||||||
|
<#import "lib-meta-tags.ftl" as lmt>
|
||||||
<#if property.rangeDatatypeURI?? && property.rangeDatatypeURI?contains("#")>
|
<#if property.rangeDatatypeURI?? && property.rangeDatatypeURI?contains("#")>
|
||||||
<#assign datatype = property.rangeDatatypeURI?substring(property.rangeDatatypeURI?last_index_of("#")+1) />
|
<#assign datatype = property.rangeDatatypeURI?substring(property.rangeDatatypeURI?last_index_of("#")+1) />
|
||||||
<#else>
|
<#else>
|
||||||
<#assign datatype = "none" />
|
<#assign datatype = "none" />
|
||||||
</#if>
|
</#if>
|
||||||
<@showStatement statement datatype />
|
<@showStatement statement property datatype />
|
||||||
|
|
||||||
<#macro showStatement statement datatype>
|
<#macro showStatement statement property datatype>
|
||||||
<#assign theValue = statement.value />
|
<#assign theValue = statement.value />
|
||||||
|
|
||||||
<#if theValue?contains("<ul>") >
|
<#if theValue?contains("<ul>") >
|
||||||
|
@ -43,6 +44,7 @@
|
||||||
<#else>
|
<#else>
|
||||||
${theValue} <#if !datatype?contains("none")> <@validateFormat theValue datatype/> </#if>
|
${theValue} <#if !datatype?contains("none")> <@validateFormat theValue datatype/> </#if>
|
||||||
</#if>
|
</#if>
|
||||||
|
<@lmt.addCitationMetaTag uri=(property.uri!) content=(theValue!) />
|
||||||
</#macro>
|
</#macro>
|
||||||
<#macro validateFormat value datatype >
|
<#macro validateFormat value datatype >
|
||||||
<#if datatype?? >
|
<#if datatype?? >
|
||||||
|
|
|
@ -7,10 +7,12 @@
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<#import "lib-datetime.ftl" as dt>
|
<#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 -->
|
<#-- No core:dateTime data property assigned. Display a link to the core:DateTimeValue object -->
|
||||||
<#if ! statement.dateTime??>
|
<#if ! statement.dateTime??>
|
||||||
<a href="${profileUrl(statement.uri("dateTimeValue"))}" title="${i18n().incomplete_date_time_value}">${i18n().incomplete_date_time_value}</a>
|
<a href="${profileUrl(statement.uri("dateTimeValue"))}" title="${i18n().incomplete_date_time_value}">${i18n().incomplete_date_time_value}</a>
|
||||||
<#else>
|
<#else>
|
||||||
${dt.formatXsdDateTimeLong(statement.dateTime, statement.precision!)}
|
${dt.formatXsdDateTimeLong(statement.dateTime, statement.precision!)}
|
||||||
|
<@lmt.addCitationMetaTag uri="http://vivoweb.org/ontology/core#dateTimeValue" content=dt.formatXsdDateTimeLong(statement.dateTime, statement.precision!) />
|
||||||
</#if>
|
</#if>
|
|
@ -6,6 +6,8 @@
|
||||||
is also used to generate the property statement during a deletion.
|
is also used to generate the property statement during a deletion.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
<#import "lib-meta-tags.ftl" as lmt>
|
||||||
|
|
||||||
<@showStatement statement />
|
<@showStatement statement />
|
||||||
|
|
||||||
<#macro showStatement statement>
|
<#macro showStatement statement>
|
||||||
|
@ -15,4 +17,5 @@
|
||||||
<#else>
|
<#else>
|
||||||
<a href="${profileUrl(statement.uri("object"))}" title="${i18n().name}">${statement.label!statement.localName!}</a> ${statement.title!statement.type!}
|
<a href="${profileUrl(statement.uri("object"))}" title="${i18n().name}">${statement.label!statement.localName!}</a> ${statement.title!statement.type!}
|
||||||
</#if>
|
</#if>
|
||||||
|
<@lmt.addCitationMetaTag uri=(statement.specificObjectType) content=(statement.label!) />
|
||||||
</#macro>
|
</#macro>
|
|
@ -5,10 +5,13 @@
|
||||||
This template must be self-contained and not rely on other variables set for the individual page, because it
|
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.
|
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>
|
<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>
|
</#macro>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<#import "lib-sequence.ftl" as s>
|
<#import "lib-sequence.ftl" as s>
|
||||||
|
<#import "lib-meta-tags.ftl" as lmt>
|
||||||
|
|
||||||
<@showAuthorship statement />
|
<@showAuthorship statement />
|
||||||
|
|
||||||
<#-- Use a macro to keep variable assignments local; otherwise the values carry over to the
|
<#-- Use a macro to keep variable assignments local; otherwise the values carry over to the
|
||||||
|
@ -22,6 +24,7 @@
|
||||||
<#else>
|
<#else>
|
||||||
<a href="${profileUrl(statement.uri("author"))}" title="${i18n().author_name}">${statement.authorName}</a>
|
<a href="${profileUrl(statement.uri("author"))}" title="${i18n().author_name}">${statement.authorName}</a>
|
||||||
</#if>
|
</#if>
|
||||||
|
<@lmt.addCitationMetaTag uri="http://vivoweb.org/ontology/core#Authorship" content=statement.authorName />
|
||||||
<#else>
|
<#else>
|
||||||
<#-- This shouldn't happen, but we must provide for it -->
|
<#-- This shouldn't happen, but we must provide for it -->
|
||||||
<a href="${profileUrl(statement.uri("authorship"))}" title="${i18n().missing_author}">${i18n().missing_author}</a>
|
<a href="${profileUrl(statement.uri("authorship"))}" title="${i18n().missing_author}">${i18n().missing_author}</a>
|
||||||
|
|
Loading…
Add table
Reference in a new issue