« Utilisateur:Carlo666/Test/Test5 » : différence entre les versions

De Semantic MediaWiki - Sandbox
Aucun résumé des modifications
Balise : Éditeur de wikicode 2017
Aucun résumé des modifications
Balise : Éditeur de wikicode 2017
Ligne 10 : Ligne 10 :
}}
}}


== Trying to filter pages by '#' character ==
== Filtering pages by '#' character in the page name ==


Trying to exclude pages with page name containing '#' produces no results:
Trying to exclude pages with page name containing '#' produces no results:
Ligne 24 : Ligne 24 :
}}
}}


Trying to escape '#' does not filter anything:
If we escape '#' nothing is filtered:
<pre>{{#ask:
<pre>{{#ask:
   [[~{{FULLPAGENAME}}/*]]
   [[~{{FULLPAGENAME}}/*]]
Ligne 33 : Ligne 33 :
   [[~{{FULLPAGENAME}}/*]]
   [[~{{FULLPAGENAME}}/*]]
   [[!~*\#*]]
   [[!~*\#*]]
  |?note
   |format=ul
   |format=ul
}}
}}
Ligne 46 : Ligne 45 :
   [[~{{FULLPAGENAME}}/*]]
   [[~{{FULLPAGENAME}}/*]]
   [[!~*sub*]]
   [[!~*sub*]]
  |?note
   |format=ul
   |format=ul
}}
}}


 
Adding '#' (escaped or not) to the "not like" conditions replicates the above results:
<pre>{{#ask:
<pre>{{#ask:
   [[~{{FULLPAGENAME}}/*]]
   [[~{{FULLPAGENAME}}/*]]
Ligne 59 : Ligne 57 :
   [[~{{FULLPAGENAME}}/*]]
   [[~{{FULLPAGENAME}}/*]]
   [[!~*#sub*]]
   [[!~*#sub*]]
  |?note
   |format=ul
   |format=ul
}}
}}
Ligne 71 : Ligne 68 :
   [[~{{FULLPAGENAME}}/*]]
   [[~{{FULLPAGENAME}}/*]]
   [[!~*\#sub*]]
   [[!~*\#sub*]]
  |?note
   |format=ul
   |format=ul
}}
}}


== Trying to filter subobjects by text properties ==
Now we try to return only pages with page name containing '#', unsuccessfully:
<pre>{{#ask:
  [[~{{FULLPAGENAME}}/*]]
  [[~*#*]]
  |format=ul
}}</pre>
{{#ask:
  [[~{{FULLPAGENAME}}/*]]
  [[~*#*]]
  |format=ul
}}
 
Escaping '#'
<pre>{{#ask:
  [[~{{FULLPAGENAME}}/*]]
  [[~*\#*]]
  |format=ul
}}</pre>
{{#ask:
  [[~{{FULLPAGENAME}}/*]]
  [[~*\#*]]
  |format=ul
}}
 
== Filtering subobjects by text properties ==
A text property whose value is equal to the page name as returned above is defined in subpages and subobject.


* Excluding pages with property not containing '#' does not work:
Excluding pages with property containing '#' does not filter anything:
<pre>{{#ask:
<pre>{{#ask:
   [[~{{FULLPAGENAME}}/*]]
   [[~{{FULLPAGENAME}}/*]]
Ligne 89 : Ligne 110 :
}}
}}


* Same results when '#' is escaped:
Same results when '#' is escaped:
<pre>{{#ask:
<pre>{{#ask:
   [[~{{FULLPAGENAME}}/*]]
   [[~{{FULLPAGENAME}}/*]]
Ligne 101 : Ligne 122 :
}}
}}


* Now select only pages with property containing '#':
Selecting only pages with property containing '#' produces the expected result:
<pre>{{#ask:
<pre>{{#ask:
   [[~{{FULLPAGENAME}}/*]]
   [[~{{FULLPAGENAME}}/*]]
Ligne 113 : Ligne 134 :
}}
}}


* When '#' is escaped no result is returned:
When '#' is escaped no result is returned:
<pre>{{#ask:
<pre>{{#ask:
   [[~{{FULLPAGENAME}}/*]]
   [[~{{FULLPAGENAME}}/*]]

Version du 25 septembre 2019 à 12:53

Problem

This query return subpages of current page but also subobjects contained therein:

{{#ask:
  [[~{{FULLPAGENAME}}/*]]
  |format=ul
}}

Filtering pages by '#' character in the page name

Trying to exclude pages with page name containing '#' produces no results:

{{#ask:
  [[~{{FULLPAGENAME}}/*]]
  [[!~*#*]]
  |format=ul
}}


If we escape '#' nothing is filtered:

{{#ask:
  [[~{{FULLPAGENAME}}/*]]
  [[!~*\#*]]
  |format=ul
}}

Filtering by a substring of the subobject id works fine:

{{#ask:
  [[~{{FULLPAGENAME}}/*]]
  [[!~*sub*]]
  |format=ul
}}

Adding '#' (escaped or not) to the "not like" conditions replicates the above results:

{{#ask:
  [[~{{FULLPAGENAME}}/*]]
  [[!~*#sub*]]
  |format=ul
}}


{{#ask:
  [[~{{FULLPAGENAME}}/*]]
  [[!~*\#sub*]]
  |format=ul
}}

Now we try to return only pages with page name containing '#', unsuccessfully:

{{#ask:
  [[~{{FULLPAGENAME}}/*]]
  [[~*#*]]
  |format=ul
}}

Escaping '#'

{{#ask:
  [[~{{FULLPAGENAME}}/*]]
  [[~*\#*]]
  |format=ul
}}


Filtering subobjects by text properties

A text property whose value is equal to the page name as returned above is defined in subpages and subobject.

Excluding pages with property containing '#' does not filter anything:

{{#ask:
  [[~{{FULLPAGENAME}}/*]]
  [[SomeTestProperty::!~*#*]]
  |?SomeTestProperty
}}


Same results when '#' is escaped:

{{#ask:
  [[~{{FULLPAGENAME}}/*]]
  [[SomeTestProperty::!~*\#*]]
  |?SomeTestProperty
}}


Selecting only pages with property containing '#' produces the expected result:

{{#ask:
  [[~{{FULLPAGENAME}}/*]]
  [[SomeTestProperty::~*#*]]
  |?SomeTestProperty
}}
 SomeTestProperty
Carlo666/Test/Test5/Page2Carlo666/Test/Test5/Page2#sub1

When '#' is escaped no result is returned:

{{#ask:
  [[~{{FULLPAGENAME}}/*]]
  [[SomeTestProperty::~*\#*]]
  |?SomeTestProperty
}}
Les cookies nous aident à fournir nos services. En utilisant nos services, vous acceptez notre utilisation de cookies.