Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement a "linked data" portlet in the right sidebar #524

Open
14 of 16 tasks
paregorios opened this issue Nov 8, 2024 · 7 comments
Open
14 of 16 tasks

Implement a "linked data" portlet in the right sidebar #524

paregorios opened this issue Nov 8, 2024 · 7 comments

Comments

@paregorios
Copy link
Member

paregorios commented Nov 8, 2024

To replace the functionality of the defunct Peripleo sidebar, we need a new right-side portlet to appear alongside every place page that provides links to external sites that claim to provide information about the same or a closely related place as that treated by the Pleiades place page.

Design

A set of candidate design pages here:

annotated
annotated 1
annotated 2
annotated 3

Data

Everything shown in the design mockups can be built by parsing JSON data already generated by the pleiades_sidebar package script generate.py. Each file contains all the links for a given Pleiades place in a single list. Each top-level object in the list is a fragment of a Linked Places Format Feature object, containing just enough information in order to construct the portlet.

For example, here is the sidebar JSON for Pleiades 213761155: Domus dei Coiedii, for which the sidebar layout is shown in the final design mockup:

[
    {
        "@id": "http://www.wikidata.org/entity/Q3035640",
        "type": "Feature",
        "properties": {
            "title": "Domus dei Coiedii",
            "summary": "Building in Castelleone di Suasa, Italy",
            "reciprocal": true
        },
        "links": [
            {
                "type": "closeMatch",
                "identifier": "https://pleiades.stoa.org/places/213761155"
            }
        ]
    }
]

This data is produced several times a week and is already included in the pleiades.datasets package at data/sidebar.

Requirements to implement

  • Determine where on the Pleiades server to put a copy of the data subtree as currently found in pleiades.datasets.
  • Implement Apache rewrite rules etc. to retrieve the raw JSON from URIs following the pattern https://pleiades.stoa.org/places/\d+/sidebar. Generating a 404 if a corresponding file does not exist is acceptable. CORS and other permissions must be set so that these files can be retrieved, downloaded, and re-used freely anywhere on the web, provided the corresponding Pleiades place is in published status.
  • Implement portlet to draw upon the corresponding JSON file to construct the sidebar portlet content.
    • Portlet title: "Linked Data"
    • To the immediate right of the portlet title a question-mark icon must appear that links to a help document (to be written) at https://pleiades.stoa.org/help/using-pleiades-data/linked-data-sidebar.
    • Data about third-party links must be drawn from the JSON file, grouped by domain (netloc).
      • Domains must be given a display title from a registry vocabulary (or similar arrangement that can be edited by admin via @@pleiades-settings) and the sections must be alphabetically sorted using these titles when shown in the portlet. In the HTML, the domain title should be wrapped in the most appropriate heading level based on hierarchy (i.e., probably <h2>).
    • Each domain title must be accompanied at left by a triangle widget that can be clicked to fold/unfold the listing of individual items that appears underneath.
    • Below each domain title, list entries for each individual Feature object whose @id is in the corresponding domain must be shown.
      • The HTML link (<a> element) text node must contain the string found in ["properties"]["title"]. The list entries for a given domain must be sorted by this title value as well.
      • The title attribute on the <a> element must contain the string found in ["properties"]["summary"].
      • The href attribute on the <a> element must contain the URI found in ["@id"]
      • If the value of ["properties"]["reciprocal"] is true, then a gold star (⭐️ Unicode: U+2B50) must be used for the corresponding list item bullet icon; otherwise, a regular solid bullet must be used.
    • Default condition for folding of a given domain section is as follows: if there are less than 5 items in the list, the default state is open (i.e., the list is visible); otherwise, the default state is closed (i.e., the list is not visible).
      • When a domain section is folded closed and the list of items cannot be seen, the number of items in the list must be displayed at the end of the title string for that domain section.
    • At bottom of portlet, below an <hr> element, the text "json version" must be displayed, wrapped in an HTML <a> element that links to the corresponding raw sidebar JSON.
@jessesnyder
Copy link

@paregorios Do we need to copy the JSON files to the NYU server, or can we serve them from Github, either as standard "raw" URLs, or behind Statically?

@jessesnyder
Copy link

Also, would it be reasonable to put this new portlet in pleiades.portlet.references? Other suggestions? We don't want to mimic the existing pattern of creating whole packages for single portlet types :)

@paregorios
Copy link
Member Author

paregorios commented Dec 12, 2024 via email

@paregorios
Copy link
Member Author

paregorios commented Dec 12, 2024 via email

@jessesnyder
Copy link

I've now discovered that the pleiades.portlet.reference package isn't even installed on production:
Screenshot 2024-12-13 at 1 11 41 PM

Since it has all the right infrastructure, I'm considering just keeping the package and using it for the new portlet, optionally removing the References portlet which apparently isn't in use(?)

@paregorios
Copy link
Member Author

paregorios commented Dec 13, 2024 via email

@jessesnyder
Copy link

Went a different direction and added the new portlet to Products.PleiadesEntity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants