Modelling/Events and activities/Conferences: Difference between revisions

From MetaBase
Jump to navigation Jump to search
Line 25: Line 25:
}
}
</SPARQL>
</SPARQL>
===Everything that is part of GLAM Wiki 2023, including the dates, people involved, wikipages and main subjects===
===Everything that is part of GLAM Wiki 2023, including the dates, people involved, and main subjects===
<SPARQL tryit="1">
<SPARQL tryit="1">
PREFIX wb: <https://metabase.wikibase.cloud/entity/>
PREFIX wb: <https://metabase.wikibase.cloud/entity/>
PREFIX wbt: <https://metabase.wikibase.cloud/prop/direct/>
PREFIX wbt: <https://metabase.wikibase.cloud/prop/direct/>
SELECT ?item ?itemLabel (GROUP_CONCAT(DISTINCT ?typeLabel; SEPARATOR = ", ") AS ?types) ?when ?wikipage (GROUP_CONCAT(DISTINCT ?personLabel; SEPARATOR = ", ") AS ?persons) (GROUP_CONCAT(DISTINCT ?mainsubjectLabel; SEPARATOR = ", ") AS ?topics)
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
WHERE
{
{
Line 38: Line 38:
OPTIONAL {?item wbt:P33 ?person} # speaker, eg in a presentation
OPTIONAL {?item wbt:P33 ?person} # speaker, eg in a presentation
OPTIONAL {?item wbt:P19 ?person} # author, eg of a video
OPTIONAL {?item wbt:P19 ?person} # author, eg of a video
OPTIONAL {?item wbt:P11 ?wikipage}
OPTIONAL {?item wbt:P15 ?mainsubject}
OPTIONAL {?item wbt:P15 ?mainsubject}
   SERVICE wikibase:label {
   SERVICE wikibase:label {
Line 48: Line 47:
   }
   }
}
}
GROUP BY ?item ?itemLabel ?types ?when ?wikipage
GROUP BY ?item ?itemLabel ?types ?when
ORDER BY ?itemLabel
ORDER BY ?itemLabel
</SPARQL>
</SPARQL>


[[Category:Documentation|C]]
[[Category:Documentation|C]]

Revision as of 08:28, 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 
WHERE
{
?item wbt:P5/wbt:P4* wb:Q42 .
OPTIONAL {?item wbt:P23 ?when}
OPTIONAL {?item wbt:P27 ?where}
SERVICE wikibase:label { bd:serviceParam wikibase:language "sv,en". }
}

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!