Page MenuHomePhabricator

SPARQL incorrectly changes URI's from http to https
Closed, ResolvedPublic

Description

https://www.wikidata.org/wiki/Special:EntityData/Q1455955.rdf contains "<wdtn:P214 rdf:resource="http://viaf.org/viaf/5853377"/>", but if I ask the SPARQL I get https:

SELECT ?viafwikidata WHERE { wd:Q1455955 wdtn:P214 ?viafwikidata }

https://query.wikidata.org/#SELECT%20%3Fviafwikidata%20WHERE%20%7B%20wd%3AQ1455955%20wdtn%3AP214%20%3Fviafwikidata%20%7D

Returns https://viaf.org/viaf/5853377

https://www.wikidata.org/wiki/Property:P214 has the right formatter URI. We talked about this at https://www.wikidata.org/w/index.php?title=Topic:Uk2brgqgg1al95f1 and this seems to be historic behavior to normalize outgoing links. https://www.w3.org/DesignIssues/Security-NotTheS.html explains why this is wrong and breaks things. See for example https://www.wikidata.org/wiki/Property_talk:P1006/Mismatches for a query that breaks.

Event Timeline

Smalyshev triaged this task as Medium priority.Mar 20 2019, 12:19 AM

Change 517770 had a related patch set uploaded (by Smalyshev; owner: Smalyshev):
[wikidata/query/rdf@master] Update vocabularies to use correct URL for VIAF

https://gerrit.wikimedia.org/r/517770

This will require DB reload, so will be handled when that happens.

Change 517770 merged by jenkins-bot:
[wikidata/query/rdf@master] Update vocabularies to use correct URL for VIAF

https://gerrit.wikimedia.org/r/517770

Is is just an impression or do we now get redirected through http: when clicking on a Wikidata item on results on a https-connection WQS?

It would probably be preferable to convert the entire thing to https.

It is important to not confuse the data access URL with the identifier URI. Identifier URI should be the same for all Linked Data applications, so that they know it's the same thing. Data access URL can be anything as long as it delivers data (and in general identifier URI doesn't even have to produce any data though it's a good form to have it produce or redirect to something). Looks like correct identifier for VIAF has http.

Is is just an impression or do we now get redirected through http: when clicking on a Wikidata item on results on a https-connection WQS?

It would probably be preferable to convert the entire thing to https.

Have a look at https://www.w3.org/DesignIssues/Security-NotTheS.html

Change 587835 had a related patch set uploaded (by DCausse; owner: DCausse):
[wikidata/query/rdf@master] Followup on invalid VIAF https conversion

https://gerrit.wikimedia.org/r/587835

Change 587835 merged by jenkins-bot:
[wikidata/query/rdf@master] Followup on invalid VIAF https conversion

https://gerrit.wikimedia.org/r/587835