Project:QuickStatements
From MaRDI portal
About
This page assists in managing queries that produce output in a format that can serve as input to QuickStatements, either on the MaRDI instance or on the Wikidata one. Other Wikibase instances also often have a QuickStatements instance that can be used in an analogous fashion.
Data transfer to Wikidata
This section describes how to export data from the MaRDI portal to Wikidata to make the data better findable for the general public.
Example EuDML proposed by Vladimir Alexiev in 2022, which had 17 results as of 6 October 2024.
- Prepare query for the MaRDI SPARQL endpoint
- Find the MaRDI qIDs with a statement using P12 = WikidataQId
- The thing you want to export, here a part of the external url P205
- Check for total number of MaRDI items with a P205 (External URL) statement. (170197 as of 7 October 2024)
- Filter the URLs for the pattern of interest — in our case, this would be "starts with https://eudml.org/doc/" (7115 as of 7 October 2024)
- Check whether there are MaRDI items with P205 (external URL) statements and without P12 (Wikidata QID) statements. If so, use MaRDI's QuickStatements tool to add that query's results to MaRDI (sample edit).
- Write the query, example and investigate the result.
SELECT ?MaRDI_qID ?MaRDI_item ?EuDMLid WHERE { ?MaRDI_item wdt:P205 ?URL; wdt:P12 ?Wikidata_qID. FILTER(STRSTARTS(STR(?URL), "https://eudml")) BIND(SUBSTR(STR(?URL), 23 ) AS ?EuDMLid) } LIMIT 10
- Check for total number of MaRDI items with both (i) a Wikidata QID statement and (ii) a EuDML-based URL link (9296 as of 7 October 2024)
- Find the properties in Wikidata, here only P11166 for eudml.
- Check whether Wikidata already has a corresponding statement.
- This does not scale well. Perhaps need to use DOI or zbMATH ID (doc/ person) as a bridge
- If yes, check consistency with MaRDI.
- To do
- If no, prepare upload to Wikidata.
- To do
- Rewrite the query to match the Quickstatements CSV format
SELECT ?qid ?P11166 WHERE { ?qal854 wdt:P205 ?url ; wdt:P12 ?qid FILTER (STRSTARTS(str(?url) ,"https://eudml")) . BIND (Concat( "\"", ## Required for external identifiers by quickstatements SUBSTR(STR(?url),23), ## 23 = Length of the prefix "\"") as ?P11166) } LIMIT 3
- Download the CSV file and test with a few items on Wikidata
- Optional add source linking back to the source of the information (MaRDI)
SELECT ?qid ?P11166 ?S854 WHERE { ?item wdt:P205 ?url ; wdt:P12 ?qid FILTER (STRSTARTS(str(?url) ,"https://eudml")) . BIND (Concat( "\"", ## Required for external identifiers by quickstatements SUBSTR(STR(?url),23), ## 23 = Length of the prefix "\"") as ?P11166). BIND (Concat( "\"", ## Required for external identifiers by quickstatements STR(?item), "\"") as ?S854) } LIMIT 3
- Remove the limit and do the full import