Page MenuHomePhabricator

Appending ".json" to an entity url should work (Feature Request)
Closed, DeclinedPublic

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 raised the priority of this task from to Needs Triage.
Pengo updated the task description. (Show Details)
Pengo added a project: Wikidata.
Pengo subscribed.
hoo triaged this task as Low priority.Jan 1 2016, 11:52 PM
hoo subscribed.

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.

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

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

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 subscribed.

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

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.

...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

@Pengo @Ivanhercaz @thiemowmde Hey is this task completed? I am new to open source and mediawiki and would like to contribute. Can you guide me? Thanks.

With all the respect, but the task specifically asks to make https://www.wikidata.org/wiki/Q269728.json work. It might be that this is not something the Wikidata team want's to implement and maintain. If this is the case, the task needs to be declined, not closed as "resolved".

Multichill removed a project: good first task.

With all the respect, but the task specifically asks to make https://www.wikidata.org/wiki/Q269728.json work. It might be that this is not something the Wikidata team want's to implement and maintain. If this is the case, the task needs to be declined, not closed as "resolved".

Ok