@@ -323,17 +323,17 @@ viewallitems = Vue.component('view-all-items', {
323323}
324324var sparqlQuery = "SELECT DISTINCT ?value ?valueLabel WHERE {\n" +
325325"VALUES ?value { " + classlessFiltersString + " }\n" +
326- "SERVICE wikibase:label { bd:serviceParam wikibase:language \"" + lang + "\". }\n" +
326+ "SERVICE wikibase:label { bd:serviceParam wikibase:language \"" + lang + "\" . }\n" +
327327"}" ;
328328} else {
329329// Check available filters and exclude ones with distinct type value constraint.
330330var sparqlQuery = "SELECT DISTINCT ?value ?valueLabel ?property WHERE {\n" +
331- "wd:" + this . classValue + " wdt:" + propertiesForThisType + " ?value.\n" +
332- "?value wikibase:propertyType ?property.\n" ;
331+ "wd:" + this . classValue + " wdt:" + propertiesForThisType + " ?value .\n" +
332+ "?value wikibase:propertyType ?property .\n" ;
333333if ( propertyConstraint && distinctValuesConstraint ) {
334334sparqlQuery += "FILTER(NOT EXISTS {\n" +
335- "?value p:" + propertyConstraint + " ?constraint_statement.\n" +
336- "?constraint_statement ps:" + propertyConstraint + " wd:" + distinctValuesConstraint + ".\n" +
335+ "?value p:" + propertyConstraint + " ?constraint_statement .\n" +
336+ "?constraint_statement ps:" + propertyConstraint + " wd:" + distinctValuesConstraint + " .\n" +
337337"})\n" ;
338338}
339339sparqlQuery += "FILTER (?property in (wikibase:Time, wikibase:Quantity, wikibase:WikibaseItem, wikibase:String)) .\n" +
@@ -366,10 +366,10 @@ viewallitems = Vue.component('view-all-items', {
366366"} UNION {\n" +
367367" ?value wdt:" + instanceOf + " ?subclass .\n" +
368368" ?subclass wdt:" + subclassOf + " wd:" + this . classValue + "\n" +
369- "}" ;
369+ "}\n " ;
370370}
371371if ( showThumbnails ) {
372- this . classSelector += "?value schema:url ?file" ;
372+ this . classSelector += "?value schema:url ?file\n " ;
373373}
374374
375375if ( mainPageText && this . appliedFilters . length == 0 && this . appliedRanges . length == 0 && this . appliedQuantities . length == 0 ) {
@@ -392,19 +392,19 @@ viewallitems = Vue.component('view-all-items', {
392392} else {
393393filterString += "{#filter " + i + "\n" +
394394"?value wdt:" + this . appliedFilters [ i ] . parentFilterValue + " ?temp" + i + " .\n" +
395- "?temp" + i + " wdt:" + this . appliedFilters [ i ] . filterValue + " wd:" + this . appliedFilters [ i ] . value + ".\n" +
395+ "?temp" + i + " wdt:" + this . appliedFilters [ i ] . filterValue + " wd:" + this . appliedFilters [ i ] . value + " .\n" +
396396"}\n" ;
397397}
398398}
399399else if ( this . appliedFilters [ i ] . value == "novalue" ) {
400- noValueString += "{#filter " + i + "\n FILTER(NOT EXISTS { ?value wdt:" + this . appliedFilters [ i ] . filterValue + " ?no. }).\n}"
400+ noValueString += "{#filter " + i + "\n FILTER(NOT EXISTS { ?value wdt:" + this . appliedFilters [ i ] . filterValue + " ?no. }) .\n}"
401401}
402402else if ( this . appliedFilters [ i ] . value . match ( / ^ Q \d + $ / ) == null ) {
403403// String type
404404filterString += "{#filter " + i + "\n?value wdt:" + this . appliedFilters [ i ] . filterValue + " '" + this . appliedFilters [ i ] . value + "' .\n}" ;
405405}
406406else {
407- filterString += "{#filter " + i + "\n?value wdt:" + this . appliedFilters [ i ] . filterValue + " wd:" + this . appliedFilters [ i ] . value + ".\n}" ;
407+ filterString += "{#filter " + i + "\n?value wdt:" + this . appliedFilters [ i ] . filterValue + " wd:" + this . appliedFilters [ i ] . value + " .\n}" ;
408408}
409409}
410410if ( parentFilterString != '' ) {
@@ -413,72 +413,72 @@ viewallitems = Vue.component('view-all-items', {
413413let filterRanges = "" , maxString = "" , constraintString = "" ;
414414for ( let i = 0 ; i < this . appliedRanges . length ; i ++ ) {
415415if ( this . appliedRanges [ i ] . valueLL == "novalue" ) {
416- noValueString += "{#date range " + i + "\n FILTER(NOT EXISTS { ?value wdt:" + this . appliedRanges [ i ] . filterValue + " ?no. }).\n}"
416+ noValueString += "{#date range " + i + "\n FILTER(NOT EXISTS { ?value wdt:" + this . appliedRanges [ i ] . filterValue + " ?no. }) .\n}"
417417}
418418else if ( this . appliedRanges [ i ] . parentFilterValue ) {
419419timePrecision = getTimePrecision ( this . appliedRanges [ i ] . valueLL , this . appliedRanges [ i ] . valueUL )
420- filterRanges += "{#date range " + i + "\n?value wdt:" + this . appliedRanges [ i ] . parentFilterValue + " ?temp" + i + ".\n" +
420+ filterRanges += "{#date range " + i + "\n?value wdt:" + this . appliedRanges [ i ] . parentFilterValue + " ?temp" + i + " .\n" +
421421"?temp" + i + " (p:" + this . appliedRanges [ i ] . filterValue + "/psv:" + this . appliedRanges [ i ] . filterValue + ") ?timenode" + i + ".\n" +
422- "?timenode" + i + " wikibase:timeValue ?time" + i + ".\n" +
422+ "?timenode" + i + " wikibase:timeValue ?time" + i + " .\n" +
423423"?timenode" + i + " wikibase:timePrecision ?timeprecision" + i + " .\n" +
424424( centralSPARQLService ?"}\n" :'' ) +
425425"FILTER(?timeprecision" + i + ">=" + timePrecision + ")\n}" ;
426- constraintString += "FILTER('" + this . appliedRanges [ i ] . valueLL + "'^^xsd:dateTime <= ?tim" + i + " && ?tim" + i + " < '" + this . appliedRanges [ i ] . valueUL + "'^^xsd:dateTime).\n" ;
426+ constraintString += "FILTER('" + this . appliedRanges [ i ] . valueLL + "'^^xsd:dateTime <= ?tim" + i + " && ?tim" + i + " < '" + this . appliedRanges [ i ] . valueUL + "'^^xsd:dateTime) .\n" ;
427427maxString += "(MAX(?time" + i + ") AS ?tim" + i + ") " ;
428428
429429}
430430else {
431431timePrecision = getTimePrecision ( this . appliedRanges [ i ] . valueLL , this . appliedRanges [ i ] . valueUL )
432- filterRanges += "{#date range " + i + "\n?value (p:" + this . appliedRanges [ i ] . filterValue + "/psv:" + this . appliedRanges [ i ] . filterValue + ") ?timenode" + i + ".\n" +
433- "?timenode" + i + " wikibase:timeValue ?time" + i + ".\n" +
434- "?timenode" + i + " wikibase:timePrecision ?timeprecision" + i + ".\n" +
432+ filterRanges += "{#date range " + i + "\n?value (p:" + this . appliedRanges [ i ] . filterValue + "/psv:" + this . appliedRanges [ i ] . filterValue + ") ?timenode" + i + " .\n" +
433+ "?timenode" + i + " wikibase:timeValue ?time" + i + " .\n" +
434+ "?timenode" + i + " wikibase:timePrecision ?timeprecision" + i + " .\n" +
435435"FILTER(?timeprecision" + i + ">=" + timePrecision + ") .\n" +
436436"FILTER('" + this . appliedRanges [ i ] . valueLL + "'^^xsd:dateTime <= ?time" + i + " && ?time" + i + " < '" + this . appliedRanges [ i ] . valueUL + "'^^xsd:dateTime). \n" +
437437"}\n" ;
438438// It would probably be better to group by date here, but unfortunately that makes
439439// the queries too slow in some cases.
440- // constraintString += "FILTER('" + this.appliedRanges[i].valueLL + "'^^xsd:dateTime <= ?tim" + i + " && ?tim" + i + " < '" + this.appliedRanges[i].valueUL + "'^^xsd:dateTime).\n";
440+ // constraintString += "FILTER('" + this.appliedRanges[i].valueLL + "'^^xsd:dateTime <= ?tim" + i + " && ?tim" + i + " < '" + this.appliedRanges[i].valueUL + "'^^xsd:dateTime) .\n";
441441// maxString += "(MAX(?time" + i + ") AS ?tim" + i + ") ";
442442}
443443}
444444let filterQuantities = "" ;
445445for ( let i = 0 ; i < this . appliedQuantities . length ; i ++ ) {
446446if ( this . appliedQuantities [ i ] . parentFilterValue ) {
447447if ( this . appliedQuantities [ i ] . valueLL == "novalue" ) {
448- noValueString += "{#quantity range " + i + "\n FILTER(NOT EXISTS { ?value wdt:" + this . appliedQuantities [ i ] . filterValue + " ?no. }).\n}"
448+ noValueString += "{#quantity range " + i + "\n FILTER(NOT EXISTS { ?value wdt:" + this . appliedQuantities [ i ] . filterValue + " ?no. }) .\n}"
449449}
450450else if ( this . appliedQuantities [ i ] . unit == "" ) {
451- filterQuantities += "{#quantity range " + i + "\n?value wdt:" + this . appliedQuantities [ i ] . parentFilterValue + " ?temp" + i + ".\n" +
451+ filterQuantities += "{#quantity range " + i + "\n?value wdt:" + this . appliedQuantities [ i ] . parentFilterValue + " ?temp" + i + " .\n" +
452452( centralSPARQLService ?"SERVICE <" + centralSPARQLService + "> {\n" :'' ) +
453- "?temp" + i + " (p:" + this . appliedQuantities [ i ] . filterValue + "/psv:" + this . appliedQuantities [ i ] . filterValue + ") ?amount" + i + ".\n" +
453+ "?temp" + i + " (p:" + this . appliedQuantities [ i ] . filterValue + "/psv:" + this . appliedQuantities [ i ] . filterValue + ") ?amount" + i + " .\n" +
454454" ?amount" + i + " wikibase:quantityAmount ?amountValue" + i + " .\n}" +
455455( centralSPARQLService ?"}\n" :'' ) ;
456456constraintString += "FILTER(" + this . appliedQuantities [ i ] . valueUL + " >= ?qua" + i + " && ?qua" + i + " >=" + this . appliedQuantities [ i ] . valueLL + ")\n" ;
457457maxString += "(MAX(?amountValue" + i + ") AS ?qua" + i + ") " ;
458458}
459459else {
460- filterQuantities += "{#quantity range " + i + "\n?value wdt:" + this . appliedQuantities [ i ] . parentFilterValue + " ?temp" + i + ".\n" +
460+ filterQuantities += "{#quantity range " + i + "\n?value wdt:" + this . appliedQuantities [ i ] . parentFilterValue + " ?temp" + i + " .\n" +
461461( centralSPARQLService ?"SERVICE <" + centralSPARQLService + "> {\n" :'' ) +
462- "?temp" + i + " (p:" + this . appliedQuantities [ i ] . filterValue + "/psn:" + this . appliedQuantities [ i ] . filterValue + ") ?amount" + i + ".\n" +
463- " ?amount" + i + " wikibase:quantityAmount ?amountValue" + i + ".\n}" +
462+ "?temp" + i + " (p:" + this . appliedQuantities [ i ] . filterValue + "/psn:" + this . appliedQuantities [ i ] . filterValue + ") ?amount" + i + " .\n" +
463+ " ?amount" + i + " wikibase:quantityAmount ?amountValue" + i + " .\n}" +
464464( centralSPARQLService ?"}\n" :'' ) ;
465465constraintString += "FILTER(" + this . appliedQuantities [ i ] . valueUL + " >= ?qua" + i + " && ?qua" + i + " >=" + this . appliedQuantities [ i ] . valueLL + ")\n" ;
466466maxString += "(MAX(?amountValue" + i + ") AS ?qua" + i + ") " ;
467467}
468468}
469469else {
470470if ( this . appliedQuantities [ i ] . valueLL == "novalue" ) {
471- noValueString += "{#quantity range " + i + "\n FILTER(NOT EXISTS { ?value wdt:" + this . appliedQuantities [ i ] . filterValue + " ?no. }).\n}"
471+ noValueString += "{#quantity range " + i + "\n FILTER(NOT EXISTS { ?value wdt:" + this . appliedQuantities [ i ] . filterValue + " ?no. }) .\n}"
472472}
473473else if ( this . appliedQuantities [ i ] . unit == "" ) {
474- filterQuantities += "{#quantity range " + i + "\n?value (p:" + this . appliedQuantities [ i ] . filterValue + "/psv:" + this . appliedQuantities [ i ] . filterValue + ") ?amount" + i + ".\n" +
475- " ?amount" + i + " wikibase:quantityAmount ?amountValue" + i + ".\n}" ;
474+ filterQuantities += "{#quantity range " + i + "\n?value (p:" + this . appliedQuantities [ i ] . filterValue + "/psv:" + this . appliedQuantities [ i ] . filterValue + ") ?amount" + i + " .\n" +
475+ " ?amount" + i + " wikibase:quantityAmount ?amountValue" + i + " .\n}" ;
476476constraintString += "FILTER(" + this . appliedQuantities [ i ] . valueUL + " >= ?qua" + i + " && ?qua" + i + " >=" + this . appliedQuantities [ i ] . valueLL + ")\n" ;
477477maxString += "(MAX(?amountValue" + i + ") AS ?qua" + i + ") " ;
478478}
479479else {
480- filterQuantities += "{#quantity range " + i + "\n?value (p:" + this . appliedQuantities [ i ] . filterValue + "/psn:" + this . appliedQuantities [ i ] . filterValue + ") ?amount" + i + ".\n" +
481- " ?amount" + i + " wikibase:quantityAmount ?amountValue" + i + ".\n}" ;
480+ filterQuantities += "{#quantity range " + i + "\n?value (p:" + this . appliedQuantities [ i ] . filterValue + "/psn:" + this . appliedQuantities [ i ] . filterValue + ") ?amount" + i + " .\n" +
481+ " ?amount" + i + " wikibase:quantityAmount ?amountValue" + i + " .\n}" ;
482482constraintString += "FILTER(" + this . appliedQuantities [ i ] . valueUL + ">=?qua" + i + " && ?qua" + i + ">=" + this . appliedQuantities [ i ] . valueLL + ")\n" ;
483483maxString += "(MAX(?amountValue" + i + ") AS ?qua" + i + ") " ;
484484}