Deprecated. This material represents early efforts and may be of interest to historians. It doe not describe current VIVO efforts.

on 8/27/13, Eliza writes:
Hello,
We'd like to display the citation counts for articles listed on the profile pages.
So I modified the configuration file and added a citation count variable to the query.
However, the freemarker template didn't seem to pick up that variable.
See below for what was changed in the listViewConfig-authorInAuthorship.xml file:
    <query-select>    
        PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;    
        PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;
        PREFIX afn:  &lt;http://jena.hpl.hp.com/ARQ/function#&gt;
        PREFIX bibo: &lt;http://purl.org/ontology/bibo/&gt
        PREFIX c4o: &lt;http://purl.org/spar/c4o/&gt;
              
        SELECT DISTINCT ?subclass 
                        ?authorship
                        ?infoResource 
                        ?infoResourceName 
                        ?globalCitationCount
                        ?dateTime
                        ?journal
                        ?volume
                        ?startPage
                        ?endPage
                        ?publisher
                        ?locale
                        ?appearsIn
                        ?partOf
                        ?editor
                        ?hideThis
        WHERE {
            ?subject ?property ?authorship  
            OPTIONAL { ?authorship core:linkedInformationResource ?infoResource .                      
                       ?infoResource rdfs:label ?infoResourceName .
            
                       OPTIONAL { ?infoResource bibo:volume ?volume }
                       OPTIONAL { ?infoResource bibo:pageStart ?startPage }
                       OPTIONAL { ?infoResource bibo:pageEnd ?endPage }
                       OPTIONAL { ?infoResource core:placeOfPublication ?locale }
                       OPTIONAL { ?infoResource bibo:reproducedIn ?appearsInObj .
                                  ?appearsInObj rdfs:label ?appearsIn
                       }
                       OPTIONAL { ?infoResource core:publisher ?publisherObj .
                                  ?publisherObj rdfs:label ?publisher
                       }
                       OPTIONAL { ?infoResource core:editor ?editorObj .
                                  ?editorObj rdfs:label ?editor
                       }
                       OPTIONAL { ?infoResource core:partOf ?partOfObj .
                                  ?partOfObj rdfs:label ?partOf
                       }
                       OPTIONAL {  ?infoResource vitro:mostSpecificType ?subclass .
                                   ?subclass rdfs:subClassOf core:InformationResource .
                       }     
                       
                       OPTIONAL { ?infoResource core:hasPublicationVenue ?publishedIn .
                                    ?publishedIn  rdfs:label ?journal 
                       }
                       OPTIONAL { ?infoResource core:dateTimeValue ?dateTimeValue .
                                  ?dateTimeValue core:dateTime ?dateTime  
                       }
                       
                       OPTIONAL { ?infoResource c4o:hasGlobalCitationFrequency ?hasGlobalCitationFrequencyObj .
                                    ?hasGlobalCitationFrequencyObj  rdfs:label ?globalCitationCount 
                       }
                       
                       OPTIONAL { ?authorship core:hideFromDisplay ?hideThis }                                                      
            }
    #        NOT EXISTS { ?authorship core:hideFromDisplay ?hideThis } 
            <critical-data-required>
            FILTER ( bound(?infoResource) )
            </critical-data-required>
        } ORDER BY DESC(?dateTime) ?infoResourceName   
    </query-select>
And the template propStatement-authorInAuthorship.ftl:
    <#local timesCited>
     <#if statement.subclass??>
     <#if statement.globalCitationCount??>
     <br/>${statement.globalCitationCount!}
 </#if>
     </#if>
    </#local>
    
    ${resourceTitle} ${citationDetails} <@dt.yearSpan "${statement.dateTime!}" /> ${resourceType} ${timesCited}
    
Any reason why it's not working?

Resolution:

on 8/28/13, Eliza writes:
It's finally resolved, but not until moving the variable to another construct:
    <query-construct>
        PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;
        PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;    
        PREFIX bibo: &lt;http://purl.org/ontology/bibo/&gt;
        PREFIX c4o: &lt;http://purl.org/spar/c4o/&gt
        CONSTRUCT { 
            ?subject ?property ?authorship .  
            ?authorship ?authorshipProperty ?authorshipValue .
            ?authorship core:linkedInformationResource ?infoResource .
            ?infoResource rdfs:label ?infoResourceName .
            ?infoResource core:hasPublicationVenue ?publishedIn .
            ?publishedIn  rdfs:label ?journal .
            ?infoResource c4o:hasGlobalCitationFrequency ?hasGlobalCitationFrequencyObj .
            ?hasGlobalCitationFrequencyObj  rdfs:label ?globalCitationCount
        } WHERE {
            {
               ?subject ?property ?authorship 
            }
            UNION {
               ?subject ?property ?authorship .
               ?authorship ?authorshipProperty ?authorshipValue 
            } UNION {
               ?subject ?property ?authorship .
               ?authorship core:linkedInformationResource ?infoResource 
            } UNION {
               ?subject ?property ?authorship .
               ?authorship core:linkedInformationResource ?infoResource .
               ?infoResource rdfs:label ?infoResourceName 
            } UNION {
               ?subject ?property ?authorship .
               ?authorship core:linkedInformationResource ?infoResource .
               ?infoResource core:hasPublicationVenue ?publishedIn 
            } UNION {
               ?subject ?property ?authorship .
               ?authorship core:linkedInformationResource ?infoResource .
               ?infoResource core:hasPublicationVenue ?publishedIn .
               ?publishedIn  rdfs:label ?journal
            } UNION {
               ?subject ?property ?authorship .
               ?authorship core:linkedInformationResource ?infoResource .
               ?infoResource c4o:hasGlobalCitationFrequency ?hasGlobalCitationFrequencyObj .
               ?hasGlobalCitationFrequencyObj  rdfs:label ?globalCitationCount
            } 
        } 
    </query-construct>
This time, it was able to pick up the variable.
Not exactly sure why but it's working.
  • No labels