DS Catalog:SPARQL Query Service/example queries: Difference between revisions

Line 10: Line 10:
The decision to separate but link metadata descriptions from their manuscript objects was purposeful so as not to make any direct claims or assertions about the manuscript object other than its existence (which happens through assignment of a unique persistent identifier: the DS ID). In this way, the DS Record is conceptualized as a document which makes statements about a manuscript object which are not inherent to the manuscript object itself and can be revised at any time. Although the DS data model is designed to have only one DS Record linked to a Manuscript, this conceptualization of descriptive documents as separate from described objects potentially allows many different (and potentially competing) descriptions to be linked to the same object simultaneously.
The decision to separate but link metadata descriptions from their manuscript objects was purposeful so as not to make any direct claims or assertions about the manuscript object other than its existence (which happens through assignment of a unique persistent identifier: the DS ID). In this way, the DS Record is conceptualized as a document which makes statements about a manuscript object which are not inherent to the manuscript object itself and can be revised at any time. Although the DS data model is designed to have only one DS Record linked to a Manuscript, this conceptualization of descriptive documents as separate from described objects potentially allows many different (and potentially competing) descriptions to be linked to the same object simultaneously.


Because of this data structure, unlike traditional library catalogs or search interfaces ([https://search.digital-scriptorium.org/ like the one for the DS Catalog]), users may find that SPARQL queries seem at first circuitous in comparison to other search and retrieval systems. This is because graphs databases like the DS Wikibase are queried on the basis of pattern matching for particular entities (items) and relationships between entities. A machine rapidly traverses the graph finding patterns that match the path indicated by the query. For purposes of querying DS data, that means that seemingly disparate elements of DS Records, Manuscripts, and even [https://catalog.digital-scriptorium.org/entity/Q2 Holding Information] (i.e., information about and assigned by the institution that owns and/or contributes data about a manuscript object) may all need to be invoked as part of a constructed queried in order to get solutions to seemingly simple questions (such as which institutions own items with texts authored by Avicenna). Taking some time to understand the items, properties, and linking structures in the DS data model and its substantiation in the DS Wikibase will help to elucidate how queries of this nature can be constructed.
Because of this data structure, unlike traditional library catalogs or search interfaces ([https://search.digital-scriptorium.org/ like the one for the DS Catalog]), users may find that SPARQL queries seem at first circuitous in comparison to other search and retrieval systems. This is because graphs databases like the DS Wikibase are queried on the basis of pattern matching for particular entities (items) and relationships between entities. A machine rapidly traverses the graph finding patterns that match the path indicated by the query. For purposes of querying DS data, that means that seemingly disparate elements of DS Records, Manuscripts, and even [https://catalog.digital-scriptorium.org/entity/Q2 Holding Information] (i.e., information about and assigned by the institution that owns and/or contributes data about a manuscript object) may all need to be invoked as part of a constructed queried in order to get solutions to seemingly simple questions ([https://catalog.digital-scriptorium.org/query/#%23%20prefixes%0APREFIX%20wd%3A%20%3Chttps%3A%2F%2Fcatalog.digital-scriptorium.org%2Fentity%2F%3E%0APREFIX%20wds%3A%20%3Chttps%3A%2F%2Fcatalog.digital-scriptorium.org%2Fentity%2Fstatement%2F%3E%0APREFIX%20wdv%3A%20%3Chttps%3A%2F%2Fcatalog.digital-scriptorium.org%2Fvalue%2F%3E%0APREFIX%20wdt%3A%20%3Chttps%3A%2F%2Fcatalog.digital-scriptorium.org%2Fprop%2Fdirect%2F%3E%0APREFIX%20p%3A%20%3Chttps%3A%2F%2Fcatalog.digital-scriptorium.org%2Fprop%2F%3E%0APREFIX%20ps%3A%20%3Chttps%3A%2F%2Fcatalog.digital-scriptorium.org%2Fprop%2Fstatement%2F%3E%0APREFIX%20pq%3A%20%3Chttps%3A%2F%2Fcatalog.digital-scriptorium.org%2Fprop%2Fqualifier%2F%3E%0APREFIX%20wikibase%3A%20%3Chttp%3A%2F%2Fwikiba.se%2Fontology%23%3E%0APREFIX%20rdfs%3A%20%3Chttp%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23%3E%0A%0A%23%20find%20manuscript%20records%20with%20authors%20recorded%0ASELECT%20%3Frecord%20%3FrecordLabel%20%3FnameString%20%3FauthorLabel%20%3FinstitutionLabel%20%3Fshelfmark%0AWHERE%20%7B%0A%20%20%0A%23%20author%20is%20Avicenna%0AVALUES%20%3Fauthor%20%7B%20wd%3AQ2845%20%7D%0A%20%20%0A%23%20bind%20query%20variables%0A%20%20BIND%28p%3AP14%20AS%20%3FnameAsRecordedStatement%29.%0A%20%20BIND%28pq%3AP15%20AS%20%3FhasRole%29.%0A%20%20BIND%28ps%3AP14%20AS%20%3FnameAsRecorded%29.%0A%20%20BIND%28pq%3AP17%20AS%20%3FhasName%29.%0A%20%20BIND%28wdt%3AP3%20AS%20%3Fdescribes%29.%0A%20%20BIND%28wdt%3AP2%20AS%20%3FhasHoldingInformation%29.%0A%20%20BIND%28p%3AP5%20AS%20%3FhasInstitutionStatement%29.%0A%20%20BIND%28pq%3AP4%20AS%20%3FhasInstitution%29.%0A%20%20BIND%28wdt%3AP8%20AS%20%3FhasShelfmark%29.%0A%20%20%0A%23%20statement%3A%20manuscript%20record%20has%20statement%20for%20associated%20name%0A%20%20%3Frecord%20%3FnameAsRecordedStatement%20%3FnameStatement%20.%0A%23%20statement%3A%20name%20statement%20has%20name%20object%20recorded%20as%20string%20value%0A%20%20%3FnameStatement%20%3FnameAsRecorded%20%3FnameString%20.%0A%23%20statement%3A%20associated%20name%20has%20role%20of%20author%0A%20%20%3FnameStatement%20%3FhasRole%20wd%3AQ18%20.%0A%23%20statement%3A%20name%20statement%20has%20qualifier%20for%20structured%2Fauthority%20value%20%22Avicenna%22%0A%20%20%3FnameStatement%20%3FhasName%20%3Fauthor%20.%0A%23%20statement%3A%20manuscript%20record%20describes%20manuscript%20object%0A%20%20%3Frecord%20%3Fdescribes%20%3Fmanuscript%20.%0A%23%20statement%3A%20manuscript%20has%20holding%20information%0A%20%20%3Fmanuscript%20%3FhasHoldingInformation%20%3Fholding%20.%0A%23%20statement%3A%20holding%20has%20statement%20about%20holding%20institution%0A%20%20%3Fholding%20%3FhasInstitutionStatement%20%3FinstitutionStatement%20.%0A%23%20statement%3A%20institution%20statement%20is%20qualified%20by%20authority%20value%0A%20%20%3FinstitutionStatement%20%3FhasInstitution%20%3Finstitution%20.%0A%23%20statement%3A%20holding%20has%20statement%20about%20shelfmark%0A%20%20%3Fholding%20%3FhasShelfmark%20%3Fshelfmark%20.%0A%0A%0A%23%20return%20English%20language%20labels%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22%5BAUTO_LANGUAGE%5D%2Cen%22.%0A%20%20%7D%0A%20%20%7D%0AORDER%20BY%20%3FrecordLabel such as which institutions own items with texts authored by Avicenna]). Taking some time to understand the items, properties, and linking structures in the DS data model and its substantiation in the DS Wikibase will help to elucidate how queries of this nature can be constructed.


To help users better understand how queries are constructed, the example queries found below provide comments (which are proceeded by # tags) to explain how clauses and asserted triple patterns function in the context of a query. We hope that working through some of these examples will allow users to construct their own more complex queries as they learn more about how the DS data model operates in concert with their research questions.
To help users better understand how queries are constructed, the example queries found below provide comments (which are proceeded by # tags) to explain how clauses and asserted triple patterns function in the context of a query. We hope that working through some of these examples will allow users to construct their own more complex queries as they learn more about how the DS data model operates in concert with their research questions.
Bots, Bureaucrats, emailconfirmed, Administrators
30,537

edits