WDscholia / scholia

Wikidata-based scholarly profiles
https://scholia.toolforge.org
Other
222 stars 79 forks source link

On curation pages, add pages linked to/from target item #1428

Closed Daniel-Mietchen closed 3 years ago

Daniel-Mietchen commented 3 years ago

as per https://twitter.com/egonwillighagen/status/1387489358136201219

Adityachaturvedi2906 commented 3 years ago

Hey! this issue seems interesting, Can I work on this? Please guide me further on the same

Daniel-Mietchen commented 3 years ago

@Adityachaturvedi2906 Yes, please give it a go!

Adityachaturvedi2906 commented 3 years ago

@Adityachaturvedi2906 Yes, please give it a go!

Can you please guide me How can I start with this? Looking forward to hearing from you

Daniel-Mietchen commented 3 years ago

@Adityachaturvedi2906 here are some pointers:

Using q=Q202864 (Zika virus) as example, this would mean that the page https://scholia.toolforge.org/topic/Q202864/curation should have links if the sort

Given a specific Wikidata identifier, these two links would be identical on each potential curation page for the different aspects (e.g. /author/curation, /topic/curation etc.), so it would make sense to include this new functionality into base.html. I have used the notation q' here to indicate that it might be useful to have the label represented slightly differently than just by the identifier, e.g. with the label added, i.e. Wikidata pages linking to Zika virus (Q202864).

As a refinement, the label part could perhaps also be internationalized, as per our internationalization tickets.

Adityachaturvedi2906 commented 3 years ago

@Adityachaturvedi2906 here are some pointers:

* I clarified the title of this ticket

* The curation pages are those in the [scholia/app/templates directory](https://github.com/fnielsen/scholia/tree/master/scholia/app/templates) that have the string `curation` in their name.

* These curation templates contain all the essential information to build a Scholia curation page, with two main exceptions:

  * some page elements are inherited from other templates, especially [base.html](https://github.com/fnielsen/scholia/blob/master/scholia/app/templates/base.html)
  * the template needs to be called with the Wikidata identifier of the target item, which is handled by the variable `q`

* What we want is for each of these curation pages to automatically link to the Wikidata Special pages for items linking to and from the target item

Using q=Q202864 (Zika virus) as example, this would mean that the page https://scholia.toolforge.org/topic/Q202864/curation should have links if the sort

* [Wikidata pages linking to `q'`](https://www.wikidata.org/w/index.php?hidecategorization=1&target=Q202864&showlinkedto=1&limit=500&days=7&enhanced=1&title=Special:RecentChangesLinked&urlversion=2) and

* [Wikidata pages linked from `q'`](https://www.wikidata.org/w/index.php?hidecategorization=1&target=Q202864&showlinkedto=0&limit=500&days=7&enhanced=1&title=Special:RecentChangesLinked&urlversion=2).

Given a specific Wikidata identifier, these two links would be identical on each potential curation page for the different aspects (e.g. /author/curation, /topic/curation etc.), so it would make sense to include this new functionality into base.html. I have used the notation q' here to indicate that it might be useful to have the label represented slightly differently than just by the identifier, e.g. with the label added, i.e. Wikidata pages linking to Zika virus (Q202864).

As a refinement, the label part could perhaps also be internationalized, as per our internationalization tickets.

Okay, So I have to link these pages especially base.html with Wikidata specials

Adityachaturvedi2906 commented 3 years ago

Hey@Daniel-Mietchen can you please tell me how can I see the changes because it's not working on the live server(vs code)? image

Daniel-Mietchen commented 3 years ago

Scholia is running on Toolforge, and deploying it there means pulling the latest version of the code from GitHub. So if you got your changes working on a branch, you can send us a pull request, so we can review your code, and if it fits, we will merge it, so that it will be included when we restart the tool on Toolforge.

Adityachaturvedi2906 commented 3 years ago

I am asking that How can I run this in my system and test the code(see the changes which I made)

Adityachaturvedi2906 commented 3 years ago

Can you please guide me where I have to add those target link for the Wikidata specials?

Daniel-Mietchen commented 3 years ago

I do not see your code, so cannot provide feedback. Please provide a link. I did check your Scholia fork and its branch tree, but did not see any changes you made there. Did you commit them?

If you are having trouble getting the environment going, you can also try launching Scholia via GitPod, as per README.

Adityachaturvedi2906 commented 3 years ago

I am trying to make changes locally first and I want to see the changes locally on my PC so that I can manipulate them and then I'll commit that code

Daniel-Mietchen commented 3 years ago

Have you tried http://localhost:8100/topic/Q202864?

Daniel-Mietchen commented 3 years ago

In general, you would need to replace the URLS of the type https://scholia.toolforge.org/topic/Q202864 with their localhost equivalents, using port 8100.

Adityachaturvedi2906 commented 3 years ago

Have you tried http://localhost:8100/topic/Q202864?

It's not working but I have launched Scholia in GitPod and can you please guide me where I have to add those links?

Daniel-Mietchen commented 3 years ago

@Adityachaturvedi2906 A good place would be near the aspect-chooser button, i.e. https://github.com/fnielsen/scholia/blob/b40962a2e8bd6a3dd3612d16253f14571e8426f6/scholia/app/templates/base.html#L322

fnielsen commented 3 years ago

I am wondering whether you have seen this page: https://github.com/fnielsen/scholia/blob/master/CONTRIBUTING.rst

If you have a running Python environment you should be able to see you local Scholia running:

python runserver.py

And opening the link provided by the script.

carlinmack commented 3 years ago

@Daniel-Mietchen earlier you posted these links:

I think you wanted this instead:

However I can't seem to find a page which lists the pages linked from from q'. For now I will work with just the pages linked from.

carlinmack commented 3 years ago

Ah looking at the original tweet, it is in fact the recent changes pages that are of interest