Modelling/Events and activities/Conferences: Difference between revisions

From MetaBase
Jump to navigation Jump to search
(Created page with "{{Modelling navigation}} C")
 
No edit summary
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Modelling navigation}}
{{Modelling navigation}}
==Modeling a conference==
{{Q|Q22660}} is used as an example here.
===Session structure===
* A {{Q|Q42}} normally consists of several {{Q|Q22726}}.
** These are linked using {{P|P35}} / {{P|P17}}.
* {{Q|Q22726}} can be either of {{Q|Q79}}, {{Q|Q80}}, {{Q|Q81}}. Thus, every session has two {{P|P5}}.
* {{Q|Q22726}} contains one or more of specific activities. For example, a session can contain three separate presentations, by different speakers, on the same topic. What brings them together is that they are grouped as one session in the program.
** This is modeled using {{P|P66}} and the qualifier {{P|P62}}.
** '''Example:''' {{Q|Q22701}}, which contains 3 presentations. Compare [https://meta.wikimedia.org/wiki/GLAM_Wiki_2023/Program/Wikidata_for_cultural_heritage the description in the conference program].
* {{Q|Q22726}} can have one or more {{P|P33}} (people who present) or {{P|P32}} (people who facilitate a practical activity, like a workshop).
==SPARQL==
===All conferences===
<SPARQL tryit="1">
PREFIX wb: <https://metabase.wikibase.cloud/entity/>
PREFIX wbt: <https://metabase.wikibase.cloud/prop/direct/>
SELECT DISTINCT ?item ?itemLabel ?where ?whereLabel ?when ?start ?end
WHERE
{
?item wbt:P5/wbt:P4* wb:Q42 .
OPTIONAL {?item wbt:P23 ?when}
OPTIONAL {?item wbt:P27 ?where}
OPTIONAl {?item wbt:P6 ?start}
OPTIONAL {?item wbt:P7 ?end}
SERVICE wikibase:label { bd:serviceParam wikibase:language "en,sv". }
}
</SPARQL>
===Everything that is part of GLAM Wiki 2023, including the dates, people involved, and main subjects===
<SPARQL tryit="1">
PREFIX wb: <https://metabase.wikibase.cloud/entity/>
PREFIX wbt: <https://metabase.wikibase.cloud/prop/direct/>
SELECT ?item ?itemLabel (GROUP_CONCAT(DISTINCT ?typeLabel; SEPARATOR = ", ") AS ?types) ?when (GROUP_CONCAT(DISTINCT ?personLabel; SEPARATOR = ", ") AS ?persons) (GROUP_CONCAT(DISTINCT ?mainsubjectLabel; SEPARATOR = ", ") AS ?topics)
WHERE
{
?item wbt:P17* wb:Q22660.
?item wbt:P5 ?type.
OPTIONAL {?item wbt:P23 ?when}
OPTIONAL {?item wbt:P32 ?person} # leader, eg in a workshop
OPTIONAL {?item wbt:P33 ?person} # speaker, eg in a presentation
OPTIONAL {?item wbt:P19 ?person} # author, eg of a video
OPTIONAL {?item wbt:P15 ?mainsubject}
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "en,sv,es".
    ?item rdfs:label ?itemLabel.
    ?person rdfs:label ?personLabel.
    ?mainsubject rdfs:label ?mainsubjectLabel.
    ?type rdfs:label ?typeLabel.
  }
}
GROUP BY ?item ?itemLabel ?types ?when
ORDER BY ?itemLabel
</SPARQL>
[[Category:Documentation|C]]
[[Category:Documentation|C]]

Latest revision as of 09:11, 19 April 2024


Modeling a conference

GLAM Wiki 2023 (Q22660) is used as an example here.

Session structure

SPARQL

All conferences

PREFIX wb: <https://metabase.wikibase.cloud/entity/>
PREFIX wbt: <https://metabase.wikibase.cloud/prop/direct/>
SELECT DISTINCT ?item ?itemLabel ?where ?whereLabel ?when ?start ?end
WHERE
{
?item wbt:P5/wbt:P4* wb:Q42 .
OPTIONAL {?item wbt:P23 ?when}
OPTIONAL {?item wbt:P27 ?where}
OPTIONAl {?item wbt:P6 ?start}
OPTIONAL {?item wbt:P7 ?end}
SERVICE wikibase:label { bd:serviceParam wikibase:language "en,sv". }
}

Try it!

Everything that is part of GLAM Wiki 2023, including the dates, people involved, and main subjects

PREFIX wb: <https://metabase.wikibase.cloud/entity/>
PREFIX wbt: <https://metabase.wikibase.cloud/prop/direct/>
SELECT ?item ?itemLabel (GROUP_CONCAT(DISTINCT ?typeLabel; SEPARATOR = ", ") AS ?types) ?when (GROUP_CONCAT(DISTINCT ?personLabel; SEPARATOR = ", ") AS ?persons) (GROUP_CONCAT(DISTINCT ?mainsubjectLabel; SEPARATOR = ", ") AS ?topics)
WHERE
{
?item wbt:P17* wb:Q22660.
?item wbt:P5 ?type.
OPTIONAL {?item wbt:P23 ?when}
OPTIONAL {?item wbt:P32 ?person} # leader, eg in a workshop
OPTIONAL {?item wbt:P33 ?person} # speaker, eg in a presentation
OPTIONAL {?item wbt:P19 ?person} # author, eg of a video
OPTIONAL {?item wbt:P15 ?mainsubject}
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "en,sv,es".
    ?item rdfs:label ?itemLabel.
    ?person rdfs:label ?personLabel.
    ?mainsubject rdfs:label ?mainsubjectLabel.
    ?type rdfs:label ?typeLabel.
  }
}
GROUP BY ?item ?itemLabel ?types ?when
ORDER BY ?itemLabel

Try it!