Quantcast

Duplicate Category Names In #ask Query

classic Classic list List threaded Threaded
4 messages Options
jk
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Duplicate Category Names In #ask Query

jk
Hello,

I've searched for my issue, but maybe I'm using the wrong search terms. I apologize in advance if this is a duplicate question. Please kindly direct me to the appropriate email if this is the case.

Here is my issue:

I have this query on my main page:
{{#ask:
 [[:Category:+]]
 |format=ul
}}
This query lists all the pages in the Category namespace and links to them.

This is what it should look like:
- Category Name [https://url/Category:Category_Name]
- Category Name2 [https://url/Category:Category_Name2]
etc.

However, when I perform this query, any category page that contains an #ask query of its own causes the following to happen:
- Category Name [https://url/Category:Category_Name]
- Category Name [https://url/Category:Category_Name#_QUERY09d6470325cccaf2a3fa7b3ddffae43b]
- Category Name2 [https://url/Category:Category_Name2]
etc.

As an example, the "Category Name" category page found at https://url/Category:Category_Name and https://url/Category:Category_Name#_QUERY09d6470325cccaf2a3fa7b3ddffae43b (even though this second URL is simply the same page) could contain the following query:
{{#ask:
 [[Category:{{PAGENAME}}]]
 |mainlabel=My Main Label
 |?Property 1
 |?Property 2
 |format=table
}

For some reason, my original query produces duplicate entries with a second unnecessary link containing an extraneous reference. Any thoughts on how to resolve this would be much appreciated.

Unfortunately I don't currently have access to the Special section of the site or to the server, which is making it hard for me to figure out the version of Mediawiki/Semantic Mediawiki that I have. The semantic mediawiki installation is not that old (~August 2016), so I'm assuming our versions are pretty close to what was stable at the point in time.

Thank you.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Duplicate Category Names In #ask Query

James HK
Hi,

> For some reason, my original query produces duplicate entries with a second
> unnecessary link containing an extraneous reference. Any thoughts on how to
> resolve this would be much appreciated.

Looking at your query, `[[:Category:+]]` which in fact is a namespace
query and tells the system to bring forth all entities that match the
Category namespace (which includes subobject entities such as those
marked with _QUERY...).

When creating queries within a namespace like `Category:` then
naturally those objects belong to the same namespace there are
embedded in and the same thing would happen if you were to create
entities using #subobject in the Category namespace.

For the query condition `[[:Category:+]]` (== get me all what you can
find in the Category namespace) the results are correct even though
this isn't exactly what you want but the interpretation of the
condition is accurate which means you need another condition that
reduces the result set.

I'd suggest you create a ticket at [0], so we can track the issue and
maybe come up with a more genuine solution in future.

[0] https://github.com/SemanticMediaWiki/SemanticMediaWiki/issues

Cheers

On 1/26/17, jk <[hidden email]> wrote:

> Hello,
>
> I've searched for my issue, but maybe I'm using the wrong search terms. I
> apologize in advance if this is a duplicate question. Please kindly direct
> me to the appropriate email if this is the case.
>
> Here is my issue:
>
> I have this query on my main page:
> {{#ask:
>  [[:Category:+]]
>  |format=ul
> }}
> This query lists all the pages in the Category namespace and links to them.
>
> This is what it should look like:
> - Category Name [https://url/Category:Category_Name]
> - Category Name2 [https://url/Category:Category_Name2]
> etc.
>
> However, when I perform this query, any category page that contains an #ask
> query of its own causes the following to happen:
> - Category Name [https://url/Category:Category_Name]
> - Category Name
> [https://url/Category:Category_Name#_QUERY09d6470325cccaf2a3fa7b3ddffae43b]
> - Category Name2 [https://url/Category:Category_Name2]
> etc.
>
> As an example, the "Category Name" category page found at
> https://url/Category:Category_Name and
> https://url/Category:Category_Name#_QUERY09d6470325cccaf2a3fa7b3ddffae43b
> (even though this second URL is simply the same page) could contain the
> following query:
> {{#ask:
>  [[Category:{{PAGENAME}}]]
>  |mainlabel=My Main Label
>  |?Property 1
>  |?Property 2
>  |format=table
> }
>
> For some reason, my original query produces duplicate entries with a second
> unnecessary link containing an extraneous reference. Any thoughts on how to
> resolve this would be much appreciated.
>
> Unfortunately I don't currently have access to the Special section of the
> site or to the server, which is making it hard for me to figure out the
> version of Mediawiki/Semantic Mediawiki that I have. The semantic mediawiki
> installation is not that old (~August 2016), so I'm assuming our versions
> are pretty close to what was stable at the point in time.
>
> Thank you.
>
>
>
> --
> View this message in context:
> http://wikimedia.7.x6.nabble.com/Duplicate-Category-Names-In-ask-Query-tp5071202.html
> Sent from the Semantic Mediawiki - User mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Semediawiki-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Duplicate Category Names In #ask Query

James HK
Hi,

> I'd suggest you create a ticket at [0], so we can track the issue and
> maybe come up with a more genuine solution in future.

I added some suggestions in [0] to the content of this thread.

[0] https://github.com/SemanticMediaWiki/SemanticMediaWiki/issues/2222

Cheers

On 1/29/17, James HK <[hidden email]> wrote:

> Hi,
>
>> For some reason, my original query produces duplicate entries with a
>> second
>> unnecessary link containing an extraneous reference. Any thoughts on how
>> to
>> resolve this would be much appreciated.
>
> Looking at your query, `[[:Category:+]]` which in fact is a namespace
> query and tells the system to bring forth all entities that match the
> Category namespace (which includes subobject entities such as those
> marked with _QUERY...).
>
> When creating queries within a namespace like `Category:` then
> naturally those objects belong to the same namespace there are
> embedded in and the same thing would happen if you were to create
> entities using #subobject in the Category namespace.
>
> For the query condition `[[:Category:+]]` (== get me all what you can
> find in the Category namespace) the results are correct even though
> this isn't exactly what you want but the interpretation of the
> condition is accurate which means you need another condition that
> reduces the result set.
>
> I'd suggest you create a ticket at [0], so we can track the issue and
> maybe come up with a more genuine solution in future.
>
> [0] https://github.com/SemanticMediaWiki/SemanticMediaWiki/issues
>
> Cheers
>
> On 1/26/17, jk <[hidden email]> wrote:
>> Hello,
>>
>> I've searched for my issue, but maybe I'm using the wrong search terms. I
>> apologize in advance if this is a duplicate question. Please kindly
>> direct
>> me to the appropriate email if this is the case.
>>
>> Here is my issue:
>>
>> I have this query on my main page:
>> {{#ask:
>>  [[:Category:+]]
>>  |format=ul
>> }}
>> This query lists all the pages in the Category namespace and links to
>> them.
>>
>> This is what it should look like:
>> - Category Name [https://url/Category:Category_Name]
>> - Category Name2 [https://url/Category:Category_Name2]
>> etc.
>>
>> However, when I perform this query, any category page that contains an
>> #ask
>> query of its own causes the following to happen:
>> - Category Name [https://url/Category:Category_Name]
>> - Category Name
>> [https://url/Category:Category_Name#_QUERY09d6470325cccaf2a3fa7b3ddffae43b]
>> - Category Name2 [https://url/Category:Category_Name2]
>> etc.
>>
>> As an example, the "Category Name" category page found at
>> https://url/Category:Category_Name and
>> https://url/Category:Category_Name#_QUERY09d6470325cccaf2a3fa7b3ddffae43b
>> (even though this second URL is simply the same page) could contain the
>> following query:
>> {{#ask:
>>  [[Category:{{PAGENAME}}]]
>>  |mainlabel=My Main Label
>>  |?Property 1
>>  |?Property 2
>>  |format=table
>> }
>>
>> For some reason, my original query produces duplicate entries with a
>> second
>> unnecessary link containing an extraneous reference. Any thoughts on how
>> to
>> resolve this would be much appreciated.
>>
>> Unfortunately I don't currently have access to the Special section of the
>> site or to the server, which is making it hard for me to figure out the
>> version of Mediawiki/Semantic Mediawiki that I have. The semantic
>> mediawiki
>> installation is not that old (~August 2016), so I'm assuming our versions
>> are pretty close to what was stable at the point in time.
>>
>> Thank you.
>>
>>
>>
>> --
>> View this message in context:
>> http://wikimedia.7.x6.nabble.com/Duplicate-Category-Names-In-ask-Query-tp5071202.html
>> Sent from the Semantic Mediawiki - User mailing list archive at
>> Nabble.com.
>>
>> ------------------------------------------------------------------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>> _______________________________________________
>> Semediawiki-user mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>>
>

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
jk
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Duplicate Category Names In #ask Query

jk
Thank you James, I appreciate your assistance and value your explanation.
Loading...