Comments (4)
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.
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.
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.
@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)
- Scalable id storage
- Add an "How-To-Test" to the description HOT 1
- warning on clone: case sensitive/insensitive file systems HOT 1
- allow browser (html) dereferencing of i-adopt terms to abuse the available local fragment identifiers HOT 1
- bad forward from w3id.org/mediatype/ HOT 4
- W3C Caused by: com.apicatalog.jsonld.JsonLdError: Unexpected response code [429] HOT 1
- Broken link to openspring.net under Management on the w3id.org home page HOT 1
- dggs.org broken HOT 4
- Update w3id.org homepage content with one from the latest README.md HOT 1
- add redirect test workflow / github action
- How to redirect to Ontology documentation with Widoco HOT 3
- Remove directory under /italia HOT 5
- Common format for metadata and test specifications HOT 5
- Redirection issue by certificate when importing in Protege HOT 7
- Verifiable Credential JWS2020 incorrect content-type HOT 6
- build upon @MattBlissett 's gensc PR #3946
- Additional requested static re-directions for `gensc` HOT 1
- add @turbomam as maintainer of `gensc` namespace
- Documentation of the top-level Apache httpd configuration HOT 2
- w3id.org should not redirect on OPTIONS HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from w3id.org.