galaxyproject / galaxy-hub

Galaxy Community Hub
https://galaxyproject.org/
Other
98 stars 276 forks source link

Reimplement JSON-LD data for events #1442

Open NickSto opened 2 years ago

NickSto commented 2 years ago

This was implemented in Hub 1.0, and instead of reimplementing it after the rewrite, we went with the Hub unification effort as a solution for crossposting content across communities. But:

So a lot of european projects e.g. TeSS require json-ld, and it's incredibly useful for that they are the "training materials and event scraper for europe" from elixir removing this will break that ingest, unfortunately If it would be possible to resurrect that, it'd be really useful for european collaboration efforts!

- @hexylena

Hub 1.0 had JSON-LD on the /events/ page: one blob per event, each in its separate <script> tag:

<script type="application/ld+json">{ 
 "@context": "http://schema.org/",
   "@type": "Event",
   "name": "Speed up your data analysis with Galaxy: Features no one knows about","url": "https://galaxyproject.eu/event/2021-01-15-webinars-adv-features-session4/", "duration": "P1D",
"location": {
   "@type": "Place",
   "address": "Galaxy-ELIXIR Advanced Features webinar series, Online, Europe", 
"url": "https://us02web.zoom.us/webinar/register/WN_oIXQYaCpTfqp9RgOu6gj3g" },
"contact": {
 "@type": "person",
 "name": "Jennifer Hillman-Jackson, Anika Erxleben"
},"startDate": "2021-03-24"
}</script>

But @hexylena had some suggestions for improving that:

For reference, the original issue for adding it to Hub 1.0: #252

Here's a thread on ways to do this in Gridsome: gridsome/gridsome#352

hexylena commented 2 years ago

Thanks @NickSto! if y'all get something started, I can maybe work on making it match all the schema properties?

NickSto commented 2 years ago

One question about implementation is whether to put json-ld blobs on the /events/ page and/or one blob on each individual event's page. The old .org Hub did the former and .eu does the latter.

According to @hexylena, if we have a sitemap, sites like TeSS can use that to find every event page and extract the json-ld from there, so we don't have to include the blobs on the /events/ page.

We don't currently have a sitemap, but there's a Gridsome plugin for that, so hopefully it should be easy.

NickSto commented 2 years ago

Another tidbit from @hexylena: For compatibility with TeSS's scrapers, we need to make sure to use bioschemas.

hexylena commented 2 years ago

Yeah but like, no dramas. Implement the JSON ld bits with a demo of how to access page variables and I can take it from there.

NickSto commented 2 years ago

Okay, so I wrote an initial implementation and pushed it here: #1564. The makeJsonLd() function in ArticleHeader.vue is where the rubber meets the road. Feel free to extend/improve or I can work more on it later.

Note (mostly to myself): we're using a bioschema extension to Event that includes a contact property: https://bioschemas.org/profiles/Event/0.2-DRAFT-2019_06_14

hexylena commented 2 years ago

Fantastic! I'll have a look into it, maybe we can discuss during EGD @NickSto

hexylena commented 1 year ago

Oh, right, I made this my task. That's why it still hasn't been fixed :| righto, will get around to it.