ensure that vcard individuals that are authors do not display as links

This commit is contained in:
Tim Worrall 2014-06-13 12:22:47 -04:00
parent 94f7fea0c2
commit be4fba9b48
2 changed files with 8 additions and 6 deletions

View file

@ -12,7 +12,7 @@
PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#>
PREFIX vcard: <http://www.w3.org/2006/vcard/ns#> PREFIX vcard: <http://www.w3.org/2006/vcard/ns#>
SELECT DISTINCT <collated> ?subclass </collated> SELECT DISTINCT ?subclass
?authorship ?authorship
?author ?authorName ?author ?authorName
WHERE { WHERE {
@ -21,13 +21,12 @@
OPTIONAL { ?authorship core:relates ?author . OPTIONAL { ?authorship core:relates ?author .
?author a foaf:Agent . ?author a foaf:Agent .
?author rdfs:label ?authorName ?author rdfs:label ?authorName
<collated>
OPTIONAL { ?authorship core:relates ?author . OPTIONAL { ?authorship core:relates ?author .
?author a foaf:Agent . ?author a foaf:Agent .
?author vitro:mostSpecificType ?subclass . ?author vitro:mostSpecificType ?subclass .
?subclass rdfs:subClassOf foaf:Agent ?subclass rdfs:subClassOf foaf:Agent
} }
</collated>
} }
OPTIONAL { ?authorship core:relates ?author . OPTIONAL { ?authorship core:relates ?author .
?author a vcard:Kind . ?author a vcard:Kind .
@ -39,13 +38,12 @@
bind ( COALESCE(?middleName, "") As ?middleName1) . bind ( COALESCE(?middleName, "") As ?middleName1) .
bind ( COALESCE(?lastName, "") As ?lastName1) . bind ( COALESCE(?lastName, "") As ?lastName1) .
bind (concat(str(?lastName1 + ", "),str(?middleName1 + " "),str(?firstName1)) as ?authorName) . bind (concat(str(?lastName1 + ", "),str(?middleName1 + " "),str(?firstName1)) as ?authorName) .
<collated>
OPTIONAL { ?authorship core:relates ?author . OPTIONAL { ?authorship core:relates ?author .
?author a vcard:Kind . ?author a vcard:Kind .
?author vitro:mostSpecificType ?subclass . ?author vitro:mostSpecificType ?subclass .
?subclass rdfs:subClassOf vcard:Kind ?subclass rdfs:subClassOf vcard:Kind
} }
</collated>
} }
<critical-data-required> <critical-data-required>
FILTER ( bound(?author) ) FILTER ( bound(?author) )

View file

@ -13,7 +13,11 @@
next statement --> next statement -->
<#macro showAuthorship statement> <#macro showAuthorship statement>
<#if statement.author??> <#if statement.author??>
<#if statement.subclass?? && statement.subclass?contains("vcard")>
${statement.authorName}
<#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>
<#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>