Wikidata:Property proposal/Wikidata SPARQL query equivalent
Wikidata SPARQL query equivalent edit
Originally proposed at Wikidata:Property proposal/Generic
Data type | String |
---|---|
Domain | Wikimedia category (Q4167836) items |
Example | Category:Ugandan writers (Q7439502) → ?item wdt:P31 wd:Q5. ?item wdt:P27 wd:Q1036. |
- Motivation
I was navigating the category tree for writers in English Wikipedia, and I imagined it would be useful to have links in every category to the equivalent Wikidata SPARQL query. For example, in en:Category:Ugandan writers (Category:Ugandan writers (Q7439502)), we could have a link to this equivalent query. Though I think that the property only should include the text "?item wdt:P31 wd:Q5 . ?item wdt:P27 wd:Q1036", skipping the SELECT, WHERE and end lines. Those lines could be included by the template in English Wikipedia. Perhaps every Wikipedia wants to show different columns for results, or different sorts, etc. Even if Englsh Wikipedia isn't interested in having those links in the categories, I think this property that would translate categories<->sparql is still useful for users and bots. Emijrp (talk) 17:24, 19 March 2017 (UTC)
- Discussion
Comment I'm not good at queries. Can you prove that there is an unique query that solves a problem? If not, how to choose the "best" one? --★ → Airon 90 17:50, 19 March 2017 (UTC)
- Oppose, we already have category combines topics (P971) and related property (P1659) as qualifier for this goal. With these 2 properties tools like Wikidata:Database_reports/items_without_claims_categories/ukwiki can generate much more complex things (like mass-creation links to petscan). --Lockal (talk) 18:05, 19 March 2017 (UTC)
- Yes, I think that property do the same. I will learn more about it and probably close this proposal. Thanks. Emijrp (talk) 18:16, 19 March 2017 (UTC)
- It's more useful in item like male basketball players with the family name Brown (Q20007442):
?item wdt:P31 wd:Q5. ?item wdt:P734 wd:Q13421990. ?item wdt:P641 wd:Q5372.
--ValterVB (talk) 20:07, 19 March 2017 (UTC) - tend to support Interesting, and I don't think we can do anything equivalent using category combines topics (P971) and related property (P1659). (P1659 is really vague). As Valter remarks, it could also be used for lists. I don't know if this would be a good idea to use the same property for categories and for lists.-Zolo (talk) 14:16, 23 March 2017 (UTC)
- How is that monolingual text and not string? ChristianKl (talk) 16:43, 25 March 2017 (UTC)
- Actually, I think it would be best if this property was URL linking to the query in https://query.wikidata.org/ . It has "short URL" option providing permalinks to queries. It is more functional than a string in Wikidata, as it provides prefix declarations and all, and it has much more flexible length limits. --Zolo (talk) 07:16, 19 April 2017 (UTC)
- Aren't SQL fragments a security problem ? --Melderick (talk) 09:43, 2 May 2017 (UTC)
- This is SPARQL, not SQL. SPARQL endpoints are generally not configured to allow any updates of the dataset, so I don't think there's any security issue at all here. ArthurPSmith (talk) 19:52, 2 May 2017 (UTC)
Done Changed to string after input from Stas. @Emijrp, Airon90, Lockal, ValterVB, Zolo: @ChristianKl, Melderick, ArthurPSmith:--Micru (talk) 14:46, 5 May 2017 (UTC)