culturecreates / artsdata-shortcode

Wordpress plugin for Artsdata
0 stars 1 forks source link

Display Venues from Wikidata #5

Closed saumier closed 1 year ago

saumier commented 2 years ago

The venues should be displayed with data from Wikidata. The entities linked to orgs with "itemOperated" are to be displayed in a column with their Wikidata ID and a visual map. The entities linked to the main place with "hasPart" are to be displayed indented from the first column, along with their Wikidata ID but no map.

SPARQL https://w.wiki/5L5T

SELECT ?org ?orgLabel ?itemOperatedLabel ?partsLabel 

WHERE {
  values ?org {wd:Q112510117}
  ?org wdt:P463 wd:Q85541788 ; wdt:P121 ?itemOperated . 

  OPTIONAL {  ?itemOperated wdt:P527 ?parts. }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }

}

This SPARQL shows a list of types. We will want to filter by the highest level class "Event Venue" which includes the subclass "Performing Arts Building"

SELECT ?org ?orgLabel ?itemOperatedLabel (GROUP_CONCAT(DISTINCT ?itemOperatedTypeLab; SEPARATOR = ", ") AS ?itemOperatedTypeLabelConcat) ?partsLabel (GROUP_CONCAT(DISTINCT ?partTypeLab; SEPARATOR = ", ") AS ?partTypeLabelConcat) WHERE {
  ?org wdt:P463 wd:Q85541788.
  OPTIONAL {
    ?org wdt:P121 ?itemOperated.
    ?itemOperated wdt:P31 ?itemOperatedType.
    ?itemOperatedType rdfs:label ?itemOperatedTypeLab.
    FILTER((LANG(?itemOperatedTypeLab)) = "en")
  }
  OPTIONAL {
    ?org (wdt:P121/wdt:P527) ?parts.
    ?parts wdt:P31 ?partType.
    ?partType rdfs:label ?partTypeLab.
    FILTER((LANG(?partTypeLab)) = "en")
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,fr". }
}
GROUP BY ?org ?orgLabel ?itemOperatedLabel ?partsLabel
fjjulien commented 2 years ago

Email discussions and notes from our meeting can be found here: https://docs.google.com/document/d/1YkzP6Ql8HoZr1xJ3N-h7uSxFjIWfyCp4ztEYSIEe7cw/edit?usp=sharing

fjjulien commented 1 year ago

In case that can be helpful for anyone, I created a simple UML diagram to illustrate the class hierarchy of performing arts places in Wikidata.

fjjulien commented 1 year ago

@saumier This logic seems absolutely right to me, except for one thing. We should ask other team members whether we want or not a rule to exclude parts that are not an instance of a "performance hall". If a building contains an art gallery, do we want it to also be listed in the directory?

saumier commented 1 year ago

@fjjulien Good question. My first reaction is to be inclusive of all spaces including art galleries. Could an art gallery not be a place for an event? I also agree that this question should be put to other team members.

fjjulien commented 1 year ago

@saumier Actually, I believe art galleries will be automatically excluded from your hierarchy, because they are not a direct (or indirect) subclass of "event venue", am I right? If so, then we can keep the query as it is (and I don't need to ask my colleagues).

fjjulien commented 1 year ago

@saumier I think this logic also works really well for determining which venue item will have their Wikidata information displayed in the directory (for the current iteration it would only the geocoordinates). Only the top event venue operated should have a map in the directory.

saumier commented 1 year ago

In case that can be helpful for anyone, I created a simple UML diagram to illustrate the class hierarchy of performing arts places in Wikidata.

@fjjulien I corrected your URL diagram to show inheritance of classes (open arrow head) and composition (black diamond) in the UML style with the arrow heads at the correct end. I hope you don't mind.