Page MenuHomePhabricator

Set .json-ld as an alias of .jsonld
Open, Needs TriagePublic

Description

As a user I would want to load http://www.wikidata.org/entity/Q42.jsonld or http://www.wikidata.org/entity/Q42.json-ld interchangeably in order to retrieve the data of a Wikidata entity in JSON-LD format.

Problem: The name of the format JSON-LD is usually written with an hyphen, which can lead users to write the extension .json-ld instead of .jsonld. Anyway, the standard and most correct extension is the one currently supported by Wikidata, .jsonld.

Acceptance criteria:

Event Timeline

alaa_wmde added a subscriber: alaa_wmde.

We should not do this. The standard (https://json-ld.org/spec/latest/json-ld/) mentions jsonld as the extension (search for "File extension(s):") as pointed out in the description. Another reference https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Complete_list_of_MIME_types.

The users using the wrong extension in this case should just correct their usage, I believe.

Introducing another extension is another public interface to maintain for no good reason.

When requesting data via the Accept HTTP header at least the following values are supported: application/json, application/vnd.php.serialized, text/n3, text/rdf+n3, text/turtle, application/x-turtle, application/n-triples, text/n-triples, text/plain, application/rdf+xml, application/xml, text/xml, application/ld+json. These values are just aliases (redirects) to the URLs with the extensions, some of these values are duplicates, and some of them (e.g., text/rdf+n3) aren't media types recognized by the IANA either, but I do think these redirects are useful and guess they don't significantly increase the maintenance cost. In particular, redirecting some extensions to others might be simpler and more maintainable than what is done for header values, and in that case I would wonder why not give back to users what they want when we know unambiguously what it is.

Given that we're just talking redirects and we already have similar cases like abian mentioned I think we should do it.