Giter Club home page Giter Club logo

Comments (4)

davidlehn avatar davidlehn commented on August 23, 2024

I'm not sure how that test suite script works and I'm not a protege user, but I'll try to help. Can you list one failing URL you are requesting, the Accept header being used, and the expected result? I assume the above text should have a slash in the URL? "/bot-0.3.2" won't work. It looks like it does follow through to ttl content. The w3id server does output html in the redirect content, but tools should ignore that.

curl -v -L -H "Accept: text/turtle" https://w3id.org/bot/0.3.2

If you want to test locally you can serve up the w3id repo in a local apache instance and map w3id.org to localhost. There are some https certificate issues to deal with though. I usually test redirects with a non-https http://w3id.localhost/ alias.

from w3id.org.

attadanta avatar attadanta commented on August 23, 2024

Hi @davidlehn,

I ran protégé behind a proxy and captured the following exchange. (I followed this and trimmed the bodies and some of the headers for brevity)

==================================================
GET /bot/0.3.2 HTTP/1.1
------------------------- request headers -------------------------
ACCEPT                        : application/rdf+xml, application/xml; q=0.7, text/xml; q=0.6, text/plain; q=0.1, */*; q=0.09
ACCEPT-ENCODING               : xz,gzip,deflate
USER-AGENT                    : Java/1.8.0_121
HOST                          : w3id.org
------------------------- response headers -------------------------
LOCATION                      : https://w3c-lbd-cg.github.io/bot/bot-0.3.2.ttl
CONTENT-LENGTH                : 305
CONTENT-TYPE                  : text/html; charset=iso-8859-1
127.0.0.1:50640: GET https://w3id.org/bot/0.3.2
              << 302 Found 305b
127.0.0.1:50640: clientdisconnect
127.0.0.1:50642: clientconnect

==================================================
GET /bot/bot-0.3.2.ttl HTTP/1.1
------------------------- request headers -------------------------
ACCEPT                        : application/rdf+xml, application/xml; q=0.7, text/xml; q=0.6, text/plain; q=0.1, */*; q=0.09
ACCEPT-ENCODING               : xz,gzip,deflate
USER-AGENT                    : Java/1.8.0_121
HOST                          : w3c-lbd-cg.github.io
------------------------- response headers -------------------------
CONTENT-LENGTH                : 114214
CONTENT-TYPE                  : text/turtle; charset=utf-8
127.0.0.1:50642: GET https://w3c-lbd-cg.github.io/bot/bot-0.3.2.ttl
              << 200 OK 111.54k
127.0.0.1:50644: clientconnect

==================================================
GET /bot/0.3.2 HTTP/1.1
------------------------- request headers -------------------------
ACCEPT                        : application/rdf+xml, application/xml; q=0.7, text/xml; q=0.6, text/plain; q=0.1, */*; q=0.09
ACCEPT-ENCODING               : xz,gzip,deflate
USER-AGENT                    : Java/1.8.0_121
HOST                          : w3id.org
------------------------- response headers -------------------------
LOCATION                      : https://w3c-lbd-cg.github.io/bot/bot-0.3.2.ttl
CONTENT-LENGTH                : 305
CONTENT-TYPE                  : text/html; charset=iso-8859-1
127.0.0.1:50644: GET https://w3id.org/bot/0.3.2
              << 302 Found 305b
127.0.0.1:50644: clientdisconnect

==================================================
GET /bot/bot-0.3.2.ttl HTTP/1.1
------------------------- request headers -------------------------
ACCEPT                        : application/rdf+xml, application/xml; q=0.7, text/xml; q=0.6, text/plain; q=0.1, */*; q=0.09
ACCEPT-ENCODING               : xz,gzip,deflate
USER-AGENT                    : Java/1.8.0_121
HOST                          : w3c-lbd-cg.github.io
------------------------- response headers -------------------------
CONTENT-LENGTH                : 114214
CONTENT-TYPE                  : text/turtle; charset=utf-8
127.0.0.1:50642: GET https://w3c-lbd-cg.github.io/bot/bot-0.3.2.ttl
              << 200 OK 111.54k
127.0.0.1:50646: clientconnect

==================================================
GET /bot/0.3.2 HTTP/1.1
------------------------- request headers -------------------------
ACCEPT                        : application/rdf+xml, application/xml; q=0.7, text/xml; q=0.6, text/plain; q=0.1, */*; q=0.09
ACCEPT-ENCODING               : xz,gzip,deflate
USER-AGENT                    : Java/1.8.0_121
HOST                          : w3id.org
------------------------- response headers -------------------------
LOCATION                      : https://w3c-lbd-cg.github.io/bot/bot-0.3.2.ttl
CONTENT-LENGTH                : 305
CONTENT-TYPE                  : text/html; charset=iso-8859-1
127.0.0.1:50646: GET https://w3id.org/bot/0.3.2
              << 302 Found 305b
127.0.0.1:50646: clientdisconnect

==================================================
GET /bot/bot-0.3.2.ttl HTTP/1.1
------------------------- request headers -------------------------
ACCEPT                        : application/rdf+xml, application/xml; q=0.7, text/xml; q=0.6, text/plain; q=0.1, */*; q=0.09
ACCEPT-ENCODING               : xz,gzip,deflate
USER-AGENT                    : Java/1.8.0_121
HOST                          : w3c-lbd-cg.github.io
------------------------- response headers -------------------------
CONTENT-LENGTH                : 114214
CONTENT-TYPE                  : text/turtle; charset=utf-8
127.0.0.1:50642: GET https://w3c-lbd-cg.github.io/bot/bot-0.3.2.ttl
              << 200 OK 111.54k
127.0.0.1:50648: clientconnect

==================================================
GET /bot/0.3.2 HTTP/1.1
------------------------- request headers -------------------------
USER-AGENT                    : Java/1.8.0_121
HOST                          : w3id.org
ACCEPT                        : text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
------------------------- response headers -------------------------
LOCATION                      : https://w3c-lbd-cg.github.io/bot/0.3.2
CONTENT-LENGTH                : 297
KEEP-ALIVE                    : timeout=5, max=100
CONTENT-TYPE                  : text/html; charset=iso-8859-1
127.0.0.1:50648: GET https://w3id.org/bot/0.3.2
              << 302 Found 297b
127.0.0.1:50648: clientdisconnect

==================================================
GET /bot/0.3.2 HTTP/1.1
------------------------- request headers -------------------------
USER-AGENT                    : Java/1.8.0_121
HOST                          : w3c-lbd-cg.github.io
ACCEPT                        : text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
------------------------- response headers -------------------------
127.0.0.1:50642: GET https://w3c-lbd-cg.github.io/bot/0.3.2
              << 404 Not Found 9.12k

protégé does four requests with the original URL, gets 200's on each, but ignores them. Afterwards, it tries with text/html, which fails since the redirection rule does not fire for that content type.

Removing the text/html condition in the rule would probably help. However, I think it would be worthwhile to understand what causes the behavior so that more reliable test tools could be built.

My test suite works exactly like your test snippet. It compares the location response header against an expected URL and complains if those don't match. This alone doesn't ensure that the redirection would work in protégé.

Adding to the mystery, protégé opens the ontology when pointed to my test setup at http://bot.mischung.net.

from w3id.org.

dgarijo avatar dgarijo commented on August 23, 2024

In case it helps, I handle the access to particular versions with a separated rule. Example: https://github.com/perma-id/w3id.org/blob/master/okn/o/sd/.htaccess

It loads in Protege correctly. Maybe they are expecting a 303 instead of a 302, but in theory it should not matter.

from w3id.org.

aljoshakoecher avatar aljoshakoecher commented on August 23, 2024

@dgarijo: Thank you! Your hint with the 303 did it for me 👍
I had the same problem with version IRIs and Protege failing to resolve imports. After wasting some hours testing my .htaccess and looking through issues at this repo and at Protege I finally came across this issue here.

What is strange is that "plain" ontology IRIs without a version work with a 301...

from w3id.org.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.