Page MenuHomePhabricator

Appending ".json" to an entity url should work (Feature Request)
Open, LowestPublic

Description

For example, to view the JSON of:

https://www.wikidata.org/wiki/Q269728

You should be able to visit:

https://www.wikidata.org/wiki/Q269728.json

Currently you can find the json at: https://www.wikidata.org/wiki/Special:EntityData/Q269728.json which is practically impossible to find and is not linked in the "Tools" sidebar or anywhere else I can find. I saw somewhere that "content negotiation" might be possible to view the json format, but it is not practical in many use cases.

Event Timeline

Pengo created this task.Dec 31 2015, 10:52 PM
Pengo updated the task description. (Show Details)
Pengo raised the priority of this task from to Needs Triage.
Pengo added a project: Wikidata.
Pengo added a subscriber: Pengo.
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald TranscriptDec 31 2015, 10:52 PM
hoo triaged this task as Low priority.Jan 1 2016, 11:52 PM
hoo added a subscriber: hoo.

This already works for https://www.wikidata.org/entity/Q269728.json (that's the URL found under "Concept URI" in the sidebar with .json appended).

See also T66515.

Pengo added a comment.Jan 2 2016, 3:40 AM

I stand by my "practically impossible to find" comment.

What do you want exactly? This looks like a WORKSFORME.

Pengo added a comment.Jan 3 2016, 4:12 AM

What do you want exactly?

To be able to add ".json" to a url in your browser's url bar.

If you visit:

https://www.wikidata.org/entity/Q269728 (/entity)

You will be redirected to:

https://www.wikidata.org/wiki/Q269728 (/wiki)

So I'm not sure how anyone would find the working json url of:

https://www.wikidata.org/entity/Q269728.json  (/entity .json)

Instead, you'll probably find this:

https://www.wikidata.org/wiki/Q269728.json (* /wiki .json)

with the message "This entity does not exist"

Why not make it work the same way as the "/entity .json" url? i.e. also
redirect it to https://www.wikidata.org/wiki/Special:EntityData/Q269728.json

Lydia_Pintscher lowered the priority of this task from Low to Lowest.Feb 7 2018, 4:01 PM
thiemowmde added a subscriber: thiemowmde.

This ticket appears to be some kind of subticket of T109420: [Story] Make exports formats more visible. Both are about discoverability.

Personally I support what is asked for here. When I'm on a wiki page like
https://www.wikidata.org/wiki/Q269728
and I add ".json" at the end, I expect the resulting URL
https://www.wikidata.org/wiki/Q269728.json
to not show a "page not found" error as it does now, but to redirect to
https://www.wikidata.org/entity/Q269728.json

Pengo added a comment.May 17 2018, 3:31 AM

Thanks thiemowmde for drawing the connection. I've added this as a child task in case someone suddenly decides to write a couple of nginx regex rewrite rules to make this happen.

cscott added a subscriber: cscott.Oct 11 2018, 7:02 PM

...and adding .jsonld at the end should also work, right?

...and adding .jsonld at the end should also work, right?

Yes please. I hope the current open patch in T44063 will take care of that