marfersel / LODI

Linked Open Data Inspector
12 stars 3 forks source link

Error when running LODI with default configuration #4

Open dgarijo opened 3 years ago

dgarijo commented 3 years ago

Hello, I have setup LODI from Docker. I have configured everything to set up to local resources, but it always redirects to the target URLs instead of the local ones. Hence, I cannot test LODI without setting up my own SPARQL endpoint. For example, the URL:

http://localhost:8080/recurso/deporte/instalaciones/InstalacionDeportiva/18-complejo-deportivo-valdesalor redirects to http://opendata.caceres.es/recurso/page/deporte/instalaciones/InstalacionDeportiva/18-complejo-deportivo-valdesalor instead of http://localhost:8080/recurso/page/deporte/instalaciones/InstalacionDeportiva/18-complejo-deportivo-valdesalor and show the LODI view.

Something similar happens if I set up an example from DBPedia. Is there any way around this?

My config:

# Server configuration section                                               
<> a config:Configuration;                                                   
    config:projectName "Open Data C..ceres";                                 
    config:projectHomepage <http://localhost:8080>;                          
    config:projectLogo <https://pbs.twimg.com/profile_images/6575082667931115

    config:labelProperty rdfs:label, om:nombreAsociacion;                    
    config:descriptionProperty rdfs:comment, dcterms:description, om:historia
    config:longProperty geo:long;                                            
    config:latProperty geo:lat;                                              
    config:geoProperty schema:line, schema:polygon;                          
    config:defaultView "user";                                               

    config:sparqlEndpoint <http://opendata.caceres.es/sparql>;               
    config:datasetBase <http://localhost:8080/recurso/>;                     
    config:webBase <http://localhost:8080/>;                                 
    config:webResourcePrefix "recurso/";                                     
    config:port "8080";                                                      
.   

My Dockerfile:

FROM node:12-alpine

RUN mkdir -p /home/node/app/node_modules #&& chown -R node:node /home/node/app
RUN apk update && apk add bash
WORKDIR /home/node/app
COPY package*.json ./
RUN npm install --production
COPY . .
RUN npm config set unsafe-perm true
RUN npm install --production
COPY --chown=node:node . .
USER node
EXPOSE 8080

And I run docker run -it --rm -p 8080:8080 lodi /bin/bash and do node start.js manually.

marfersel commented 3 years ago

Hello Daniel

First of all, thank you for your message. It sure helps the community.

According to me, LODI was not supposed to work without your own SPARQL endpoint, so your behaviour might be correct. If i'm not wrong, you're trying to display an external resource locally, but for me if you try to display the resource "http://opendata.caceres.es/recurso/deporte/instalaciones/InstalacionDeportiva/18-complejo-deportivo-valdesalor" it seems logical that it redirects to its own url.

However, i think there might by a workaround. If you look at app/server.js, you should be able to adapt the script to your needs by uncommenting lines 100-103 and commenting line 104. I suppose you should also keep the original config file in order to make it works.

If it does not work, i think you may try working with redirections in this script.

Hope it helps, and please let me know if it worked or not.

Regards. Marcos.

dgarijo commented 3 years ago

Thanks for your answer, Marcos. Unfortunately that does not do the trick. I will try with a local SPARQL endpoint and local URIs for some luck. Just for the record, I am not trying to display http://opendata.caceres.es/recurso/deporte/instalaciones/InstalacionDeportiva/18-complejo-deportivo-valdesalor. I am trying to display http://localhost:8080/recurso/deporte/instalaciones/InstalacionDeportiva/18-complejo-deportivo-valdesalor, exploiting the fact that I know the system will know how to locate it in that sparql endpoint.

I understand your point too. Best, Daniel