Project:SPARQL/examples: Difference between revisions

From Resistance in Belgium
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 2: Line 2:
<translate>
<translate>


== SPARQL Query Examples ==
== SPARQL Query Examples == <!--T:1-->


This page lists examples of SPARQL queries that allow for in-depth interrogation of the ''Resistance in Belgium'' [https://data.arch.be/wiki/Special:MyLanguage/In-depth_search see also this example page]. Each query can be executed by clicking on the "Try it!" link, which opens a dedicated query interface.
<!--T:2-->
This page lists examples of SPARQL queries that allow for in-depth interrogation of the ''Resistance in Belgium'' data ([https://data.arch.be/wiki/Special:MyLanguage/In-depth_search see also this example page]). Each query can be executed by clicking on the "Try it!" link, which opens a dedicated query interface.


'''Note''': Due to limited resources, the queries have been automatically translated into English, Dutch, and German. While there may be minor inaccuracies, we prioritised making these examples available in multiple languages to ensure broad access to the data for all users.
<!--T:3-->
'''Note''': For practical reasons, the queries have been automatically translated into English, Dutch, and German. While there may be minor inaccuracies, we prioritized making these examples available in multiple languages to ensure broad access to the data for all users.




==== Search for resistance members by family name ====
==== Search for resistance members by family name ==== <!--T:4-->


<!--T:5-->
{{SPARQL|query=
{{SPARQL|query=


<!--T:6-->
# This query has been automatically translated for pragmatic reasons and due to limited resources. Please be aware that some terms may not be fully accurate.
# This query has been automatically translated for pragmatic reasons and due to limited resources. Please be aware that some terms may not be fully accurate.


<!--T:7-->
# This query retrieves the list of people present in the database with a certain last name.
# This query retrieves the list of people present in the database with a certain last name.


<!--T:8-->
#title: Resistance fighters with a certain last name (here: Barbieux)
#title: Resistance fighters with a certain last name (here: Barbieux)


<!--T:9-->
SELECT ?person ?personLabel ?birthDate
SELECT ?person ?personLabel ?birthDate
WHERE {
WHERE {
Line 28: Line 35:
}
}


<!--T:10-->
ORDER BY ?personLabel  # Sorts the results alphabetically by label
ORDER BY ?personLabel  # Sorts the results alphabetically by label
}}
}}




====  Search for members of a resistance organisation ====
====  Search for members of a resistance organisation ==== <!--T:11-->




<!--T:12-->
{{SPARQL|query=
{{SPARQL|query=


<!--T:13-->
# This query has been automatically translated for pragmatic reasons and due to limited resources. Please be aware that some terms may not be fully accurate.
# This query has been automatically translated for pragmatic reasons and due to limited resources. Please be aware that some terms may not be fully accurate.


<!--T:14-->
# This query retrieves the list of people present in the database  
# This query retrieves the list of people present in the database  
# and known to be members of a certain resistance organisation (here: Tempo)
# and known to be members of a certain resistance organisation (here: Tempo)


<!--T:15-->
#title: Resistance fighters who are members of a resistance organisation (here: Tempo)
#title: Resistance fighters who are members of a resistance organisation (here: Tempo)


<!--T:16-->
SELECT  ?person ?surname ?firstName ?birthDate
SELECT  ?person ?surname ?firstName ?birthDate
WHERE {
WHERE {
Line 55: Line 68:
}
}


<!--T:17-->
ORDER BY LCASE(?surname) LCASE(?firstName)  # Sorts results by surname, then first name (case-insensitive)
ORDER BY LCASE(?surname) LCASE(?firstName)  # Sorts results by surname, then first name (case-insensitive)
}}
}}


==== Search by place of residence ====
==== Search by place of residence ==== <!--T:18-->


<!--T:19-->
{{SPARQL|query=
{{SPARQL|query=


<!--T:20-->
# This query has been automatically translated for pragmatic reasons and due to limited resources. Please be aware that some terms may not be fully accurate.
# This query has been automatically translated for pragmatic reasons and due to limited resources. Please be aware that some terms may not be fully accurate.


<!--T:21-->
# This query retrieves the list of people present in the database  
# This query retrieves the list of people present in the database  
# and residing in a certain municipality during/after World War II
# and residing in a certain municipality during/after World War II


<!--T:22-->
#title: Resistance fighters filtered by their residence (here: Anderlecht)
#title: Resistance fighters filtered by their residence (here: Anderlecht)


<!--T:23-->
SELECT ?person ?surname ?firstName ?birthDate
SELECT ?person ?surname ?firstName ?birthDate
WHERE {
WHERE {
Line 80: Line 99:
}
}


<!--T:24-->
ORDER BY LCASE(?surname) LCASE(?firstName)  # Sorts results by surname, then first name (case-insensitive)
ORDER BY LCASE(?surname) LCASE(?firstName)  # Sorts results by surname, then first name (case-insensitive)


<!--T:25-->
}}
}}


==== Search by profession ====
==== Search by profession ==== <!--T:26-->


<!--T:27-->
{{SPARQL|query=
{{SPARQL|query=


<!--T:28-->
# This query has been automatically translated for pragmatic reasons and due to limited resources. Please be aware that some terms may not be fully accurate.
# This query has been automatically translated for pragmatic reasons and due to limited resources. Please be aware that some terms may not be fully accurate.


<!--T:29-->
# This query retrieves the list of people present in the database who have a certain profession (here: hairdresser / kapper).
# This query retrieves the list of people present in the database who have a certain profession (here: hairdresser / kapper).


<!--T:30-->
#title: Resistance fighters with a certain profession (here: hairdresser / kapper)
#title: Resistance fighters with a certain profession (here: hairdresser / kapper)


<!--T:31-->
SELECT ?person ?surname ?firstName ?residenceLabel ?professionLabel
SELECT ?person ?surname ?firstName ?residenceLabel ?professionLabel
WHERE {
WHERE {
Line 104: Line 130:
                                                                                           # contains 'coiffeu' (hairdresser in French) or 'kapper' (in Dutch)
                                                                                           # contains 'coiffeu' (hairdresser in French) or 'kapper' (in Dutch)


  #FILTER (CONTAINS(str(?profession), 'coiffeu')). # If you want to use only one search term: remove the '#' at the start of the line and delete the previous line
  <!--T:32-->
#FILTER (CONTAINS(str(?profession), 'coiffeu')). # If you want to use only one search term: remove the '#' at the start of the line and delete the previous line
    
    
   OPTIONAL { ?person wdt:P7 ?residence. } # Also adds the residence (P7), if known
   OPTIONAL { ?person wdt:P7 ?residence. } # Also adds the residence (P7), if known
Line 111: Line 138:
}
}


<!--T:33-->
ORDER BY LCASE(?surname) LCASE(?firstName)  # Sorts the results by surname, then first name (case-insensitive)
ORDER BY LCASE(?surname) LCASE(?firstName)  # Sorts the results by surname, then first name (case-insensitive)
}}
}}




==== Number of members of a resistance organisation ====
==== Number of members of a resistance organisation ==== <!--T:34-->


<!--T:35-->
{{SPARQL|query=
{{SPARQL|query=
# This query has been automatically translated for pragmatic reasons and due to limited resources. Please be aware that some terms may not be fully accurate.
# This query has been automatically translated for pragmatic reasons and due to limited resources. Please be aware that some terms may not be fully accurate.


<!--T:36-->
# This query retrieves the number of members per resistance organisation and displays the results as a bubble chart.
# This query retrieves the number of members per resistance organisation and displays the results as a bubble chart.
# You can click on each bubble or organisation name to access more details about the organisation in the database.
# You can click on each bubble or organisation name to access more details about the organisation in the database.


<!--T:37-->
#title: Count of members per resistance organisation
#title: Count of members per resistance organisation


<!--T:38-->
#defaultView:BubbleChart  # Display as bubbles
#defaultView:BubbleChart  # Display as bubbles


<!--T:39-->
SELECT ?organisation ?organisationLabel (COUNT(?person) AS ?numberOfMembers)
SELECT ?organisation ?organisationLabel (COUNT(?person) AS ?numberOfMembers)
WHERE {
WHERE {
Line 132: Line 165:
   ?person wdt:P52 ?organisation .    # Filters by membership in an organisation ("member of", P52)
   ?person wdt:P52 ?organisation .    # Filters by membership in an organisation ("member of", P52)


   FILTER EXISTS {  
   <!--T:40-->
FILTER EXISTS {  
   ?organisation wdt:P1/wdt:P9* wd:Q4  # Checks if the organisation is (P1) / is a subclass (P9) of a resistance organisation (Q4)
   ?organisation wdt:P1/wdt:P9* wd:Q4  # Checks if the organisation is (P1) / is a subclass (P9) of a resistance organisation (Q4)
   }
   }
Line 139: Line 173:


    
    
   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }  # Retrieves the labels in English
   <!--T:41-->
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }  # Retrieves the labels in English
}
}
GROUP BY ?organisation ?organisationLabel
GROUP BY ?organisation ?organisationLabel
Line 145: Line 180:
}}
}}


====  Places of death during the war ====
====  Places of death during the war ==== <!--T:42-->


<!--T:43-->
{{SPARQL|query=
{{SPARQL|query=


<!--T:44-->
# This query has been automatically translated for pragmatic reasons and due to limited resources. Please be aware that some terms may not be fully accurate.
# This query has been automatically translated for pragmatic reasons and due to limited resources. Please be aware that some terms may not be fully accurate.


<!--T:45-->
# This query retrieves the places of death of resistance fighters up until the end of 1945  
# This query retrieves the places of death of resistance fighters up until the end of 1945  
# and displays them on a map with their names and, if available, the dates of death.
# and displays them on a map with their names and, if available, the dates of death.


<!--T:46-->
# Tip: You can click on the points on the map to view the names of the deceased individuals.
# Tip: You can click on the points on the map to view the names of the deceased individuals.
# Note: Foreign locations have been "modernised" to match the current data in the Geonames database.
# Note: Foreign locations have been "modernised" to match the current data in the Geonames database.


<!--T:47-->
#title: Places and dates of death during the war
#title: Places and dates of death during the war


<!--T:48-->
#defaultView:Map{"hide":"?GPS"}  # Display as a map, hide the GPS coordinates
#defaultView:Map{"hide":"?GPS"}  # Display as a map, hide the GPS coordinates


<!--T:49-->
SELECT ?person ?personLabel ?placeOfDeath ?placeOfDeathLabel ?GPS ?dateOfDeath
SELECT ?person ?personLabel ?placeOfDeath ?placeOfDeathLabel ?GPS ?dateOfDeath
WHERE {
WHERE {
Line 173: Line 215:
}
}


<!--T:50-->
ORDER BY ?placeOfDeathLabel
ORDER BY ?placeOfDeathLabel
}}
}}




====  List the women who have been detained ====
====  List the women who have been detained ==== <!--T:51-->


<!--T:52-->
{{SPARQL|query=
{{SPARQL|query=
# This query has been automatically translated for pragmatic reasons and due to limited resources. Please be aware that some terms may not be fully accurate.
# This query has been automatically translated for pragmatic reasons and due to limited resources. Please be aware that some terms may not be fully accurate.


<!--T:53-->
#title: Women resistance fighters who were detained
#title: Women resistance fighters who were detained
SELECT DISTINCT ?person ?surname ?firstName ?startOfDetention ?endOfDetention ?professionLabel ?recognitionStatusLabel
SELECT DISTINCT ?person ?surname ?firstName ?startOfDetention ?endOfDetention ?professionLabel ?recognitionStatusLabel
WHERE {
WHERE {


   ?person wdt:P1 wd:Q2 .                  # Selects persons (P1 = Q2)
   <!--T:54-->
?person wdt:P1 wd:Q2 .                  # Selects persons (P1 = Q2)
   ?person wdt:P4 wd:Q6 .                  # Filters to select women (P4 = female Q6)
   ?person wdt:P4 wd:Q6 .                  # Filters to select women (P4 = female Q6)
    
    
Line 195: Line 241:
   OPTIONAL { ?detention_statement pq:P25 ?endOfDetention. FILTER (datatype(?endOfDetention) = xsd:edtf ) }    # Retrieves the end of detention date if available (P25)
   OPTIONAL { ?detention_statement pq:P25 ?endOfDetention. FILTER (datatype(?endOfDetention) = xsd:edtf ) }    # Retrieves the end of detention date if available (P25)


   OPTIONAL { ?person wdt:P13 ?profession. }          # Retrieves the profession if available (P13)
   <!--T:55-->
OPTIONAL { ?person wdt:P13 ?profession. }          # Retrieves the profession if available (P13)
   OPTIONAL { ?person wdt:P55 ?recognitionStatus. }    # Retrieves the national recognition status if obtained (P55)
   OPTIONAL { ?person wdt:P55 ?recognitionStatus. }    # Retrieves the national recognition status if obtained (P55)


   ?person  wdt:P3 ?surname .            # Retrieves the surname (P3)
   <!--T:56-->
?person  wdt:P3 ?surname .            # Retrieves the surname (P3)
   ?person  wdt:P2 ?firstName .          # Retrieves the first name (P2)
   ?person  wdt:P2 ?firstName .          # Retrieves the first name (P2)
    
    
   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }  # Retrieves the labels in English
   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }  # Retrieves the labels in English


<!--T:57-->
}
}


<!--T:58-->
ORDER BY LCASE(?surname) LCASE(?firstName)  # Sorts case-insensitively
ORDER BY LCASE(?surname) LCASE(?firstName)  # Sorts case-insensitively
}}
}}




====  Recognised ARA/FFC Members or Letter of Appreciation Recipients ====
====  Recognised ARA/FFC Members or Letter of Appreciation Recipients ==== <!--T:59-->


<!--T:60-->
{{SPARQL|query=
{{SPARQL|query=
# This query has been automatically translated for pragmatic reasons and due to limited resources. Please be aware that some terms may not be fully accurate.
# This query has been automatically translated for pragmatic reasons and due to limited resources. Please be aware that some terms may not be fully accurate.


<!--T:61-->
# This query retrieves the list of resistance fighters recognised as intelligence and action agents (ARA)
# This query retrieves the list of resistance fighters recognised as intelligence and action agents (ARA)
# or who received a letter of thanks (LR) or FFC (Forces Françaises Combattantes) status, along with their residence and linked archive file.
# or who received a letter of thanks (LR) or FFC (Forces Françaises Combattantes) status, along with their residence and linked archive file.


<!--T:62-->
#title: ARA resistance fighters (recognised or letter of thanks) or FFC
#title: ARA resistance fighters (recognised or letter of thanks) or FFC


<!--T:63-->
SELECT DISTINCT ?person ?surname ?firstName ?residence ?residenceLabel ?recognisedStatusLabel ?LR ?archiveCollectionLabel ?inventoryNo WHERE {
SELECT DISTINCT ?person ?surname ?firstName ?residence ?residenceLabel ?recognisedStatusLabel ?LR ?archiveCollectionLabel ?inventoryNo WHERE {


   ?person wdt:P1 wd:Q2 .                    # Selects persons (P1 = Q2)
   <!--T:64-->
?person wdt:P1 wd:Q2 .                    # Selects persons (P1 = Q2)
   ?person  wdt:P3 ?surname .                # Retrieves the surname (P3)
   ?person  wdt:P3 ?surname .                # Retrieves the surname (P3)
   ?person  wdt:P2 ?firstName .              # Retrieves the first name (P2)
   ?person  wdt:P2 ?firstName .              # Retrieves the first name (P2)


   { ?person wdt:P55 ?recognisedStatus.  
   <!--T:65-->
{ ?person wdt:P55 ?recognisedStatus.  
     FILTER(?recognisedStatus IN (wd:Q17, wd:Q4487)) }  # Filters for recognised ARA statuses (Q17) or FFC (Q4487)
     FILTER(?recognisedStatus IN (wd:Q17, wd:Q4487)) }  # Filters for recognised ARA statuses (Q17) or FFC (Q4487)
   UNION                                            # OR
   UNION                                            # OR
Line 232: Line 288:
     BIND("letter of thanks ARA" AS ?LR)}
     BIND("letter of thanks ARA" AS ?LR)}


   OPTIONAL { ?person wdt:P7 ?residence. }        # Retrieves the residence if available (P7)
   <!--T:66-->
OPTIONAL { ?person wdt:P7 ?residence. }        # Retrieves the residence if available (P7)
   OPTIONAL { ?person p:P34 ?archive_statement .  
   OPTIONAL { ?person p:P34 ?archive_statement .  
             ?archive_statement ps:P34 ?archiveCollection ;
             ?archive_statement ps:P34 ?archiveCollection ;
Line 239: Line 296:
}
}


<!--T:67-->
ORDER BY LCASE(?surname) LCASE(?firstName)  # Sorts results by surname, then first name (case-insensitive)
ORDER BY LCASE(?surname) LCASE(?firstName)  # Sorts results by surname, then first name (case-insensitive)
LIMIT 100  # Limits the results to 100 to optimise performance. You can adjust or remove this limit as needed.
LIMIT 100  # Limits the results to 100 to optimise performance. You can adjust or remove this limit as needed.
Line 244: Line 302:




====  Enriching data on resistance members using external sources [federated query] ====
====  Enriching data on resistance members using external sources [federated query] ==== <!--T:68-->


<!--T:69-->
{{SPARQL|query=
{{SPARQL|query=
## This query has been automatically translated for pragmatic reasons and due to limited resources. Please be aware that some terms may not be fully accurate.
## This query has been automatically translated for pragmatic reasons and due to limited resources. Please be aware that some terms may not be fully accurate.


<!--T:70-->
# This query retrieves additional information about the resistance fighters in the database, thanks to Wikidata, including Wikipedia articles and external archives (ODIS, Biographie Nationale, VIAF, SNAC, etc.).
# This query retrieves additional information about the resistance fighters in the database, thanks to Wikidata, including Wikipedia articles and external archives (ODIS, Biographie Nationale, VIAF, SNAC, etc.).


<!--T:71-->
#title: Enrichment of resistance fighter data via Wikidata
#title: Enrichment of resistance fighter data via Wikidata


<!--T:72-->
PREFIX wd_wikidata: <http://www.wikidata.org/entity/>  # Prefix for Wikidata
PREFIX wd_wikidata: <http://www.wikidata.org/entity/>  # Prefix for Wikidata
PREFIX wdt_wikidata: <http://www.wikidata.org/prop/direct/>  # Prefix for Wikidata direct properties
PREFIX wdt_wikidata: <http://www.wikidata.org/prop/direct/>  # Prefix for Wikidata direct properties


<!--T:73-->
SELECT DISTINCT ?person ?surname ?firstName ?wikidata_ID ?article_en ?odisURL ?bioNationaleURL ?JusteURL ?maitronURL ?viafURL ?snacURL  
SELECT DISTINCT ?person ?surname ?firstName ?wikidata_ID ?article_en ?odisURL ?bioNationaleURL ?JusteURL ?maitronURL ?viafURL ?snacURL  
(GROUP_CONCAT(DISTINCT ?archivesLabel; SEPARATOR = ", ") AS ?archives)  # Concatenation of found archives
(GROUP_CONCAT(DISTINCT ?archivesLabel; SEPARATOR = ", ") AS ?archives)  # Concatenation of found archives


<!--T:74-->
WHERE {
WHERE {
   ?person wdt:P1 wd:Q2 .                  # Selects all persons (P1 = Q2)
   ?person wdt:P1 wd:Q2 .                  # Selects all persons (P1 = Q2)
Line 264: Line 328:
   ?person  wdt:P2 ?firstName .            # Retrieves the first name (P2)
   ?person  wdt:P2 ?firstName .            # Retrieves the first name (P2)


   ?person wdt:P15 ?wikidataIdentifier .  # Retrieves the Wikidata identifier (P15)
   <!--T:75-->
?person wdt:P15 ?wikidataIdentifier .  # Retrieves the Wikidata identifier (P15)


   # Generates a link to the corresponding Wikidata entity
   <!--T:76-->
# Generates a link to the corresponding Wikidata entity
   BIND(URI(CONCAT("http://www.wikidata.org/entity/", ?wikidataIdentifier)) AS ?wikidata_ID)
   BIND(URI(CONCAT("http://www.wikidata.org/entity/", ?wikidataIdentifier)) AS ?wikidata_ID)


   # Federated query to retrieve additional information from Wikidata
   <!--T:77-->
# Federated query to retrieve additional information from Wikidata
   SERVICE <https://query.wikidata.org/sparql> {
   SERVICE <https://query.wikidata.org/sparql> {
      
      
Line 313: Line 380:
   }
   }


   # Retrieves labels of persons in the defined language
   <!--T:78-->
# Retrieves labels of persons in the defined language
   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
}


<!--T:79-->
GROUP BY ?person ?surname ?firstName ?wikidata_ID ?article_en ?odisURL ?JusteURL ?bioNationaleURL ?maitronURL ?viafURL ?snacURL
GROUP BY ?person ?surname ?firstName ?wikidata_ID ?article_en ?odisURL ?JusteURL ?bioNationaleURL ?maitronURL ?viafURL ?snacURL


<!--T:80-->
ORDER BY LCASE(?surname) LCASE(?firstName)  # Sorts results by surname, then first name (case-insensitive)
ORDER BY LCASE(?surname) LCASE(?firstName)  # Sorts results by surname, then first name (case-insensitive)
}}
}}


</translate>
</translate>

Latest revision as of 12:49, 16 October 2024


SPARQL Query Examples

This page lists examples of SPARQL queries that allow for in-depth interrogation of the Resistance in Belgium data (see also this example page). Each query can be executed by clicking on the "Try it!" link, which opens a dedicated query interface.

Note: For practical reasons, the queries have been automatically translated into English, Dutch, and German. While there may be minor inaccuracies, we prioritized making these examples available in multiple languages to ensure broad access to the data for all users.


Search for resistance members by family name

# This query has been automatically translated for pragmatic reasons and due to limited resources. Please be aware that some terms may not be fully accurate.

# This query retrieves the list of people present in the database with a certain last name.

#title: Resistance fighters with a certain last name (here: Barbieux)

SELECT ?person ?personLabel ?birthDate
WHERE {
  ?person  wdt:P1  wd:Q2 .                    # Selects all elements thaat are (P1) persons (Q2)
  ?person  wdt:P3  "Barbieux" .               # Filters to take only persons whose last name (P3) is "Barbieux" (modify "Barbieux" as needed)
  ?person  wdt:P67 ?birthDate  .              # Adds the birth date (P67)
           
 SERVICE wikibase:label { bd:serviceParam wikibase:language "en,[AUTO_LANGUAGE]". }  # Retrieves the label in English
}

ORDER BY ?personLabel  # Sorts the results alphabetically by label

Try it!


Search for members of a resistance organisation

# This query has been automatically translated for pragmatic reasons and due to limited resources. Please be aware that some terms may not be fully accurate.

# This query retrieves the list of people present in the database 
# and known to be members of a certain resistance organisation (here: Tempo)

#title: Resistance fighters who are members of a resistance organisation (here: Tempo)

SELECT  ?person ?surname ?firstName ?birthDate
WHERE {
  ?person  wdt:P1  wd:Q2 .                   # Selects all elements that are (P1) persons (Q2)
  ?person wdt:P52 wd:Q4367 .                 # Filters by membership in an organisation ("member of", P52), here "Tempo" (Q4367) (replace Q4367 with the organisation of your choice using autocomplete (Control + space))
  ?person  wdt:P67 ?birthDate  .             # Adds the birth date (P67)
  ?person  wdt:P3 ?surname .                 # Retrieves the surname (P3)
  ?person  wdt:P2 ?firstName .               # Retrieves the first name (P2)
          
 SERVICE wikibase:label { bd:serviceParam wikibase:language "en,[AUTO_LANGUAGE]". }  # Retrieves the label in English
}

ORDER BY LCASE(?surname) LCASE(?firstName)  # Sorts results by surname, then first name (case-insensitive)

Try it!

Search by place of residence

# This query has been automatically translated for pragmatic reasons and due to limited resources. Please be aware that some terms may not be fully accurate.

# This query retrieves the list of people present in the database 
# and residing in a certain municipality during/after World War II

#title: Resistance fighters filtered by their residence (here: Anderlecht)

SELECT ?person ?surname ?firstName ?birthDate
WHERE {
  ?person  wdt:P1  wd:Q2 .                   # Selects all elements that are (P1) persons (Q2)
  ?person  wdt:P7  wd:Q102 .                 # Filters by residence (P7), here Anderlecht (Q102) (replace Q102 with the (section of) municipality of your choice using autocomplete (Control + space))
  ?person  wdt:P67 ?birthDate  .             # Adds the birth date (P67)
  ?person  wdt:P3 ?surname .                 # Retrieves the surname (P3)
  ?person  wdt:P2 ?firstName .               # Retrieves the first name (P2)
         
 SERVICE wikibase:label { bd:serviceParam wikibase:language "en,[AUTO_LANGUAGE]". }  # Retrieves the label in English
}

ORDER BY LCASE(?surname) LCASE(?firstName)  # Sorts results by surname, then first name (case-insensitive)

Try it!

Search by profession

# This query has been automatically translated for pragmatic reasons and due to limited resources. Please be aware that some terms may not be fully accurate.

# This query retrieves the list of people present in the database who have a certain profession (here: hairdresser / kapper).

#title: Resistance fighters with a certain profession (here: hairdresser / kapper)

SELECT ?person ?surname ?firstName ?residenceLabel ?professionLabel
WHERE {
  ?person  wdt:P1  wd:Q2 .               # Selects all people (P1) with the identifier "Person" (Q2)
  ?person  wdt:P13 ?profession .         # Selects their profession (P13)
  ?person  wdt:P3 ?surname .             # Retrieves the surname (P3)
  ?person  wdt:P2 ?firstName .           # Retrieves the first name (P2)
  
  FILTER (CONTAINS(str(?profession), 'coiffeu')

Try it!


Number of members of a resistance organisation

# This query has been automatically translated for pragmatic reasons and due to limited resources. Please be aware that some terms may not be fully accurate.

# This query retrieves the number of members per resistance organisation and displays the results as a bubble chart.
# You can click on each bubble or organisation name to access more details about the organisation in the database.

#title: Count of members per resistance organisation

#defaultView:BubbleChart  # Display as bubbles

SELECT ?organisation ?organisationLabel (COUNT(?person) AS ?numberOfMembers)
WHERE {
  ?person wdt:P1 wd:Q2 .              # Selects all elements that are (P1) persons (Q2)
  ?person wdt:P52 ?organisation .     # Filters by membership in an organisation ("member of", P52)

  FILTER EXISTS { 
   ?organisation wdt:P1/wdt:P9* wd:Q4  # Checks if the organisation is (P1) / is a subclass (P9) of a resistance organisation (Q4)
   }
   # To filter and display only resistance networks/missions, replace Q4 with Q38.
   # To filter and display only armed resistance movements, replace Q4 with Q37.

  
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }  # Retrieves the labels in English
}
GROUP BY ?organisation ?organisationLabel
ORDER BY DESC(?numberOfMembers)

Try it!

Places of death during the war

# This query has been automatically translated for pragmatic reasons and due to limited resources. Please be aware that some terms may not be fully accurate.

# This query retrieves the places of death of resistance fighters up until the end of 1945 
# and displays them on a map with their names and, if available, the dates of death.

# Tip: You can click on the points on the map to view the names of the deceased individuals.
# Note: Foreign locations have been "modernised" to match the current data in the Geonames database.

#title: Places and dates of death during the war

#defaultView:Map{"hide":"?GPS"}  # Display as a map, hide the GPS coordinates

SELECT ?person ?personLabel ?placeOfDeath ?placeOfDeathLabel ?GPS ?dateOfDeath
WHERE {
  ?person wdt:P1 wd:Q2 .                      # Selects all people (P1 = Q2)
  ?person wdt:P48 ?placeOfDeath .             # Retrieves the places of death (P48)
  ?placeOfDeath wdt:P6 ?GPS .                 # Retrieves the GPS coordinates of the places of death (P6)
  OPTIONAL { ?person wdt:P68 ?dateOfDeath .   # Retrieves the date of death, if available
             FILTER(?dateOfDeath <= "1945-12-31"^^xsd:dateTime)  # Filters deaths: up until the end of 1945
  }
  
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en,[AUTO_LANGUAGE]". }  # Retrieves the labels in English
}

ORDER BY ?placeOfDeathLabel

Try it!


List the women who have been detained

# This query has been automatically translated for pragmatic reasons and due to limited resources. Please be aware that some terms may not be fully accurate.

#title: Women resistance fighters who were detained
SELECT DISTINCT ?person ?surname ?firstName ?startOfDetention ?endOfDetention ?professionLabel ?recognitionStatusLabel
WHERE {

  ?person wdt:P1 wd:Q2 .                   # Selects persons (P1 = Q2)
  ?person wdt:P4 wd:Q6 .                   # Filters to select women (P4 = female Q6)
  
  ?person p:P53 ?detention_statement .     # Searches for persons who were detained (P53)
  ?detention_statement ps:P53 ?detention .
           
  OPTIONAL { ?detention_statement pq:P23 ?startOfDetention. FILTER (datatype(?startOfDetention) = xsd:edtf ) } # Retrieves the start of detention date if available (P23)
  OPTIONAL { ?detention_statement pq:P25 ?endOfDetention. FILTER (datatype(?endOfDetention) = xsd:edtf ) }     # Retrieves the end of detention date if available (P25)

  OPTIONAL { ?person wdt:P13 ?profession. }           # Retrieves the profession if available (P13)
  OPTIONAL { ?person wdt:P55 ?recognitionStatus. }    # Retrieves the national recognition status if obtained (P55)

  ?person  wdt:P3 ?surname .             # Retrieves the surname (P3)
  ?person  wdt:P2 ?firstName .           # Retrieves the first name (P2)
  
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }  # Retrieves the labels in English

}

ORDER BY LCASE(?surname) LCASE(?firstName)  # Sorts case-insensitively

Try it!


Recognised ARA/FFC Members or Letter of Appreciation Recipients

# This query has been automatically translated for pragmatic reasons and due to limited resources. Please be aware that some terms may not be fully accurate.

# This query retrieves the list of resistance fighters recognised as intelligence and action agents (ARA)
# or who received a letter of thanks (LR) or FFC (Forces Françaises Combattantes) status, along with their residence and linked archive file.

#title: ARA resistance fighters (recognised or letter of thanks) or FFC

SELECT DISTINCT ?person ?surname ?firstName ?residence ?residenceLabel ?recognisedStatusLabel ?LR ?archiveCollectionLabel ?inventoryNo WHERE {

  ?person wdt:P1 wd:Q2 .                    # Selects persons (P1 = Q2)
  ?person  wdt:P3 ?surname .                # Retrieves the surname (P3)
  ?person  wdt:P2 ?firstName .              # Retrieves the first name (P2)

  { ?person wdt:P55 ?recognisedStatus. 
    FILTER(?recognisedStatus IN (wd:Q17, wd:Q4487)) }  # Filters for recognised ARA statuses (Q17) or FFC (Q4487)
  UNION                                            # OR
  { ?person p:P54 ?statement.
    ?statement ps:P54 wd:Q17; pq:P56 wd:Q6665.     # Persons who received a letter of thanks (Q6665)
    BIND("letter of thanks ARA" AS ?LR)}

  OPTIONAL { ?person wdt:P7 ?residence. }         # Retrieves the residence if available (P7)
  OPTIONAL { ?person p:P34 ?archive_statement . 
             ?archive_statement ps:P34 ?archiveCollection ;
                                pq:P35 ?inventoryNo.}  # Reference to the archives
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en,[AUTO_LANGUAGE]". }  # Retrieves the labels in English
}

ORDER BY LCASE(?surname) LCASE(?firstName)  # Sorts results by surname, then first name (case-insensitive)
LIMIT 100  # Limits the results to 100 to optimise performance. You can adjust or remove this limit as needed.

Try it!


Enriching data on resistance members using external sources [federated query]

## This query has been automatically translated for pragmatic reasons and due to limited resources. Please be aware that some terms may not be fully accurate.

# This query retrieves additional information about the resistance fighters in the database, thanks to Wikidata, including Wikipedia articles and external archives (ODIS, Biographie Nationale, VIAF, SNAC, etc.).

#title: Enrichment of resistance fighter data via Wikidata

PREFIX wd_wikidata: <http://www.wikidata.org/entity/>  # Prefix for Wikidata
PREFIX wdt_wikidata: <http://www.wikidata.org/prop/direct/>  # Prefix for Wikidata direct properties

SELECT DISTINCT ?person ?surname ?firstName ?wikidata_ID ?article_en ?odisURL ?bioNationaleURL ?JusteURL ?maitronURL ?viafURL ?snacURL 
(GROUP_CONCAT(DISTINCT ?archivesLabel; SEPARATOR = ", ") AS ?archives)  # Concatenation of found archives

WHERE {
  ?person wdt:P1 wd:Q2 .                  # Selects all persons (P1 = Q2)
  ?person  wdt:P3 ?surname .              # Retrieves the surname (P3)
  ?person  wdt:P2 ?firstName .            # Retrieves the first name (P2)

  ?person wdt:P15 ?wikidataIdentifier .   # Retrieves the Wikidata identifier (P15)

  # Generates a link to the corresponding Wikidata entity
  BIND(URI(CONCAT("http://www.wikidata.org/entity/", ?wikidataIdentifier)) AS ?wikidata_ID)

  # Federated query to retrieve additional information from Wikidata
  SERVICE <https://query.wikidata.org/sparql> {
    
    # Retrieves and generates the URLs of external identifiers
    OPTIONAL { 
      ?wikidata_ID wdt_wikidata:P2372 ?odisID.  # Retrieves the ODIS ID
      BIND(URI(CONCAT("https://www.odis.be/lnk/", STR(?odisID))) AS ?odisURL)  # Generates the ODIS URL
    }
    OPTIONAL { 
      ?wikidata_ID wdt_wikidata:P6234 ?bioNationaleID.  # Biographie Nationale of Belgium ID
      BIND(URI(CONCAT("https://academieroyale.be/fr/la-biographie-nationale-personnalites-detail/personnalites/", STR(?bioNationaleID), "/Vrai/")) AS ?bioNationaleURL)  # Generates the Biographie Nationale URL
    }
    OPTIONAL { 
      ?wikidata_ID wdt_wikidata:P214 ?viafID.  # VIAF ID
      BIND(URI(CONCAT("https://viaf.org/viaf/", STR(?viafID))) AS ?viafURL)  # Generates the VIAF URL
    }
    OPTIONAL { 
      ?wikidata_ID wdt_wikidata:P3430 ?snacID.  # SNAC ID
      BIND(URI(CONCAT("https://snaccooperative.org/ark:/99166/", STR(?snacID))) AS ?snacURL)  # Generates the SNAC URL
    }
    OPTIONAL { 
      ?wikidata_ID wdt_wikidata:P4724 ?maitronID.  # Maitron ID
      BIND(URI(CONCAT("https://maitron.fr/spip.php?article", STR(?maitronID))) AS ?maitronURL)  # Generates the Maitron URL
    }
    OPTIONAL { 
      ?wikidata_ID wdt_wikidata:P1979 ?JusteID.  # Righteous Among the Nations ID
      BIND(URI(CONCAT("https://collections.yadvashem.org/en/righteous/", STR(?JusteID))) AS ?JusteURL)  # Generates the Righteous Among the Nations URL
    }
    
    # Retrieves the English Wikipedia article
    OPTIONAL {
      ?article_en schema:about ?wikidata_ID ;
                  schema:inLanguage "en" ;
                  schema:isPartOf <https://en.wikipedia.org/> .  # English Wikipedia article
    }
    
    # Retrieves archives linked to the person
    OPTIONAL {
      ?wikidata_ID wdt_wikidata:P485 ?archives.  # Retrieves archives (P485)
      ?archives rdfs:label ?archivesLabel.  # Retrieves archive labels
      FILTER(LANG(?archivesLabel) = "en")  # Filters for labels in English
    }
  }

  # Retrieves labels of persons in the defined language
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

GROUP BY ?person ?surname ?firstName ?wikidata_ID ?article_en ?odisURL ?JusteURL ?bioNationaleURL ?maitronURL ?viafURL ?snacURL

ORDER BY LCASE(?surname) LCASE(?firstName)  # Sorts results by surname, then first name (case-insensitive)

Try it!