display dataGetters, weird behaviour with vivo:Award

22 views
Skip to first unread message

Pedro Moreo

unread,
Oct 16, 2018, 4:22:17 AM10/16/18
to VIVO Tech
Hello all,

I have a little doubt, maybe we are doing something wrong.

According to this tutorial, https://wiki.duraspace.org/display/VIVODOC19x/Enriching+profile+pages+using+SPARQL+query+DataGetters , we are modifiying some files in our vivo local instalation. After that a compilation and a deploy is needed.

so, I modified the individual-adminPanel.ftl to present the data results of some querys, like that
---
<!-- departamentos del investigador -->
<#if posicionesInvestigador?has_content>
    <h2 style="color:green">
        Listado Departamentos propias del investigador y premios
    </h2>
    <ul role="list">
        <#list posicionesInvestigador as resultRow>
            <li class="raLink">
                  *  ${resultRow["nombrePosition"]}
                  *  ${resultRow["nombreOrganizacion"]}                 
            </li>
        </#list>
    </ul>
<#else>
    <p style="color:red;bold">5) error departamentos / posiciones  </p>
</#if>

, where we interrrogate the vivo, like that (ourFile.n3)
 

<http://vivoweb.org/ontology/core#FacultyMember> display:hasDataGetter display:investigatorDepartaments.
 
[... other things... ]

 
# consulta de los departamentos del investigador (positions)
display:investigatorDepartaments
    a <java:edu.cornell.mannlib.vitro.webapp.utils.dataGetter.SparqlQueryDataGetter> ;
    display:saveToVar "posicionesInvestigador";
    display:query """
    PREFIX rdfs:    <http://www.w3.org/2000/01/rdf-schema#>
    PREFIX vivo:    <http://vivoweb.org/ontology/core#>
    PREFIX foaf:    <http://xmlns.com/foaf/0.1/>
    
    select ?nombreOrganizacion ?nombrePosition 
    where {
        BIND (URI  ( ?individualURI ) AS ?pers ) .

        ?position a vivo:FacultyPosition.

        ?position vivo:relates ?pers.
        ?pers a vivo:FacultyMember.
        ?position rdfs:label ?nombrePosition.

        ?position vivo:relates ?org.
        ?org a foaf:Organization.
        ?org rdfs:label ?nombreOrganizacion.

    }
    """.

straightforward. 
the problem is whe we try to interrogate another vivo entity, like Award. Writting just unther these funtions in the same files, we have in the .ftl file we have :


<!-- premio? -->
<#if variableDudas?has_content>
    <h2 style="color:green">
        Listado de premios 
    </h2>
    <ul role="list">
        <#list variableDudas  as resultRow>
            <li class="raLink">
                  *  ${resultRow["nombrePosition"]}                          
            </li>
        </#list>
    </ul>
<#else>
    <p style="color:red;bold">6) ¿¿¿ ERROR PREMIOS ???</p>
</#if>


and in the .n3 :

<http://vivoweb.org/ontology/core#FacultyMember> display:hasDataGetter display:soloDepartamentos.

 [... other things... ]
 
# prueba basada en departamentos, tratando de cambiarlo por premios. no funciona
display:soloDepartamentos
    a <java:edu.cornell.mannlib.vitro.webapp.utils.dataGetter.SparqlQueryDataGetter> ;
    display:saveToVar "variableDudas";
    display:query """
    PREFIX rdfs:    <http://www.w3.org/2000/01/rdf-schema#>
    PREFIX vivo:    <http://vivoweb.org/ontology/core#>
    PREFIX foaf:    <http://xmlns.com/foaf/0.1/>
    
    select (str(?pers) AS ?nombrePosition)
    where {
        BIND (URI  ( ?individualURI ) AS ?pers ) .
        
  ?awardReceipt vivo:relates ?award. 
        ?premio a vivo:Award.  
        ?awardReceipt vivo:relates ?pers.
        
        #nombres de las variables.
        ?award rdfs:label ?nombreOrganizacion.
        ?pers rdfs:label nombrePosition.
        
    }
    """.




wich returns nothing. the same sparql query is checked in the sparql editor and it returns info always, so... we are completely lost.

Is there any feature, that makes different the vivo:Award from other vivo entities? I asume not, so the mistake must be another thing, but I cannot see what.


thanks a lot

Pedro Moreo

unread,
Oct 22, 2018, 6:50:47 AM10/22/18
to VIVO Tech
We also did more tests, and of course, the problem is not in the award entity. But, we realize, that indeed, it is hard to change the file.n3, because, lot of times, after changes/ compile and deploy, it returns nothing in any variable.

maybe there is some kind of limit in the amout of queries in a n3 file?

thanks a lot.
Reply all
Reply to author
Forward
0 new messages