chenejac / VIVOTestMigrationJIRA

0 stars 0 forks source link

VIVO-1883: Parsing error of SPARQL Query / Loading of people page hangs after adding indiviudal via Data Input #1774

Closed chenejac closed 4 years ago

chenejac commented 4 years ago

Matthias Lühr (Migrated from VIVO-1883) said:

I did a fresh build with all repos up to date. After that I wiped all my application data to start with a clean VIVO installation. After that I loaded the sample data N3 file into VIVO. All fine up to that point. As a next step I logged in as admin, went to the "Site Admin" page and via "Data Input" added a foaf:Person individual. Almost immediately after adding this individual the following reoccuring error message pops up in my log file (obviously the angle brackets in the individual's URI are missing):

ERROR [IndividualResponseBuilder] Data retrieval for individual lead to error java.lang.RuntimeException: edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceException: Failed to parse query " PREFIX obo: http://purl.obolibrary.org/obo/ PREFIX vcard: http://www.w3.org/2006/vcard/ns# SELECT DISTINCT ?vIndividual WHERE { https://vivo.hs-mittweida.de/vivo/individual/n1754 obo:ARG_2000028 ?vIndividual . ?vIndividual vcard:hasName ?vName . ?vName vcard:givenName ?firstName . ?vName vcard:familyName ?lastName . } " at edu.cornell.mannlib.vitro.webapp.dao.jena.QueryUtils.getQueryResults(QueryUtils.java:172) at edu.cornell.mannlib.vitro.webapp.dao.jena.QueryUtils.getQueryResults(QueryUtils.java:155) at edu.cornell.mannlib.vitro.webapp.utils.dataGetter.SparqlQueryDataGetter.doQueryOnRDFService(SparqlQueryDataGetter.java:193) at edu.cornell.mannlib.vitro.webapp.utils.dataGetter.SparqlQueryDataGetter.getData(SparqlQueryDataGetter.java:137) at edu.cornell.mannlib.vitro.webapp.utils.dataGetter.ExecuteDataRetrieval.executeDataGetters(ExecuteDataRetrieval.java:65) at edu.cornell.mannlib.vitro.webapp.controller.individual.IndividualResponseBuilder.assembleResponse(IndividualResponseBuilder.java:106) at edu.cornell.mannlib.vitro.webapp.controller.individual.IndividualController.processRequest(IndividualController.java:109) at edu.cornell.mannlib.vitro.webapp.controller.freemarker.FreemarkerHttpServlet.doGet(FreemarkerHttpServlet.java:108) at javax.servlet.http.HttpServlet.service(HttpServlet.java:634) at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)

When I now go the "People"-page and click on the link to the "Person" class nothing happens - loading of the person page is stuck.

chenejac commented 4 years ago

Matthias Lühr said:

While the query mentioned above is from the qrcode datagetter I  encounter the following sparql errors additionaly:

2020-06-23 21:08:17,519 ERROR [JsonObjectProducer] Failed to create JSON response
java.lang.RuntimeException: edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceException: Failed to parse query "PREFIX obo: <http://purl.obolibrary.org/obo/>
PREFIX vcard: <http://www.w3.org/2006/vcard/ns#>
SELECT ?pt
WHERE {
 https://vivo.hs-mittweida.de/vivo/individual/n1754 obo:ARG_2000028 ?vIndividual .
 ?vIndividual vcard:hasTitle ?vTitle .
 ?vTitle vcard:title ?pt .
 FILTER (lang(?pt) = 'de-DE' )
 } LIMIT 1"
 at edu.cornell.mannlib.vitro.webapp.dao.jena.QueryUtils.getQueryResults(QueryUtils.java:172)
 at edu.cornell.mannlib.vitro.webapp.dao.jena.QueryUtils.getQueryResults(QueryUtils.java:155)
 at edu.cornell.mannlib.vitro.webapp.utils.dataGetter.SparqlQueryDataGetter.doQueryOnRDFService(SparqlQueryDataGetter.java:193)
 at edu.cornell.mannlib.vitro.webapp.utils.dataGetter.SparqlQueryDataGetter.getData(SparqlQueryDataGetter.java:137)
 at edu.cornell.mannlib.vitro.webapp.services.shortview.FakeApplicationOntologyService$FakeVivoPeopleDataGetter.getData(FakeApplicationOntologyService.java:506)
 at edu.cornell.mannlib.vitro.webapp.services.shortview.ShortViewServiceImpl.runDataGetters(ShortViewServiceImpl.java:134)
 at edu.cornell.mannlib.vitro.webapp.services.shortview.ShortViewServiceImpl.getShortViewInfo(ShortViewServiceImpl.java:94)
 at edu.cornell.mannlib.vitro.webapp.services.shortview.ShortViewServiceImpl.renderShortView(ShortViewServiceImpl.java:48)
 at edu.cornell.mannlib.vitro.webapp.controller.json.GetRenderedSearchIndividualsByVClass.renderShortView(GetRenderedSearchIndividualsByVClass.java:86)
 at edu.cornell.mannlib.vitro.webapp.controller.json.GetRenderedSearchIndividualsByVClass.addShortViewRenderings(GetRenderedSearchIndividualsByVClass.java:72)
 at edu.cornell.mannlib.vitro.webapp.controller.json.GetRenderedSearchIndividualsByVClass.process(GetRenderedSearchIndividualsByVClass.java:58)
 at edu.cornell.mannlib.vitro.webapp.controller.json.JsonObjectProducer.process(JsonObjectProducer.java:52)
 at edu.cornell.mannlib.vitro.webapp.controller.json.JsonServlet.doGet(JsonServlet.java:75)

[https://vivo.hs-mittweida.de/vivo/individual/n1754] is the URI of the individual I added via the UI previously.

 

 

 

 

chenejac commented 4 years ago

Matthias Lühr said:

In this case the query seems to come from api/src/main/java/edu/cornell/mannlib/vitro/webapp/services/shortview/FakeApplicationOntologyService.java and it appears the the magic ?uri doesn't have a "<" nor a ">".

chenejac commented 4 years ago

Andrew Woods said:

[~accountid:6113d645b704b400686dc9fc]: I followed the steps mentioned in the description of this ticket (siteAdmin -> Data Input -> foaf:Person)... but am unable to reproduce the error in the logs. I have tried in English, German, and French.

It would be good to know if anyone else is able to reproduce.

chenejac commented 4 years ago

Dominik Feldschnieders said:

I was able to reproduce the error, i think the key is that you need to set the value "Vitro.defaultNamespace" in the runtimes.properties to an URL beginning with "https:".

For example like this "Vitro.defaultNamespace = http://some.othernamespace.edu/vivo/individual/"

With this value and the description of this ticket i was able to reproduce it. With any other URL without "https" the error did not show up.  

chenejac commented 4 years ago

Matthias Lühr said:

https://github.com/vivo-project/Vitro/pull/173

chenejac commented 4 years ago

Andrew Woods said:

[~accountid:6113d5cd4e8d8d0069f2e486]: can you verify the fix proposed in Vitro-pull-173?

chenejac commented 4 years ago

Dominik Feldschnieders said:

With the PR from Matthias it works with "https" URIs, so i can verify the fix

chenejac commented 4 years ago

Andrew Woods said:

Resolved with: https://github.com/vivo-project/Vitro/commit/4ec92fb4d63150967327b1b181303a6c56ef5c1d