FactGrid:Sample queries: Difference between revisions

From FactGrid
Jump to navigation Jump to search
Line 62: Line 62:
== Statistics ==
== Statistics ==
[[File:Adherents of the French Prophets and their religious affiliations.JPG|thumb|right|200px|[https://tinyurl.com/yglpoqzq Adherents of the French Prophets and their religious affiliations]]]
[[File:Adherents of the French Prophets and their religious affiliations.JPG|thumb|right|200px|[https://tinyurl.com/yglpoqzq Adherents of the French Prophets and their religious affiliations]]]
[[File:Age at death of all FacGrid humans.JPG|thumb|right|200px|[https://tinyurl.com/yfa3txkt Age at death of all Human beings (Q7) noted on FactGrid, statistical distribution]]]
[[File:Age at death of all FacGrid humans.JPG|thumb|right|200px|[https://tinyurl.com/yhzquxwf Age at death of all Human beings (Q7) noted on FactGrid, statistical distribution]]]
* [https://database.factgrid.de/query/index.html#%23defaultView%3ABubbleChart%0ASELECT%20%3FGenderLabel%20%28count%28distinct%28%3FA%29%29%20as%20%3Fcount%29%20WHERE%20%7B%0A%20%20%0A%20%20SELECT%20%3FA%20%3FALabel%20%3FADescription%20%3Ffamily_nameLabel%20%3FEntry%20%3FBnF_ID%20%3FDate_of_birth%20%3FGender%20%3FGenderLabel%20WHERE%20%7B%0A%20%20%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22en%22.%20%7D%0A%20%20%20%20%3FA%20wdt%3AP300%20wd%3AQ255080.%0A%20%20%20%20OPTIONAL%20%7B%20%3FA%20%28p%3AP300%2Fpq%3AP49%29%20%3FEntry.%20%7D%0A%20%20%20%20OPTIONAL%20%7B%20%3FA%20wdt%3AP247%20%3Ffamily_name.%20%7D%0A%20%20%20%20%3FA%20wdt%3AP154%20%3FGender.%20%0A%7D%0A%20%20%0A%20%20%7D%20group%20by%20%3FGenderLabel The distribution of males and females who became followers of the early 18th-century "French Prophets"]
* [https://database.factgrid.de/query/index.html#%23defaultView%3ABubbleChart%0ASELECT%20%3FGenderLabel%20%28count%28distinct%28%3FA%29%29%20as%20%3Fcount%29%20WHERE%20%7B%0A%20%20%0A%20%20SELECT%20%3FA%20%3FALabel%20%3FADescription%20%3Ffamily_nameLabel%20%3FEntry%20%3FBnF_ID%20%3FDate_of_birth%20%3FGender%20%3FGenderLabel%20WHERE%20%7B%0A%20%20%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22en%22.%20%7D%0A%20%20%20%20%3FA%20wdt%3AP300%20wd%3AQ255080.%0A%20%20%20%20OPTIONAL%20%7B%20%3FA%20%28p%3AP300%2Fpq%3AP49%29%20%3FEntry.%20%7D%0A%20%20%20%20OPTIONAL%20%7B%20%3FA%20wdt%3AP247%20%3Ffamily_name.%20%7D%0A%20%20%20%20%3FA%20wdt%3AP154%20%3FGender.%20%0A%7D%0A%20%20%0A%20%20%7D%20group%20by%20%3FGenderLabel The distribution of males and females who became followers of the early 18th-century "French Prophets"]
* [https://database.factgrid.de/query/index.html#%23defaultView%3ABubbleChart%0ASELECT%20%3FReligionLabel%20%28count%28distinct%28%3FA%29%29%20as%20%3Fcount%29%20WHERE%20%7B%0A%20%20%0A%20%20SELECT%20%3FA%20%3FALabel%20%3FADescription%20%3Ffamily_nameLabel%20%3FEntry%20%3FBnF_ID%20%3FDate_of_birth%20%3FReligion%20%3FReligionLabel%20WHERE%20%7B%0A%20%20%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22en%22.%20%7D%0A%20%20%20%20%3FA%20wdt%3AP300%20wd%3AQ255080.%0A%20%20%20%20OPTIONAL%20%7B%20%3FA%20%28p%3AP300%2Fpq%3AP49%29%20%3FEntry.%20%7D%0A%20%20%20%20OPTIONAL%20%7B%20%3FA%20wdt%3AP247%20%3Ffamily_name.%20%7D%0A%20%20%20%20%3FA%20wdt%3AP172%20%3FReligion.%20%0A%7D%0A%20%20%0A%20%20%7D%20group%20by%20%3FReligionLabel Adherents of the French Prophets and their religious affiliation]
* [https://database.factgrid.de/query/index.html#%23defaultView%3ABubbleChart%0ASELECT%20%3FReligionLabel%20%28count%28distinct%28%3FA%29%29%20as%20%3Fcount%29%20WHERE%20%7B%0A%20%20%0A%20%20SELECT%20%3FA%20%3FALabel%20%3FADescription%20%3Ffamily_nameLabel%20%3FEntry%20%3FBnF_ID%20%3FDate_of_birth%20%3FReligion%20%3FReligionLabel%20WHERE%20%7B%0A%20%20%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22en%22.%20%7D%0A%20%20%20%20%3FA%20wdt%3AP300%20wd%3AQ255080.%0A%20%20%20%20OPTIONAL%20%7B%20%3FA%20%28p%3AP300%2Fpq%3AP49%29%20%3FEntry.%20%7D%0A%20%20%20%20OPTIONAL%20%7B%20%3FA%20wdt%3AP247%20%3Ffamily_name.%20%7D%0A%20%20%20%20%3FA%20wdt%3AP172%20%3FReligion.%20%0A%7D%0A%20%20%0A%20%20%7D%20group%20by%20%3FReligionLabel Adherents of the French Prophets and their religious affiliation]
* [https://database.factgrid.de/query/index.html#%23defaultView%3ABubbleChart%0ASELECT%20%3FMembershipLabel%20%28count%28distinct%28%3FA%29%29%20as%20%3Fcount%29%20WHERE%20%7B%0A%20%20%0A%20%20SELECT%20%3FA%20%3FALabel%20%3FADescription%20%3Ffamily_nameLabel%20%3FEntry%20%3FBnF_ID%20%3FDate_of_birth%20%3FMembership%20%3FMembershipLabel%20WHERE%20%7B%0A%20%20%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22en%22.%20%7D%0A%20%20%20%20%3FA%20wdt%3AP91%20wd%3AQ10677.%0A%20%20%20%20OPTIONAL%20%7B%20%3FA%20%28p%3AP91%2Fpq%3AP49%29%20%3FEntry.%20%7D%0A%20%20%20%20OPTIONAL%20%7B%20%3FA%20wdt%3AP247%20%3Ffamily_name.%20%7D%0A%20%20%20%20%3FA%20wdt%3AP91%20%3FMembership.%20%0A%20%20%20%20minus%20%7B%0A%20%20%20%20%20%20values%20%3FMembership%20%7B%0A%20%20%20%20%20%20%20%20wd%3AQ10678%20%0A%20%20%20%20%20%20%20%20wd%3AQ10677%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%7D%0A%20%20%0A%20%20%7D%20group%20by%20%3FMembershipLabel The Illuminati membership statements] The intricate thing is that this search excludes the two 100% bubbles of Illuminati and Freemasons that are of course given with every Illuminati membership.
* [https://database.factgrid.de/query/index.html#%23defaultView%3ABubbleChart%0ASELECT%20%3FMembershipLabel%20%28count%28distinct%28%3FA%29%29%20as%20%3Fcount%29%20WHERE%20%7B%0A%20%20%0A%20%20SELECT%20%3FA%20%3FALabel%20%3FADescription%20%3Ffamily_nameLabel%20%3FEntry%20%3FBnF_ID%20%3FDate_of_birth%20%3FMembership%20%3FMembershipLabel%20WHERE%20%7B%0A%20%20%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22en%22.%20%7D%0A%20%20%20%20%3FA%20wdt%3AP91%20wd%3AQ10677.%0A%20%20%20%20OPTIONAL%20%7B%20%3FA%20%28p%3AP91%2Fpq%3AP49%29%20%3FEntry.%20%7D%0A%20%20%20%20OPTIONAL%20%7B%20%3FA%20wdt%3AP247%20%3Ffamily_name.%20%7D%0A%20%20%20%20%3FA%20wdt%3AP91%20%3FMembership.%20%0A%20%20%20%20minus%20%7B%0A%20%20%20%20%20%20values%20%3FMembership%20%7B%0A%20%20%20%20%20%20%20%20wd%3AQ10678%20%0A%20%20%20%20%20%20%20%20wd%3AQ10677%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%7D%0A%20%20%0A%20%20%7D%20group%20by%20%3FMembershipLabel The Illuminati membership statements] The intricate thing is that this search excludes the two 100% bubbles of Illuminati and Freemasons that are of course given with every Illuminati membership.


* [https://database.factgrid.de/query/#%23%20Query%20to%20find%20all%20musicians%20who%20have%20already%20died%20%0A%23%20calculate%20their%20age%20%28full%20years%29%20at%20death%0A%23%20count%20how%20many%20of%20them%20died%20at%20each%20age%0A%23defaultView%3ALineChart%0ASELECT%20%3Fage%20%20%28COUNT%20%28DISTINCT%20%3Fa%29%20AS%20%3Fcount%29%20%0AWHERE%20%7B%0A%20%20%20%20%20%20%20%20%3Fa%20wdt%3AP2%20wd%3AQ7.%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23instance%20of%20human%0A%20%20%20%20%20%20%20%20%3Fa%20p%3AP77%2Fpsv%3AP77%20%3Fbirth_date_node.%20%0A%20%20%20%20%20%20%20%20%3Fa%20p%3AP38%2Fpsv%3AP38%20%3Fdeath_date_node.%0A%20%20%20%20%20%20%20%20%3Fbirth_date_node%20wikibase%3AtimeValue%20%3Fbirth_date.%0A%20%20%20%20%20%20%20%20%3Fdeath_date_node%20wikibase%3AtimeValue%20%3Fdeath_date.%0A%20%20%20%20%20%20%20%20BIND%28%20YEAR%28%3Fdeath_date%29%20-%20YEAR%28%3Fbirth_date%29%20-%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20IF%28MONTH%28%3Fdeath_date%29%3CMONTH%28%3Fbirth_date%29%20%7C%7C%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%28MONTH%28%3Fdeath_date%29%3DMONTH%28%3Fbirth_date%29%20%26%26%20DAY%28%3Fdeath_date%29%3CDAY%28%3Fbirth_date%29%29%2C1%2C0%29%20AS%20%3Fage%20%29%0A%20%20%20%20%20%20%20%20%23%20calculate%20the%20age%2C%20precisely%20to%20the%20day%20%28times%20and%20timezones%20ignored%29%0A%20%20%20%20%20%20%20%20FILTER%28%3Fage%20%3E%2010%20%26%26%20%3Fage%20%3C%20100%29.%20%20%20%20%23ignore%20outlyers%2C%20several%20of%20which%20are%20probably%20errors%0A%7D%0AGROUP%20BY%20%3Fage Age at death of all human beings listed on FactGrid, diagram]
* [https://tinyurl.com/yhzquxwf Age at death of all human beings listed on FactGrid, diagram]


== Grammatically intricate searches ==
== Grammatically intricate searches ==

Revision as of 13:42, 10 November 2021

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

All documents of a specific research interest where from? Map

All persons of a certain profession in a town Map

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

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

Wishful thinking