User:Alicia Fagerving (WMSE)/Sandbox: Difference between revisions

From MetaBase
Jump to navigation Jump to search
No edit summary
Tag: Reverted
No edit summary
Tag: Reverted
Line 85: Line 85:
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 ?when (GROUP_CONCAT(DISTINCT ?speakerLabel; SEPARATOR = ", ") AS ?speakers)
SELECT ?item ?itemLabel ?when ?wikipage (GROUP_CONCAT(DISTINCT ?speakerLabel; SEPARATOR = ", ") AS ?speakers)
WHERE
WHERE
{
{
Line 91: Line 91:
OPTIONAL {?item wbt:P23 ?when}
OPTIONAL {?item wbt:P23 ?when}
OPTIONAL {?item wbt:P33 ?speaker}
OPTIONAL {?item wbt:P33 ?speaker}
OPTIONAL {?item wbt:P11 ?wikipage}
   SERVICE wikibase:label {
   SERVICE wikibase:label {
     bd:serviceParam wikibase:language "en,sv,es".
     bd:serviceParam wikibase:language "en,sv,es".
Line 97: Line 98:
   }
   }
}
}
GROUP BY ?item ?itemLabel ?when
GROUP BY ?item ?itemLabel ?when ?wikipage
ORDER BY ?when
ORDER BY ?when
</SPARQL>
</SPARQL>

Revision as of 09:25, 27 March 2024










PREFIX wb: <https://metabase.wikibase.cloud/entity/>
PREFIX wbt: <https://metabase.wikibase.cloud/prop/direct/>
SELECT ?item ?itemLabel ?when ?wikipage (GROUP_CONCAT(DISTINCT ?speakerLabel; SEPARATOR = ", ") AS ?speakers)
WHERE
{
?item wbt:P17 wb:Q22660.
OPTIONAL {?item wbt:P23 ?when}
OPTIONAL {?item wbt:P33 ?speaker}
OPTIONAL {?item wbt:P11 ?wikipage}
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "en,sv,es".
    ?item rdfs:label ?itemLabel.
    ?speaker rdfs:label ?speakerLabel.
  }
}
GROUP BY ?item ?itemLabel ?when ?wikipage
ORDER BY ?when

Try it!