Datamodel: verschil tussen versies

Uit Knowledge Graph Kunstenpunt
Ga naar:navigatie, zoeken
Regel 59: Regel 59:
  GROUP BY ?creditA ?creditALabel ?creditB ?creditBLabel
  GROUP BY ?creditA ?creditALabel ?creditB ?creditBLabel
  HAVING (?werkCount >= 10)
  HAVING (?werkCount >= 10)
[https://kg.kunsten.be/query//#%23defaultView%3AGraph%0APREFIX%20kp%3A%3Chttps%3A%2F%2Fkg.kunsten.be%2Fentity%2F%3E%20PREFIX%20kpt%3A%3Chttps%3A%2F%2Fkg.kunsten.be%2Fprop%2Fdirect%2F%3E%20PREFIX%20kpp%3A%3Chttps%3A%2F%2Fkg.kunsten.be%2Fprop%2F%3E%20PREFIX%20kppq%3A%3Chttps%3A%2F%2Fkg.kunsten.be%2Fprop%2Fqualifier%2F%3E%20PREFIX%20kpps%3A%3Chttps%3A%2F%2Fkg.kunsten.be%2Fprop%2Fstatement%2F%3E%20PREFIX%20xsd%3A%20%3Chttp%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema%23%3E%20SELECT%20DISTINCT%20%3FcreditA%20%3FcreditALabel%20%28COUNT%28%3Fwerk%29%20AS%20%3FwerkCount%29%20%3FcreditB%20%3FcreditBLabel%20WHERE%20%7B%20%3Fwerk%20kpt%3AP17%20%3Fbegindatum.%20FILTER%20%28%3Fbegindatum%20%3E%3D%20%221980-01-01T00%3A00%3A0%2B00%3A00%22%5E%5Exsd%3AdateTime%20%26%26%20%3Fbegindatum%20%3C%20%222000-01-01T00%3A00%3A00%2B00%3A00%22%5E%5Exsd%3AdateTime%29%20%3Fwerk%20kpt%3AP8%20%3Fdiscipline.%20FILTER%28%3Fdiscipline%20IN%20%28kp%3AQ68584%2Ckp%3AQ68551%2Ckp%3AQ68559%2Ckp%3AQ68558%2Ckp%3AQ68571%2Ckp%3AQ68586%2Ckp%3AQ68597%2Ckp%3AQ68613%2Ckp%3AQ68626%2Ckp%3AQ68630%2Ckp%3AQ68635%2Ckp%3AQ68641%2Ckp%3AQ68652%2Ckp%3AQ68687%2Ckp%3AQ68713%2Ckp%3AQ68716%2Ckp%3AQ68726%2Ckp%3AQ68756%2Ckp%3AQ68763%2Ckp%3AQ68779%2Ckp%3AQ68786%2Ckp%3AQ68790%29%29%20%3Factiviteit%20kpt%3AP4%20%3Fwerk.%20%3Factiviteit%20kpp%3AP42%20%3FstatementA.%20%3FstatementA%20kppq%3AP15%20%3FroleA.%20FILTER%28%3FroleA%20IN%20%28kp%3AQ69028%2Ckp%3AQ69752%2Ckp%3AQ69029%2Ckp%3AQ69030%2Ckp%3AQ68959%2Ckp%3AQ69051%2Ckp%3AQ69052%2Ckp%3AQ69053%2Ckp%3AQ69068%2Ckp%3AQ69069%2Ckp%3AQ69070%2Ckp%3AQ69071%2Ckp%3AQ69135%2Ckp%3AQ69136%2Ckp%3AQ69360%2Ckp%3AQ68983%2Ckp%3AQ68984%2Ckp%3AQ69080%2Ckp%3AQ69081%2Ckp%3AQ69083%2Ckp%3AQ69084%2Ckp%3AQ69289%2Ckp%3AQ69536%2Ckp%3AQ69537%2Ckp%3AQ69436%2Ckp%3AQ69437%2Ckp%3AQ69438%2Ckp%3AQ69439%2Ckp%3AQ69534%2Ckp%3AQ69006%2Ckp%3AQ69007%2Ckp%3AQ69008%2Ckp%3AQ69036%2Ckp%3AQ69037%2Ckp%3AQ69291%2Ckp%3AQ69292%2Ckp%3AQ69479%2Ckp%3AQ69480%2Ckp%3AQ69481%2Ckp%3AQ69482%2Ckp%3AQ69252%29%29%20%3FstatementA%20kpps%3AP42%20%3FcreditA.%20%3Factiviteit%20kpp%3AP42%20%3FstatementB.%20%3FstatementB%20kppq%3AP15%20%3FroleB.%20FILTER%28%3FroleB%20IN%20%28kp%3AQ69028%2Ckp%3AQ69752%2Ckp%3AQ69029%2Ckp%3AQ69030%2Ckp%3AQ68959%2Ckp%3AQ69051%2Ckp%3AQ69052%2Ckp%3AQ69053%2Ckp%3AQ69068%2Ckp%3AQ69069%2Ckp%3AQ69070%2Ckp%3AQ69071%2Ckp%3AQ69135%2Ckp%3AQ69136%2Ckp%3AQ69360%2Ckp%3AQ68983%2Ckp%3AQ68984%2Ckp%3AQ69080%2Ckp%3AQ69081%2Ckp%3AQ69083%2Ckp%3AQ69084%2Ckp%3AQ69289%2Ckp%3AQ69536%2Ckp%3AQ69537%2Ckp%3AQ69436%2Ckp%3AQ69437%2Ckp%3AQ69438%2Ckp%3AQ69439%2Ckp%3AQ69534%2Ckp%3AQ69006%2Ckp%3AQ69007%2Ckp%3AQ69008%2Ckp%3AQ69036%2Ckp%3AQ69037%2Ckp%3AQ69291%2Ckp%3AQ69292%2Ckp%3AQ69479%2Ckp%3AQ69480%2Ckp%3AQ69481%2Ckp%3AQ69482%2Ckp%3AQ69252%29%29%20%3FstatementB%20kpps%3AP42%20%3FcreditB.%20FILTER%28%3FcreditA%20%21%3D%20%3FcreditB%29%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22%5BAUTO_LANGUAGE%5D%2Cnl%2Cen%22%20.%20%7D%20%7D%20GROUP%20BY%20%3FcreditA%20%3FcreditALabel%20%3FcreditB%20%3FcreditBLabel%20HAVING%20%28%3FwerkCount%20%3E%3D%2010%29 Link naar deze query]


=== Releases en hun contributors ===
=== Releases en hun contributors ===
Regel 64: Regel 65:
  PREFIX kp:<<nowiki>https://kg.kunsten.be/entity/</nowiki>>
  PREFIX kp:<<nowiki>https://kg.kunsten.be/entity/</nowiki>>
  PREFIX kpp:<<nowiki>https://kg.kunsten.be/prop/direct/</nowiki><nowiki>>
  PREFIX kpp:<<nowiki>https://kg.kunsten.be/prop/direct/</nowiki><nowiki>>
            SELECT DISTINCT ?release ?releaseLabel ?contributor ?contributorLabel  
            SELECT DISTINCT ?release ?releaseLabel ?contributor ?contributorLabel  
            WHERE {
            WHERE {
            ?release kpp:P13 kp:Q58532.
            ?release kpp:P13 kp:Q58532.
            ?release kpp:P8 kp:Q68897.
            ?release kpp:P8 kp:Q68897.
            ?track kpp:P43 ?release.
            ?track kpp:P43 ?release.
            ?track kpp:P4 ?work.
            ?track kpp:P4 ?work.
            {?release kpp:P42 ?contributor. } UNION { { ?track kpp:P42 ?contributor. } UNION { ?work kpp:P42 ?contributor. } }
            {?release kpp:P42 ?contributor. } UNION { { ?track kpp:P42 ?contributor. } UNION { ?work kpp:P42 ?contributor. } }
            SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],nl,en" . }}
            SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],nl,en" . }}
            ORDER BY ASC(?releaseLabel)</nowiki>
            ORDER BY ASC(?releaseLabel)</nowiki>


=== Bands die samen concerten brachten ===
=== Bands die samen concerten brachten ===
Regel 92: Regel 93:
     SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],nl,en" . }
     SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],nl,en" . }
   }
   }
[https://kg.kunsten.be/query//#%23defaultView%3AGraph%0APREFIX%20kp%3A%3Chttps%3A%2F%2Fkg.kunsten.be%2Fentity%2F%3E%20PREFIX%20kpt%3A%3Chttps%3A%2F%2Fkg.kunsten.be%2Fprop%2Fdirect%2F%3E%20PREFIX%20kpp%3A%3Chttps%3A%2F%2Fkg.kunsten.be%2Fprop%2F%3E%20PREFIX%20kppq%3A%3Chttps%3A%2F%2Fkg.kunsten.be%2Fprop%2Fqualifier%2F%3E%20PREFIX%20kpps%3A%3Chttps%3A%2F%2Fkg.kunsten.be%2Fprop%2Fstatement%2F%3E%20PREFIX%20xsd%3A%20%3Chttp%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema%23%3E%20SELECT%20DISTINCT%20%3FbandA%20%3FbandALabel%20%3FbandB%20%3FbandBLabel%20WHERE%20%7B%20%3Factiviteit%20kpt%3AP13%20kp%3AQ58533.%20%3Factiviteit%20kpt%3AP42%20kp%3AQ601279.%20%3Factiviteit%20kpt%3AP42%20%3FbandA.%20%3Factiviteit%20kpt%3AP42%20%3FbandB.%20FILTER%28%3FbandA%20%21%3D%20%3FbandB%29%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22%5BAUTO_LANGUAGE%5D%2Cnl%2Cen%22%20.%20%7D%20%7D Link naar deze query]


== Federated queries ==
== Federated queries ==
Regel 110: Regel 112:
   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],nl,en" . }
   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],nl,en" . }
  }
  }
[https://kg.kunsten.be/query//#PREFIX%20kp%3A%3Chttps%3A%2F%2Fkg.kunsten.be%2Fentity%2F%3E%0APREFIX%20kpp%3A%3Chttps%3A%2F%2Fkg.kunsten.be%2Fprop%2Fdirect%2F%3E%0APREFIX%20wd%3A%20%3Chttp%3A%2F%2Fwww.wikidata.org%2Fentity%2F%3E%0APREFIX%20wdt%3A%20%3Chttp%3A%2F%2Fwww.wikidata.org%2Fprop%2Fdirect%2F%3E%0ASELECT%20DISTINCT%20%3Fagent%20%3FagentLabel%20%3Fwikidata%20%3Fgps%0AWHERE%20%7B%0A%20%20%3Fagent%20kpp%3AP41%20kp%3AQ157598.%20%23%20entities%20that%20are%20of%20type%20museum%20for%20contemporary%20art%20in%20flanders%0A%20%20%3Fagent%20kpp%3AP75%20%3Fwikidata.%0A%20%20BIND%28URI%28CONCAT%28STR%28wd%3A%29%2C%20%3Fwikidata%29%29%20AS%20%3Fwd%29%0A%20%20SERVICE%20%3Chttps%3A%2F%2Fquery.wikidata.org%2Fsparql%3E%20%7B%0A%20%20%20%20%3Fwd%20wdt%3AP625%20%3Fgps.%0A%20%20%7D%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22%5BAUTO_LANGUAGE%5D%2Cnl%2Cen%22%20.%20%7D%0A%7D Link naar deze query]

Versie van 13 okt 2024 08:29

We maken gebruik van de standaard op https://data.vlaanderen.be/doc/applicatieprofiel/cultuurparticipatie/ Die standaard definieert een aantal concepten, eigenschappen en relaties. Die aspecten van de standaard kunnen we implementeren in deze knowledge graph aan de hand van kernitems en -properties.

Versie van de standaard Cultuurparticipatie (oktober 2023) ter illustratie.

Kernitems en -properties

In elk data model is het van belang om de entiteiten te definiëren, en te weten welke relaties er tussen die entiteiten moeten kunnen gelegd worden. De entiteiten zijn Activiteiten (residenties, tentoonstellingen, podiumvoorstellingen, concerten, muziekreleases, ...), maar ook Agenten (uitvoerders en organisatoren). Dat gaat dan bijvoorbeeld om makers, kunstenaars, muzikanten, artiesten, concertzalen, kunstgaleries, theaterzalen, repetitieruimtes, etc. Au fond zijn het allemaal "actoren" in dat veld, die "activiteiten" ontplooien.

De oplijsting hieronder is abstract. Bekijk de pagina's modellering van actoren en modellering van activiteiten om dit concreet te maken.

In de kern van het data model zitten een beperkt aantal "core items" (objecten of types van objecten, bv. "Activiteit" en "ActiviteitType") en "core properties" (relaties tussen items, bv. "gebruikt werk" en "gebracht door"). Je krijgt een overzicht van die kernitems en kernproperties:

Hoe voer ik een XXXXX in?

Het datamodel wordt uitgelegd op de pagina's modellering van actoren en modellering van activiteiten, maar dat blijft natuurlijk relatief abstract. Om het wat concreet te maken, bieden we ook een aantal concrete voorbeelden aan:


En dan wat complexer:

Hoe ziet de data eruit?

Invoeren is 1 zaak, maar hoe haal je het er weer uit? Hieronder enkele voorbeelden.

Dansers en choreografen

Welke dansers en choreografen enzo werkten tussen 1980 en 2000 samen aan meer dan 10 verschillende werken?

PREFIX kp:<https://kg.kunsten.be/entity/>
PREFIX kpt:<https://kg.kunsten.be/prop/direct/>
PREFIX kpp:<https://kg.kunsten.be/prop/>
PREFIX kppq:<https://kg.kunsten.be/prop/qualifier/>
PREFIX kpps:<https://kg.kunsten.be/prop/statement/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT DISTINCT ?creditA ?creditALabel (COUNT(?werk) AS ?werkCount) ?creditB ?creditBLabel
WHERE
{
?werk kpt:P17 ?begindatum.
FILTER (?begindatum >= "1980-01-01T00:00:0+00:00"^^xsd:dateTime && ?begindatum < "2000-01-01T00:00:00+00:00"^^xsd:dateTime)
?werk kpt:P8 ?discipline.
FILTER(?discipline IN (kp:Q68584,kp:Q68551,kp:Q68559,kp:Q68558,kp:Q68571,kp:Q68586,kp:Q68597,kp:Q68613,kp:Q68626,kp:Q68630,kp:Q68635,kp:Q68641,kp:Q68652,kp:Q68687,kp:Q68713,kp:Q68716,kp:Q68726,kp:Q68756,kp:Q68763,kp:Q68779,kp:Q68786,kp:Q68790))
?activiteit kpt:P4 ?werk.
?activiteit kpp:P42 ?statementA.
?statementA kppq:P15 ?roleA.
FILTER(?roleA IN (kp:Q69028,kp:Q69752,kp:Q69029,kp:Q69030,kp:Q68959,kp:Q69051,kp:Q69052,kp:Q69053,kp:Q69068,kp:Q69069,kp:Q69070,kp:Q69071,kp:Q69135,kp:Q69136,kp:Q69360,kp:Q68983,kp:Q68984,kp:Q69080,kp:Q69081,kp:Q69083,kp:Q69084,kp:Q69289,kp:Q69536,kp:Q69537,kp:Q69436,kp:Q69437,kp:Q69438,kp:Q69439,kp:Q69534,kp:Q69006,kp:Q69007,kp:Q69008,kp:Q69036,kp:Q69037,kp:Q69291,kp:Q69292,kp:Q69479,kp:Q69480,kp:Q69481,kp:Q69482,kp:Q69252))
?statementA kpps:P42 ?creditA.
?activiteit kpp:P42 ?statementB.
?statementB kppq:P15 ?roleB.
FILTER(?roleB IN (kp:Q69028,kp:Q69752,kp:Q69029,kp:Q69030,kp:Q68959,kp:Q69051,kp:Q69052,kp:Q69053,kp:Q69068,kp:Q69069,kp:Q69070,kp:Q69071,kp:Q69135,kp:Q69136,kp:Q69360,kp:Q68983,kp:Q68984,kp:Q69080,kp:Q69081,kp:Q69083,kp:Q69084,kp:Q69289,kp:Q69536,kp:Q69537,kp:Q69436,kp:Q69437,kp:Q69438,kp:Q69439,kp:Q69534,kp:Q69006,kp:Q69007,kp:Q69008,kp:Q69036,kp:Q69037,kp:Q69291,kp:Q69292,kp:Q69479,kp:Q69480,kp:Q69481,kp:Q69482,kp:Q69252))
?statementB kpps:P42 ?creditB.
FILTER(?creditA != ?creditB)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],nl,en" . }
}
GROUP BY ?creditA ?creditALabel ?creditB ?creditBLabel
HAVING (?werkCount >= 10)

Link naar deze query

Releases en hun contributors

Een overzicht van jazz/folk/wereldmuziek albums in de databank, met de contributors:

PREFIX kp:<https://kg.kunsten.be/entity/>
PREFIX kpp:<https://kg.kunsten.be/prop/direct/>
             SELECT DISTINCT ?release ?releaseLabel ?contributor ?contributorLabel 
             WHERE {
             ?release kpp:P13 kp:Q58532.
             ?release kpp:P8 kp:Q68897.
             ?track kpp:P43 ?release.
             ?track kpp:P4 ?work.
             {?release kpp:P42 ?contributor. } UNION { { ?track kpp:P42 ?contributor. } UNION { ?work kpp:P42 ?contributor. } }
             SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],nl,en" . }}
             ORDER BY ASC(?releaseLabel)

Bands die samen concerten brachten

Hier bv. vanuit het perspectief van Ulrikes Dream:

PREFIX kp:<https://kg.kunsten.be/entity/>
PREFIX kpt:<https://kg.kunsten.be/prop/direct/>
PREFIX kpp:<https://kg.kunsten.be/prop/>
PREFIX kppq:<https://kg.kunsten.be/prop/qualifier/>
PREFIX kpps:<https://kg.kunsten.be/prop/statement/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
  SELECT DISTINCT ?bandA ?bandALabel ?bandB ?bandBLabel
  WHERE
  {
    ?activiteit kpt:P13 kp:Q58533.
    ?activiteit kpt:P42 kp:Q601279.
    ?activiteit kpt:P42 ?bandA.
    ?activiteit kpt:P42 ?bandB.
    FILTER(?bandA != ?bandB)
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],nl,en" . }
  }

Link naar deze query

Federated queries

Federated query to get GPS for musea in Flanders

PREFIX kp:<https://kg.kunsten.be/entity/>
PREFIX kpp:<https://kg.kunsten.be/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT DISTINCT ?agent ?agentLabel ?wikidata ?gps
WHERE {
  ?agent kpp:P41 kp:Q157598. # entities that are of type museum for contemporary art in flanders
  ?agent kpp:P75 ?wikidata.
  BIND(URI(CONCAT(STR(wd:), ?wikidata)) AS ?wd)
  SERVICE <https://query.wikidata.org/sparql> {
    ?wd wdt:P625 ?gps.
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],nl,en" . }
}

Link naar deze query