query-c21c60039533877979145c2c25234070

rq turtle/ttl

?item ]reply[13:18, 9 May 2017 (UTC)) talk (MisterSynergy — any opinions? —?item. Maybe it would also be enough if it just checked for the occurence of ?item starts with, as we typically name it. I’ve added a constraint that should check whether the given string ?itemSince this property does not hold full queries, its values are only useful if the selective variable is called ]reply[18:26, 9 May 2017 (UTC)) talk (ValterVB: Why you have changed without warning? We were writing little above to use Select etc... A template is already done to use the property with complete query. --MisterSynergy@]reply[18:41, 9 May 2017 (UTC)) talk (ValterVBThis is the "Property talk of P3921", why discussiono is on english chat? THe decision on specific property must stay in property talk page not in other place. We already started to talk here. For now I'm not agree with this decision. -- ]reply[18:36, 9 May 2017 (UTC)) talk (MisterSynergy). —perma link (WD:PCIt is just a constraint until now, and I fixed three erroneous cases with missing question marks (but not full queries, which are also in use). The way it is right now follows the property proposal, and this was also discussed today at ]reply[19:17, 9 May 2017 (UTC)) talk (ValterVBThe problem is that without complete query we are limited, for example we can use UNION or sub select or more complex query. -- ]reply[18:45, 9 May 2017 (UTC)) talk (MisterSynergyWell, the way I set this up was just how it was intended anyway; by propery proposal, given examples, and url formatter. I do not understand how you can just decide to change things completely. With full queries, we lose all flexibility that this property could deliver… —]reply[20:27, 9 May 2017 (UTC)) talk (ValterVBWhy? The property is for any kind of lists not only for the category. Who decide what is complex? If I want all P31=Q5 the query is simple but a simple query don't work, probably I need more queries that work on a subset of item and I can add more query to the item -- ]reply[19:34, 9 May 2017 (UTC)) talk (MisterSynergyThis property should not be used for complex queries, it should just deliver simple equivalent sets to Wikipedia categories. —]reply[20:40, 9 May 2017 (UTC)) talk (MisterSynergy appears in the query fragment, since this is the variable which data users and template coders expect. Unlike now, it would not need to appear in the very beginning of the query fragment, thus subqueries, unions, and all the complex sparql magic would be available. We just skip the very outer wrapper and all nonessential parts such as label service etc. —?itemAn option to enable complex queries would be to just test whether It would still be useful it we’d really restrict the values to the essentially important fragments of the query. Everything else should then be added within the Wikipedia template. This would also allow to add additional aspects to the query on Wikipedia side, such as: “include only items with sitelink to this wiki”, “add labels and descriptions in language xy”, etc. as the value of this property, rather than the whole query.fragmentSo for all of these reasons, it strongly makes sense to have a It also makes it possible for people to write their own gadgets, with slightly different queries, all still drawing on the same specification for the content of the category. Similarly, storing only the fragment rather than the whole query makes it easy for different wikis to easily use different variables and column headings for their different languages, with their own preferred language fallback in the internationalisation. Keeping all this in the template code (rather than the content) makes it possible to easily add additional columns -- eg start date / end date -- without having to change any of the actual pages the template is used on. (equivalent here, to any of the items the property is used on). The presentation code can be changed, without having to change the item-by-item content. this makes it possible to easily choose and modify what other fields the template presents -- for example at the moment the Commons template also presents images associated with the item, Commons categories, co-ordinates, whether the item is an instance or a class, etc. {{Category contains|wdt:P131+ wd:Q23143 ; wdt:P1435 wd:Q15700818 ; wdt:P31?/wdt:P279* wd:Q41176}}By only storing a Sparql fragment in the template on the Commons category pages, and not the whole query, so for some demonstration pages using it.c:Special:WhatLinksHere/Template:Category_contains -- see c:Template:category containsWhat this property does is very analogous to a template I created a couple of months ago on Commons, to the view that this property should only contain a SPARQL fragment, not the whole query. It's a basic principle to try to separate as far as possible on the one hand data-dependent content from presentation on the other hand -- so that each can be worked on and modified independently, without affecting the other.+1So for a query like this, what we must add in property? ]reply[10:48, 10 May 2017 (UTC)) talk (Jheald again one or more further times in the query; so there may be an argument that it should always be included explicitly, to indicate the main variable that the fragment should return. ?itemBut there may be cases where it is difficult to express the category contents without using in the fragment, leaving it to the template code to supply.?itemIn the Commons template (made before this property was proposed), I didn't include , I can take or leave.?itemAs for whether that fragment should necessarily include

Use at

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
SELECT ?item WHERE {
   {
  SELECT ?item {
    BIND( 1000000 * 28 AS ?base ) . # change this 0-30
    ?item wdt:P31 wd:Q4167836 .
    BIND( xsd:integer( STRAFTER( STR( ?item ), STR( wd:Q ) ) ) AS ?num ) .
    FILTER( ?num > ?base + 0 && ?num < ?base + 1000001 ) .
  }
}.
  ?item schema:description ?itDescrizione FILTER( LANG( ?itDescrizione ) = 'es' ) .
  FILTER( STR( ?itDescrizione ) != 'categoría de Wikimedia' ) }

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?base") v1("?itDescrizione") v4("?item"):::projected v5("?num") c6(["wd:Q4167836"]):::iri f0[["str(?itDescrizione) != 'categoría de Wikimedia'"]] f0 --> v1 f1[["?itDescrizione = 'es'"]] f1 --> v1 f2[["?num > ?base + '0^^xsd:integer'?num < ?base + '1000001^^xsd:integer'"]] f2 --> v5 f2 --> v4 bind3[/"'1000000^^xsd:integer' * '28^^xsd:integer'"/] bind3 --as--o v4 v4 --"wdt:P31"--> c6 bind4[/"http://www.w3.org/2001/XMLSchema#integer(substring-after(str(?item),str('wd:Q')))"/] v4 --o bind4 bind4 --as--o v5 v4 --"schema:description"--> v1