FactGrid:Sample queries: Difference between revisions

From FactGrid
Jump to navigation Jump to search
(Add filter for strings query)
Line 110: Line 110:
* [https://database.factgrid.de/query/#SELECT%20%3Fperson%20%3FpersonLabel%20%3Fdob%0AWHERE%0A%7B%0A%20%20%3Fperson%20wdt%3AP2%20wd%3AQ7%3B%0A%20%20%20%20%20%20%20%20%20%20wdt%3AP77%20%3Fdob.%0A%20%20FILTER%28%221700-01-01%22%5E%5Exsd%3AdateTime%20%3C%3D%20%3Fdob%20%26%26%20%3Fdob%20%3C%20%221710-01-01%22%5E%5Exsd%3AdateTime%29.%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22en%22.%20%7D%20%0A%7D all FactGrid people born between 1700 and 1710] A Filter that selects a time frame
* [https://database.factgrid.de/query/#SELECT%20%3Fperson%20%3FpersonLabel%20%3Fdob%0AWHERE%0A%7B%0A%20%20%3Fperson%20wdt%3AP2%20wd%3AQ7%3B%0A%20%20%20%20%20%20%20%20%20%20wdt%3AP77%20%3Fdob.%0A%20%20FILTER%28%221700-01-01%22%5E%5Exsd%3AdateTime%20%3C%3D%20%3Fdob%20%26%26%20%3Fdob%20%3C%20%221710-01-01%22%5E%5Exsd%3AdateTime%29.%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22en%22.%20%7D%20%0A%7D all FactGrid people born between 1700 and 1710] A Filter that selects a time frame
* [https://database.factgrid.de/query/#SELECT%20%3FPers%20%3FPersLabel%20%3FPrefecture%20%3FPrefectureLabel%20WHERE%20%7B%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22%5BAUTO_LANGUAGE%5D%2Cen%22.%20%7D%0A%20%20%3FPers%20wdt%3AP91%20wd%3AQ10679.%0A%20%20%20%20OPTIONAL%20%7B%20%3FPers%20%28p%3AP91%2Fpq%3AP419%29%20%3FPrefecture.%20%7D%0A%20%20%20%20FILTER%28%3FPrefecture%20IN%28wd%3AQ251652%29%20%29.%0A%7D All members of the strict Observance in Frankfurt's Prefecture] A Filter that selects an Item in a qualifying statement
* [https://database.factgrid.de/query/#SELECT%20%3FPers%20%3FPersLabel%20%3FPrefecture%20%3FPrefectureLabel%20WHERE%20%7B%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22%5BAUTO_LANGUAGE%5D%2Cen%22.%20%7D%0A%20%20%3FPers%20wdt%3AP91%20wd%3AQ10679.%0A%20%20%20%20OPTIONAL%20%7B%20%3FPers%20%28p%3AP91%2Fpq%3AP419%29%20%3FPrefecture.%20%7D%0A%20%20%20%20FILTER%28%3FPrefecture%20IN%28wd%3AQ251652%29%20%29.%0A%7D All members of the strict Observance in Frankfurt's Prefecture] A Filter that selects an Item in a qualifying statement
=== Filter based on strings ===
Filtering results containing certain strings (texts) can be archieved with `FILTER()`
* [https://database.factgrid.de/query/#%23%20Find%20all%20items%20containing%20%22CSD%22%20in%20the%20German%20label%0ASELECT%20DISTINCT%20%3Fitem%20%3Flabel%20WHERE%20%7B%0A%20%20%3Fitem%20wdt%3AP131%20wd%3AQ400012%3B%0A%20%20%20%20rdfs%3Alabel%20%3Flabel.%0A%20%20FILTER%28%28LANG%28%3Flabel%29%29%20%3D%20%22%5BAUTO_LANGUAGE%5D%22%29%0A%20%20FILTER%28CONTAINS%28%3Flabel%2C%20%22CSD%22%29%29%0A%7D Get all item with "CSD" in its labels within the Remove NA Project]


== Wishful thinking ==
== Wishful thinking ==

Revision as of 11:12, 25 May 2022

Help:



Looking for people

  • Search all people of the same family name, sort by given names, state everyone with information about life dates and family details. Table
  • Name of people who ever were a residents of place with basic personal information. Table

Looking for documents

  • All documents written by N.N. with corresponding documents. Table
  • All documents sent to N.N. with corresponding documents. Table
  • All documents mentioning N.N. with corresponding documents. Table
  • All documents of a file listed in sequence. Table
  • All documents sent from (place) by date. Table
  • All documents of a specific archive and research interest by date. Table

Maps

Dots

Lines

Tables

  • no functional query yet, but a first attempt is here, modeled after the "academic tree" graph in Scholia's author aspect

Graphs

Timelines

Statistics

Grammatically intricate searches

Wimimedia sources

Statements with sources

Get information from connected items

Search for specific Qualifiers on a Statement

You already know one related value

  • all the lodges of Saint Domingue/Haiti the intricate part is, that the lodges only have information on places, the places have information on the territorial affiliation - we ask for Q176240 (Haiti) as the must have value. The bracket can also have more countries.

Looking for a statement - give it with all the qualifying statements

This search is especially useful if the data model needs to be changed. It searches the database for a particular statement and gives all the instances with the respective qualifying sub-statements:

SELECT * WHERE {
  ?s wdt:P2 wd:Q7.
  ?s p:P266 ?st. # ?s is the the statement node
  ?st ps:P266 ?o. # that simulates the predicate
  ?st ?qualifier ?value. # this is an attribute (a qualifier)
}

Filters

Filter based on strings

Filtering results containing certain strings (texts) can be archieved with `FILTER()`

Wishful thinking

Notes

  1. Adapted from here.