FactGrid:Sample queries: Difference between revisions
Jump to navigation
Jump to search
(Add filter for strings query) |
(add query to fetch all properties of an item) |
||
Line 116: | Line 116: | ||
* [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] | * [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] | ||
== SPARQL patterns for reuse == | |||
=== Get all properties of an item === | |||
SELECT ?p ?o WHERE { | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } | |||
wd:Q406029 ?p ?o | |||
} | |||
== Wishful thinking == | == Wishful thinking == |
Revision as of 13:37, 25 May 2022
Help:
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/Wikidata_Query_Help/Result_Views/en
- https://en.wikibooks.org/wiki/SPARQL/FILTER
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
- Two Persons, when and where did they meet timeline
- All people with a FactGrid account by gender
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
- The second missionary journey of the French Prophets 1712-1714
- The Illuminati correspondence, who wrote whom, from where, whereto
- Arthur Schopenhauer, Places of residence
Tables
- Was a member of the Illuminati
- All guided compositions, where written? when? plus links to FactGrid transcripts.
- no functional query yet, but a first attempt is here, modeled after the "academic tree" graph in Scholia's author aspect
- all 18th-century addresses in Gotha (which have already received geo-coordinates)
- when was the Gregorian calendar introduced?
Graphs
Timelines
Statistics
- The members of Frankfurt's Union-Lodge, branches of occupation, bubble chart
- The distribution of males and females who became followers of the early 18th-century "French Prophets"
- Adherents of the French Prophets and their religious affiliation
- Those with a FactGrid account - first languages
- 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.
Grammatically intricate searches
Wimimedia sources
Statements with sources
Get information from connected items
- The graduates of Gotha's Gymnasium Illustre/Ernestinum: their fathers with career information, their mothers and the fathers of the mothers (i.e. maternal grandfathers) with the respective career information] The search is intricate as it goes into related database objects and brings information located there into the table.
Search for specific Qualifiers on a Statement
- Authors writing all kind of satires
- Authors writing satire and all its subclasses (you just add /wdt:P3* to pq:P122)
- The people writing all kind of satires (not necessarily authors) (very simple: remove ps:P165 wd:Q23190)
- 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
- all FactGrid people born between 1700 and 1710 A Filter that selects a time frame
- 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()`
SPARQL patterns for reuse
Get all properties of an item
SELECT ?p ?o WHERE { SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
wd:Q406029 ?p ?o }
Wishful thinking
- A map of all places a Person has been, using (also) the information from sender's and receiver's places
- visualisations quest on phabricator