VIVO-1038. Updated grant contributor property so that it will display name parts of vcard individuals but without making them links.
This commit is contained in:
parent
0eba1cbdbd
commit
583aa3791a
2 changed files with 103 additions and 2 deletions
|
@ -10,8 +10,10 @@
|
|||
PREFIX core: <http://vivoweb.org/ontology/core#>
|
||||
PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#>
|
||||
PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#>
|
||||
PREFIX vcard: <http://www.w3.org/2006/vcard/ns#>
|
||||
|
||||
SELECT DISTINCT <collated>?subclass</collated>
|
||||
?vSubclass
|
||||
# send the property to the template, since this view supports multiple role properties
|
||||
?property
|
||||
?role
|
||||
|
@ -36,7 +38,23 @@
|
|||
OPTIONAL { ?role <http://purl.obolibrary.org/obo/RO_0000052> ?indivInRole .
|
||||
?indivInRole rdfs:label ?indivLabel
|
||||
}
|
||||
OPTIONAL { ?role <http://purl.obolibrary.org/obo/RO_0000052> ?indivInRole .
|
||||
?indivInRole a vcard:Kind .
|
||||
?indivInRole vcard:hasName ?vName .
|
||||
?vName vcard:familyName ?lastName .
|
||||
OPTIONAL { ?vName vcard:givenName ?firstName . }
|
||||
OPTIONAL { ?vName core:middleName ?middleName . }
|
||||
bind ( COALESCE(?firstName, "") As ?firstName1) .
|
||||
bind ( COALESCE(?middleName, "") As ?middleName1) .
|
||||
bind ( COALESCE(?lastName, "") As ?lastName1) .
|
||||
bind (concat(str(?lastName1 + ", "),str(?firstName1 + " "),str(?middleName1)) as ?indivLabel) .
|
||||
|
||||
OPTIONAL { ?role <http://purl.obolibrary.org/obo/RO_0000052> ?indivInRole .
|
||||
?indivInRole a vcard:Kind .
|
||||
?indivInRole vitro:mostSpecificType ?vSubclass .
|
||||
?vSubclass rdfs:subClassOf vcard:Kind
|
||||
}
|
||||
}
|
||||
OPTIONAL { ?role core:dateTimeInterval ?dateTimeInterval .
|
||||
?dateTimeInterval core:start ?dateTimeStartValue .
|
||||
?dateTimeStartValue core:dateTime ?dateTimeStart
|
||||
|
@ -93,6 +111,81 @@
|
|||
}
|
||||
</query-construct>
|
||||
|
||||
<query-construct>
|
||||
PREFIX core: <http://vivoweb.org/ontology/core#>
|
||||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
||||
PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#>
|
||||
PREFIX vcard: <http://www.w3.org/2006/vcard/ns#>
|
||||
CONSTRUCT {
|
||||
?subject ?property ?role .
|
||||
?role a ?objectType .
|
||||
?role rdfs:label ?roleLabel .
|
||||
?role vitro:mostSpecificType ?subclass .
|
||||
?subclass rdfs:label ?roleTypeLabel .
|
||||
?role <http://purl.obolibrary.org/obo/RO_0000052> ?indivInRole .
|
||||
?indivInRole a vcard:Kind .
|
||||
?indivInRole vcard:hasName ?vName .
|
||||
?vName vcard:familyName ?lastName .
|
||||
?vName vcard:givenName ?firstName .
|
||||
?vName core:middleName ?middleName .
|
||||
?indivInRole vitro:mostSpecificType ?vSubclass .
|
||||
?vSubclass rdfs:subClassOf vcard:Kind
|
||||
} WHERE {
|
||||
{
|
||||
?subject ?property ?role .
|
||||
?role a ?objectType
|
||||
} UNION {
|
||||
?subject ?property ?role .
|
||||
?role a ?objectType .
|
||||
?role rdfs:label ?roleLabel
|
||||
} UNION {
|
||||
?subject ?property ?role .
|
||||
?role a ?objectType .
|
||||
?role vitro:mostSpecificType ?subclass
|
||||
} UNION {
|
||||
?subject ?property ?role .
|
||||
?role a ?objectType .
|
||||
?role vitro:mostSpecificType ?subclass .
|
||||
?subclass rdfs:label ?roleTypeLabel
|
||||
} UNION {
|
||||
?subject ?property ?role .
|
||||
?role a ?objectType .
|
||||
?role <http://purl.obolibrary.org/obo/RO_0000052> ?indivInRole .
|
||||
} UNION {
|
||||
?subject ?property ?role .
|
||||
?role a ?objectType .
|
||||
?role <http://purl.obolibrary.org/obo/RO_0000052> ?indivInRole .
|
||||
?indivInRole a vcard:Kind .
|
||||
?indivInRole vcard:hasName ?vName .
|
||||
?vName vcard:familyName ?lastName .
|
||||
} UNION {
|
||||
?subject ?property ?role .
|
||||
?role a ?objectType .
|
||||
?role <http://purl.obolibrary.org/obo/RO_0000052> ?indivInRole .
|
||||
?indivInRole a vcard:Kind .
|
||||
?indivInRole vcard:hasName ?vName .
|
||||
?vName vcard:familyName ?lastName .
|
||||
?vName vcard:givenName ?firstName .
|
||||
} UNION {
|
||||
?subject ?property ?role .
|
||||
?role a ?objectType .
|
||||
?role <http://purl.obolibrary.org/obo/RO_0000052> ?indivInRole .
|
||||
?indivInRole a vcard:Kind .
|
||||
?indivInRole vcard:hasName ?vName .
|
||||
?vName vcard:familyName ?lastName .
|
||||
?vName vcard:givenName ?firstName .
|
||||
?vName core:middleName ?middleName .
|
||||
} UNION {
|
||||
?subject ?property ?role .
|
||||
?role a ?objectType .
|
||||
?role <http://purl.obolibrary.org/obo/RO_0000052> ?indivInRole .
|
||||
?indivInRole a vcard:Kind .
|
||||
?indivInRole vitro:mostSpecificType ?vSubclass .
|
||||
?vSubclass rdfs:subClassOf vcard:Kind
|
||||
}
|
||||
}
|
||||
</query-construct>
|
||||
|
||||
<query-construct>
|
||||
PREFIX core: <http://vivoweb.org/ontology/core#>
|
||||
CONSTRUCT {
|
||||
|
|
|
@ -16,7 +16,15 @@
|
|||
|
||||
<#local linkedIndividual>
|
||||
<#if statement.indivInRole??>
|
||||
<#if statement.vSubclass?? && statement.vSubclass?contains("vcard")>
|
||||
<#if statement.indivLabel?replace(" ","")?length == statement.indivLabel?replace(" ","")?last_index_of(",") + 1 >
|
||||
${statement.indivLabel?replace(",","")}
|
||||
<#else>
|
||||
${statement.indivLabel}
|
||||
</#if>
|
||||
<#else>
|
||||
<a href="${profileUrl(statement.uri("indivInRole"))}" title="${i18n().name}">${statement.indivLabel!statement.indivName}</a>
|
||||
</#if>
|
||||
<#else>
|
||||
<#-- This shouldn't happen, but we must provide for it -->
|
||||
<a href="${profileUrl(statement.uri("role"))}" title="${i18n().missing_person_in_role}">${i18n().missing_person_in_role}</a>
|
||||
|
|
Loading…
Add table
Reference in a new issue