Option for non exclusive "+" wild card.

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Option for non exclusive "+" wild card.

George, Garrett J. (JSC-CB111)[SGT, INC]
Hey all,

I've been working with some custom namespaces and am wondering if there is a way to utilize the "+" wildcard, i.e. [[CustomNamespace:+]], but have it be exclusive.
I'm not saying I want to just magically have it work differently but is there an equivalent to that which isn't exclusive. I want to be able to search a category within a namespace. My goal would be able to do [[CustomNamespace:+]][[Category:Meeting]]. But currently "+" is exclusive so once it sees the wildcard it breaks from the query parsing and treats it as [[CustomNamespace:+]].

Thanks,
Garrett
------------------------------------------------------------------------------
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
|

Re: Option for non exclusive "+" wild card.

James Montalvo
I created the following pages:

* Help:A category A page
* Help:A category B page
* Project:A category B page
* Project:A category A page
* A category A page   (e.g. main namespace)
* A category B page   (e.g. main namespace)

Each of these pages has the category specified in the title (e.g.
[[Category:A]] or [[Category:B]]). Each of them also has the following
property set: [[Has date::2017-05-20]]. Also note that the "Project"
namespace is an alias for your wiki's name, such that a wiki named "Demo
Wiki" would have a page [[Project:A category B page]] that you could also
call [[Demo Wiki:A category B page]].

>From the queries below you can see how to specify categories and namespaces
for querying. I think the least obvious thing is how to specify the main
namespace. For the Help namespace you do [[Help:+]] but since the main
namespace doesn't really have any title text you do [[:+]].

Does this help?

== Ask Category:A ==
{{#ask: [[Category:A]]
  |? Has date
}}

== Ask Category:B ==
{{#ask: [[Category:B]]
  |? Has date
}}

== Ask Category:A and Help:+ ==
{{#ask: [[Category:A]] [[Help:+]]
  |? Has date
}}

== Ask Category:A and Project:+ ==
{{#ask: [[Category:A]] [[Project:+]]
  |? Has date
}}

== Ask Category:B and Help:+ ==
{{#ask: [[Category:B]] [[Help:+]]
  |? Has date
}}

== Ask Category:B and Project:+ ==
{{#ask: [[Category:B]] [[Project:+]]
  |? Has date
}}

== Ask Category:A and Main:+ ==
{{#ask: [[Category:A]] [[:+]]
  |? Has date
}}

== Ask Category:B and Main:+ ==
{{#ask: [[Category:B]] [[:+]]
  |? Has date
}}




On Mon, May 15, 2017 at 8:45 AM, George, Garrett J. (JSC-CB111)[SGT, INC] <
[hidden email]> wrote:

> Hey all,
>
> I've been working with some custom namespaces and am wondering if there is
> a way to utilize the "+" wildcard, i.e. [[CustomNamespace:+]], but have it
> be exclusive.
> I'm not saying I want to just magically have it work differently but is
> there an equivalent to that which isn't exclusive. I want to be able to
> search a category within a namespace. My goal would be able to do
> [[CustomNamespace:+]][[Category:Meeting]]. But currently "+" is exclusive
> so once it sees the wildcard it breaks from the query parsing and treats it
> as [[CustomNamespace:+]].
>
> Thanks,
> Garrett
> ------------------------------------------------------------
> ------------------
> 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
|

Re: Option for non exclusive "+" wild card.

James HK
In reply to this post by George, Garrett J. (JSC-CB111)[SGT, INC]
Hi,

> way to utilize the "+" wildcard, i.e. [[CustomNamespace:+]], but have it be
> exclusive.

I'm not entirely sure what you refer to as "exclusive".

> My goal would be able to do [[CustomNamespace:+]][[Category:Meeting]].

This query will apply a conjunctive condition as to "all entities with
category Meeting that are contained within the CustomNamespace" (as
demonstrated by [0]).

Currently it does what is expected of it, so what is the behviour you
have envisioned?

[0] https://sandbox.semantic-mediawiki.org/wiki/CategoryWithNamespaceTest

Cheers

On 5/15/17, George, Garrett J. (JSC-CB111)[SGT, INC]
<[hidden email]> wrote:

> Hey all,
>
> I've been working with some custom namespaces and am wondering if there is a
> way to utilize the "+" wildcard, i.e. [[CustomNamespace:+]], but have it be
> exclusive.
> I'm not saying I want to just magically have it work differently but is
> there an equivalent to that which isn't exclusive. I want to be able to
> search a category within a namespace. My goal would be able to do
> [[CustomNamespace:+]][[Category:Meeting]]. But currently "+" is exclusive so
> once it sees the wildcard it breaks from the query parsing and treats it as
> [[CustomNamespace:+]].
>
> Thanks,
> Garrett
> ------------------------------------------------------------------------------
> 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
|

Re: Option for non exclusive "+" wild card.

George, Garrett J. (JSC-CB111)[SGT, INC]
That’s what I believed to be the solution to the problem however I’m not getting the proper pages to be returned when I run this ajax request.

$.ajax({
    url: mw.util.wikiScript("api"),
    data: {
      format: "json",
      action: "ask",
      query: "[[Category:Meeting Minutes]] [[Console:+]]"
    },
    dataType: "json",
    success: function(data) {
      console.log(data)
    },
    error: function(xhr) {
      console.log("Error: Request Failed")
    }
  })
};

It doesn’t return any error so it’s running through the parser properly but I’m not getting any of the pages.

The category page contains 2 pages from the Console namespace in the category Meeting Minutes similar to how your custom namespaces are. But when I execute the ajax request I don't get any pages. Data.query.results is an empty array.

-----Original Message-----
From: James HK [mailto:[hidden email]]
Sent: Monday, May 15, 2017 9:50 AM
To: George, Garrett J. (JSC-CB111)[SGT, INC] <[hidden email]>
Cc: [hidden email]
Subject: Re: [Semediawiki-user] Option for non exclusive "+" wild card.

Hi,

> way to utilize the "+" wildcard, i.e. [[CustomNamespace:+]], but have
> it be exclusive.

I'm not entirely sure what you refer to as "exclusive".

> My goal would be able to do [[CustomNamespace:+]][[Category:Meeting]].

This query will apply a conjunctive condition as to "all entities with category Meeting that are contained within the CustomNamespace" (as demonstrated by [0]).

Currently it does what is expected of it, so what is the behviour you have envisioned?

[0] https://sandbox.semantic-mediawiki.org/wiki/CategoryWithNamespaceTest

Cheers

On 5/15/17, George, Garrett J. (JSC-CB111)[SGT, INC] <[hidden email]> wrote:

> Hey all,
>
> I've been working with some custom namespaces and am wondering if
> there is a way to utilize the "+" wildcard, i.e.
> [[CustomNamespace:+]], but have it be exclusive.
> I'm not saying I want to just magically have it work differently but
> is there an equivalent to that which isn't exclusive. I want to be
> able to search a category within a namespace. My goal would be able to
> do [[CustomNamespace:+]][[Category:Meeting]]. But currently "+" is
> exclusive so once it sees the wildcard it breaks from the query
> parsing and treats it as [[CustomNamespace:+]].
>
> Thanks,
> Garrett
> ----------------------------------------------------------------------
> -------- 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
|

Re: Option for non exclusive "+" wild card.

James HK
Hi,

> That’s what I believed to be the solution to the problem however I’m not
> getting the proper pages to be returned when I run this ajax request
> It doesn’t return any error so it’s running through the parser properly but
> I’m not getting any of the pages.

As for the API #ask output of the mentioned request, it shows the same
result [0, 1].

[0] https://sandbox.semantic-mediawiki.org/w/api.php?action=ask&query=[[Category:CategoryWithNamespaceTest]]

[1] https://sandbox.semantic-mediawiki.org/w/api.php?action=ask&query=[[Category:CategoryWithNamespaceTest]][[Help:%2B]]

Cheers

On 5/15/17, George, Garrett J. (JSC-CB111)[SGT, INC]
<[hidden email]> wrote:

> That’s what I believed to be the solution to the problem however I’m not
> getting the proper pages to be returned when I run this ajax request.
>
> $.ajax({
>     url: mw.util.wikiScript("api"),
>     data: {
>       format: "json",
>       action: "ask",
>       query: "[[Category:Meeting Minutes]] [[Console:+]]"
>     },
>     dataType: "json",
>     success: function(data) {
>       console.log(data)
>     },
>     error: function(xhr) {
>       console.log("Error: Request Failed")
>     }
>   })
> };
>
> It doesn’t return any error so it’s running through the parser properly but
> I’m not getting any of the pages.
>
> The category page contains 2 pages from the Console namespace in the
> category Meeting Minutes similar to how your custom namespaces are. But when
> I execute the ajax request I don't get any pages. Data.query.results is an
> empty array.
>
> -----Original Message-----
> From: James HK [mailto:[hidden email]]
> Sent: Monday, May 15, 2017 9:50 AM
> To: George, Garrett J. (JSC-CB111)[SGT, INC] <[hidden email]>
> Cc: [hidden email]
> Subject: Re: [Semediawiki-user] Option for non exclusive "+" wild card.
>
> Hi,
>
>> way to utilize the "+" wildcard, i.e. [[CustomNamespace:+]], but have
>> it be exclusive.
>
> I'm not entirely sure what you refer to as "exclusive".
>
>> My goal would be able to do [[CustomNamespace:+]][[Category:Meeting]].
>
> This query will apply a conjunctive condition as to "all entities with
> category Meeting that are contained within the CustomNamespace" (as
> demonstrated by [0]).
>
> Currently it does what is expected of it, so what is the behviour you have
> envisioned?
>
> [0] https://sandbox.semantic-mediawiki.org/wiki/CategoryWithNamespaceTest
>
> Cheers
>
> On 5/15/17, George, Garrett J. (JSC-CB111)[SGT, INC]
> <[hidden email]> wrote:
>> Hey all,
>>
>> I've been working with some custom namespaces and am wondering if
>> there is a way to utilize the "+" wildcard, i.e.
>> [[CustomNamespace:+]], but have it be exclusive.
>> I'm not saying I want to just magically have it work differently but
>> is there an equivalent to that which isn't exclusive. I want to be
>> able to search a category within a namespace. My goal would be able to
>> do [[CustomNamespace:+]][[Category:Meeting]]. But currently "+" is
>> exclusive so once it sees the wildcard it breaks from the query
>> parsing and treats it as [[CustomNamespace:+]].
>>
>> Thanks,
>> Garrett
>> ----------------------------------------------------------------------
>> -------- 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
|

Re: Option for non exclusive "+" wild card.

George, Garrett J. (JSC-CB111)[SGT, INC]
It shows the same for me, but only for help. Help is under the default namespaces to be searched. However, my custom namespace is not being tracked properly. I'm not sure if there's some code to go into DefaultSettings.php for SMW or LocalSettings.php for MW.

It's possible that under /SemanticMediaWiki/includes/query/SMW_QueryParser.php in the function getArticleDescription() the line
    $idx = \SMW\Localizer::getInstance()->getNamespaceIndexByName( $list[0] );
Is acting up when called with a category.

Querying just for [[Console:+]] works but when I combine it with a category it's not working.

-----Original Message-----
From: James HK [mailto:[hidden email]]
Sent: Monday, May 15, 2017 10:01 AM
To: George, Garrett J. (JSC-CB111)[SGT, INC] <[hidden email]>
Cc: [hidden email]
Subject: Re: [Semediawiki-user] Option for non exclusive "+" wild card.

Hi,

> That’s what I believed to be the solution to the problem however I’m
> not getting the proper pages to be returned when I run this ajax
> request It doesn’t return any error so it’s running through the parser
> properly but I’m not getting any of the pages.

As for the API #ask output of the mentioned request, it shows the same result [0, 1].

[0] https://sandbox.semantic-mediawiki.org/w/api.php?action=ask&query=[[Category:CategoryWithNamespaceTest]]

[1] https://sandbox.semantic-mediawiki.org/w/api.php?action=ask&query=[[Category:CategoryWithNamespaceTest]][[Help:%2B]]

Cheers

On 5/15/17, George, Garrett J. (JSC-CB111)[SGT, INC] <[hidden email]> wrote:

> That’s what I believed to be the solution to the problem however I’m
> not getting the proper pages to be returned when I run this ajax request.
>
> $.ajax({
>     url: mw.util.wikiScript("api"),
>     data: {
>       format: "json",
>       action: "ask",
>       query: "[[Category:Meeting Minutes]] [[Console:+]]"
>     },
>     dataType: "json",
>     success: function(data) {
>       console.log(data)
>     },
>     error: function(xhr) {
>       console.log("Error: Request Failed")
>     }
>   })
> };
>
> It doesn’t return any error so it’s running through the parser
> properly but I’m not getting any of the pages.
>
> The category page contains 2 pages from the Console namespace in the
> category Meeting Minutes similar to how your custom namespaces are.
> But when I execute the ajax request I don't get any pages.
> Data.query.results is an empty array.
>
> -----Original Message-----
> From: James HK [mailto:[hidden email]]
> Sent: Monday, May 15, 2017 9:50 AM
> To: George, Garrett J. (JSC-CB111)[SGT, INC]
> <[hidden email]>
> Cc: [hidden email]
> Subject: Re: [Semediawiki-user] Option for non exclusive "+" wild card.
>
> Hi,
>
>> way to utilize the "+" wildcard, i.e. [[CustomNamespace:+]], but have
>> it be exclusive.
>
> I'm not entirely sure what you refer to as "exclusive".
>
>> My goal would be able to do [[CustomNamespace:+]][[Category:Meeting]].
>
> This query will apply a conjunctive condition as to "all entities with
> category Meeting that are contained within the CustomNamespace" (as
> demonstrated by [0]).
>
> Currently it does what is expected of it, so what is the behviour you
> have envisioned?
>
> [0]
> https://sandbox.semantic-mediawiki.org/wiki/CategoryWithNamespaceTest
>
> Cheers
>
> On 5/15/17, George, Garrett J. (JSC-CB111)[SGT, INC]
> <[hidden email]> wrote:
>> Hey all,
>>
>> I've been working with some custom namespaces and am wondering if
>> there is a way to utilize the "+" wildcard, i.e.
>> [[CustomNamespace:+]], but have it be exclusive.
>> I'm not saying I want to just magically have it work differently but
>> is there an equivalent to that which isn't exclusive. I want to be
>> able to search a category within a namespace. My goal would be able
>> to do [[CustomNamespace:+]][[Category:Meeting]]. But currently "+" is
>> exclusive so once it sees the wildcard it breaks from the query
>> parsing and treats it as [[CustomNamespace:+]].
>>
>> Thanks,
>> Garrett
>> ---------------------------------------------------------------------
>> -
>> -------- 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
|

Re: Option for non exclusive "+" wild card.

James HK
Hi,

> namespaces to be searched. However, my custom namespace is not being tracke

I suspect you followed the recommendation of [0], right?

[0] https://www.semantic-mediawiki.org/wiki/Help:Custom_namespaces

Cheers

On 5/16/17, George, Garrett J. (JSC-CB111)[SGT, INC]
<[hidden email]> wrote:

> It shows the same for me, but only for help. Help is under the default
> namespaces to be searched. However, my custom namespace is not being tracked
> properly. I'm not sure if there's some code to go into DefaultSettings.php
> for SMW or LocalSettings.php for MW.
>
> It's possible that under
> /SemanticMediaWiki/includes/query/SMW_QueryParser.php in the function
> getArticleDescription() the line
>     $idx = \SMW\Localizer::getInstance()->getNamespaceIndexByName( $list[0]
> );
> Is acting up when called with a category.
>
> Querying just for [[Console:+]] works but when I combine it with a category
> it's not working.
>
> -----Original Message-----
> From: James HK [mailto:[hidden email]]
> Sent: Monday, May 15, 2017 10:01 AM
> To: George, Garrett J. (JSC-CB111)[SGT, INC] <[hidden email]>
> Cc: [hidden email]
> Subject: Re: [Semediawiki-user] Option for non exclusive "+" wild card.
>
> Hi,
>
>> That’s what I believed to be the solution to the problem however I’m
>> not getting the proper pages to be returned when I run this ajax
>> request It doesn’t return any error so it’s running through the parser
>> properly but I’m not getting any of the pages.
>
> As for the API #ask output of the mentioned request, it shows the same
> result [0, 1].
>
> [0]
> https://sandbox.semantic-mediawiki.org/w/api.php?action=ask&query=[[Category:CategoryWithNamespaceTest]]
>
> [1]
> https://sandbox.semantic-mediawiki.org/w/api.php?action=ask&query=[[Category:CategoryWithNamespaceTest]][[Help:%2B]]
>
> Cheers
>
> On 5/15/17, George, Garrett J. (JSC-CB111)[SGT, INC]
> <[hidden email]> wrote:
>> That’s what I believed to be the solution to the problem however I’m
>> not getting the proper pages to be returned when I run this ajax request.
>>
>> $.ajax({
>>     url: mw.util.wikiScript("api"),
>>     data: {
>>       format: "json",
>>       action: "ask",
>>       query: "[[Category:Meeting Minutes]] [[Console:+]]"
>>     },
>>     dataType: "json",
>>     success: function(data) {
>>       console.log(data)
>>     },
>>     error: function(xhr) {
>>       console.log("Error: Request Failed")
>>     }
>>   })
>> };
>>
>> It doesn’t return any error so it’s running through the parser
>> properly but I’m not getting any of the pages.
>>
>> The category page contains 2 pages from the Console namespace in the
>> category Meeting Minutes similar to how your custom namespaces are.
>> But when I execute the ajax request I don't get any pages.
>> Data.query.results is an empty array.
>>
>> -----Original Message-----
>> From: James HK [mailto:[hidden email]]
>> Sent: Monday, May 15, 2017 9:50 AM
>> To: George, Garrett J. (JSC-CB111)[SGT, INC]
>> <[hidden email]>
>> Cc: [hidden email]
>> Subject: Re: [Semediawiki-user] Option for non exclusive "+" wild card.
>>
>> Hi,
>>
>>> way to utilize the "+" wildcard, i.e. [[CustomNamespace:+]], but have
>>> it be exclusive.
>>
>> I'm not entirely sure what you refer to as "exclusive".
>>
>>> My goal would be able to do [[CustomNamespace:+]][[Category:Meeting]].
>>
>> This query will apply a conjunctive condition as to "all entities with
>> category Meeting that are contained within the CustomNamespace" (as
>> demonstrated by [0]).
>>
>> Currently it does what is expected of it, so what is the behviour you
>> have envisioned?
>>
>> [0]
>> https://sandbox.semantic-mediawiki.org/wiki/CategoryWithNamespaceTest
>>
>> Cheers
>>
>> On 5/15/17, George, Garrett J. (JSC-CB111)[SGT, INC]
>> <[hidden email]> wrote:
>>> Hey all,
>>>
>>> I've been working with some custom namespaces and am wondering if
>>> there is a way to utilize the "+" wildcard, i.e.
>>> [[CustomNamespace:+]], but have it be exclusive.
>>> I'm not saying I want to just magically have it work differently but
>>> is there an equivalent to that which isn't exclusive. I want to be
>>> able to search a category within a namespace. My goal would be able
>>> to do [[CustomNamespace:+]][[Category:Meeting]]. But currently "+" is
>>> exclusive so once it sees the wildcard it breaks from the query
>>> parsing and treats it as [[CustomNamespace:+]].
>>>
>>> Thanks,
>>> Garrett
>>> ---------------------------------------------------------------------
>>> -
>>> -------- 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
|

Re: Option for non exclusive "+" wild card.

James HK
Hi,

>> namespaces to be searched. However, my custom namespace is not being
>> tracke

[0] was extended and now contains the [[Extra::+]] namespace (is a
custom namespace [1, 2]).

[0] https://sandbox.semantic-mediawiki.org/wiki/CategoryWithNamespaceTest
[1]
https://sandbox.semantic-mediawiki.org/wiki/SMW_Sandbox:Setup_information#Semantic_extensions
[2]
https://sandbox.semantic-mediawiki.org/w/index.php?title=Sp%C3%A9cial%3AIndex&prefix=&namespace=3000

Cheers

On 5/16/17, James HK <[hidden email]> wrote:

> Hi,
>
>> namespaces to be searched. However, my custom namespace is not being
>> tracke
>
> I suspect you followed the recommendation of [0], right?
>
> [0] https://www.semantic-mediawiki.org/wiki/Help:Custom_namespaces
>
> Cheers
>
> On 5/16/17, George, Garrett J. (JSC-CB111)[SGT, INC]
> <[hidden email]> wrote:
>> It shows the same for me, but only for help. Help is under the default
>> namespaces to be searched. However, my custom namespace is not being
>> tracked
>> properly. I'm not sure if there's some code to go into
>> DefaultSettings.php
>> for SMW or LocalSettings.php for MW.
>>
>> It's possible that under
>> /SemanticMediaWiki/includes/query/SMW_QueryParser.php in the function
>> getArticleDescription() the line
>>     $idx = \SMW\Localizer::getInstance()->getNamespaceIndexByName(
>> $list[0]
>> );
>> Is acting up when called with a category.
>>
>> Querying just for [[Console:+]] works but when I combine it with a
>> category
>> it's not working.
>>
>> -----Original Message-----
>> From: James HK [mailto:[hidden email]]
>> Sent: Monday, May 15, 2017 10:01 AM
>> To: George, Garrett J. (JSC-CB111)[SGT, INC] <[hidden email]>
>> Cc: [hidden email]
>> Subject: Re: [Semediawiki-user] Option for non exclusive "+" wild card.
>>
>> Hi,
>>
>>> That’s what I believed to be the solution to the problem however I’m
>>> not getting the proper pages to be returned when I run this ajax
>>> request It doesn’t return any error so it’s running through the parser
>>> properly but I’m not getting any of the pages.
>>
>> As for the API #ask output of the mentioned request, it shows the same
>> result [0, 1].
>>
>> [0]
>> https://sandbox.semantic-mediawiki.org/w/api.php?action=ask&query=[[Category:CategoryWithNamespaceTest]]
>>
>> [1]
>> https://sandbox.semantic-mediawiki.org/w/api.php?action=ask&query=[[Category:CategoryWithNamespaceTest]][[Help:%2B]]
>>
>> Cheers
>>
>> On 5/15/17, George, Garrett J. (JSC-CB111)[SGT, INC]
>> <[hidden email]> wrote:
>>> That’s what I believed to be the solution to the problem however I’m
>>> not getting the proper pages to be returned when I run this ajax
>>> request.
>>>
>>> $.ajax({
>>>     url: mw.util.wikiScript("api"),
>>>     data: {
>>>       format: "json",
>>>       action: "ask",
>>>       query: "[[Category:Meeting Minutes]] [[Console:+]]"
>>>     },
>>>     dataType: "json",
>>>     success: function(data) {
>>>       console.log(data)
>>>     },
>>>     error: function(xhr) {
>>>       console.log("Error: Request Failed")
>>>     }
>>>   })
>>> };
>>>
>>> It doesn’t return any error so it’s running through the parser
>>> properly but I’m not getting any of the pages.
>>>
>>> The category page contains 2 pages from the Console namespace in the
>>> category Meeting Minutes similar to how your custom namespaces are.
>>> But when I execute the ajax request I don't get any pages.
>>> Data.query.results is an empty array.
>>>
>>> -----Original Message-----
>>> From: James HK [mailto:[hidden email]]
>>> Sent: Monday, May 15, 2017 9:50 AM
>>> To: George, Garrett J. (JSC-CB111)[SGT, INC]
>>> <[hidden email]>
>>> Cc: [hidden email]
>>> Subject: Re: [Semediawiki-user] Option for non exclusive "+" wild card.
>>>
>>> Hi,
>>>
>>>> way to utilize the "+" wildcard, i.e. [[CustomNamespace:+]], but have
>>>> it be exclusive.
>>>
>>> I'm not entirely sure what you refer to as "exclusive".
>>>
>>>> My goal would be able to do [[CustomNamespace:+]][[Category:Meeting]].
>>>
>>> This query will apply a conjunctive condition as to "all entities with
>>> category Meeting that are contained within the CustomNamespace" (as
>>> demonstrated by [0]).
>>>
>>> Currently it does what is expected of it, so what is the behviour you
>>> have envisioned?
>>>
>>> [0]
>>> https://sandbox.semantic-mediawiki.org/wiki/CategoryWithNamespaceTest
>>>
>>> Cheers
>>>
>>> On 5/15/17, George, Garrett J. (JSC-CB111)[SGT, INC]
>>> <[hidden email]> wrote:
>>>> Hey all,
>>>>
>>>> I've been working with some custom namespaces and am wondering if
>>>> there is a way to utilize the "+" wildcard, i.e.
>>>> [[CustomNamespace:+]], but have it be exclusive.
>>>> I'm not saying I want to just magically have it work differently but
>>>> is there an equivalent to that which isn't exclusive. I want to be
>>>> able to search a category within a namespace. My goal would be able
>>>> to do [[CustomNamespace:+]][[Category:Meeting]]. But currently "+" is
>>>> exclusive so once it sees the wildcard it breaks from the query
>>>> parsing and treats it as [[CustomNamespace:+]].
>>>>
>>>> Thanks,
>>>> Garrett
>>>> ---------------------------------------------------------------------
>>>> -
>>>> -------- 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
|

Re: Option for non exclusive "+" wild card.

George, Garrett J. (JSC-CB111)[SGT, INC]
In reply to this post by James HK
I believe it's a problem with the setup of the namespace. I have this in my LocalSetting.php.

    define("NS_CONSOLE", 3000);
    $wgExtraNamespaces[NS_CONSOLE] = "Console";
    $wgNamespacesToBeSearchedDefault = array(NS_CONSOLE => true);
    $smwgNamespacesWithSemanticLinks[NS_CONSOLE] = true;
   
When I got to /index.php/Category:Meeting Minutes I see the 2 pages in the Console namespace that should be coming up. But when I run the query nothing shows up.
-----Original Message-----
From: James HK [mailto:[hidden email]]
Sent: Monday, May 15, 2017 10:09 AM
To: George, Garrett J. (JSC-CB111)[SGT, INC] <[hidden email]>
Cc: [hidden email]
Subject: Re: [Semediawiki-user] Option for non exclusive "+" wild card.

Hi,

> namespaces to be searched. However, my custom namespace is not being
> tracke

I suspect you followed the recommendation of [0], right?

[0] https://www.semantic-mediawiki.org/wiki/Help:Custom_namespaces

Cheers

On 5/16/17, George, Garrett J. (JSC-CB111)[SGT, INC] <[hidden email]> wrote:

> It shows the same for me, but only for help. Help is under the default
> namespaces to be searched. However, my custom namespace is not being
> tracked properly. I'm not sure if there's some code to go into
> DefaultSettings.php for SMW or LocalSettings.php for MW.
>
> It's possible that under
> /SemanticMediaWiki/includes/query/SMW_QueryParser.php in the function
> getArticleDescription() the line
>     $idx = \SMW\Localizer::getInstance()->getNamespaceIndexByName(
> $list[0] ); Is acting up when called with a category.
>
> Querying just for [[Console:+]] works but when I combine it with a
> category it's not working.
>
> -----Original Message-----
> From: James HK [mailto:[hidden email]]
> Sent: Monday, May 15, 2017 10:01 AM
> To: George, Garrett J. (JSC-CB111)[SGT, INC]
> <[hidden email]>
> Cc: [hidden email]
> Subject: Re: [Semediawiki-user] Option for non exclusive "+" wild card.
>
> Hi,
>
>> That’s what I believed to be the solution to the problem however I’m
>> not getting the proper pages to be returned when I run this ajax
>> request It doesn’t return any error so it’s running through the
>> parser properly but I’m not getting any of the pages.
>
> As for the API #ask output of the mentioned request, it shows the same
> result [0, 1].
>
> [0]
> https://sandbox.semantic-mediawiki.org/w/api.php?action=ask&query=[[Ca
> tegory:CategoryWithNamespaceTest]]
>
> [1]
> https://sandbox.semantic-mediawiki.org/w/api.php?action=ask&query=[[Ca
> tegory:CategoryWithNamespaceTest]][[Help:%2B]]
>
> Cheers
>
> On 5/15/17, George, Garrett J. (JSC-CB111)[SGT, INC]
> <[hidden email]> wrote:
>> That’s what I believed to be the solution to the problem however I’m
>> not getting the proper pages to be returned when I run this ajax request.
>>
>> $.ajax({
>>     url: mw.util.wikiScript("api"),
>>     data: {
>>       format: "json",
>>       action: "ask",
>>       query: "[[Category:Meeting Minutes]] [[Console:+]]"
>>     },
>>     dataType: "json",
>>     success: function(data) {
>>       console.log(data)
>>     },
>>     error: function(xhr) {
>>       console.log("Error: Request Failed")
>>     }
>>   })
>> };
>>
>> It doesn’t return any error so it’s running through the parser
>> properly but I’m not getting any of the pages.
>>
>> The category page contains 2 pages from the Console namespace in the
>> category Meeting Minutes similar to how your custom namespaces are.
>> But when I execute the ajax request I don't get any pages.
>> Data.query.results is an empty array.
>>
>> -----Original Message-----
>> From: James HK [mailto:[hidden email]]
>> Sent: Monday, May 15, 2017 9:50 AM
>> To: George, Garrett J. (JSC-CB111)[SGT, INC]
>> <[hidden email]>
>> Cc: [hidden email]
>> Subject: Re: [Semediawiki-user] Option for non exclusive "+" wild card.
>>
>> Hi,
>>
>>> way to utilize the "+" wildcard, i.e. [[CustomNamespace:+]], but
>>> have it be exclusive.
>>
>> I'm not entirely sure what you refer to as "exclusive".
>>
>>> My goal would be able to do [[CustomNamespace:+]][[Category:Meeting]].
>>
>> This query will apply a conjunctive condition as to "all entities
>> with category Meeting that are contained within the CustomNamespace"
>> (as demonstrated by [0]).
>>
>> Currently it does what is expected of it, so what is the behviour you
>> have envisioned?
>>
>> [0]
>> https://sandbox.semantic-mediawiki.org/wiki/CategoryWithNamespaceTest
>>
>> Cheers
>>
>> On 5/15/17, George, Garrett J. (JSC-CB111)[SGT, INC]
>> <[hidden email]> wrote:
>>> Hey all,
>>>
>>> I've been working with some custom namespaces and am wondering if
>>> there is a way to utilize the "+" wildcard, i.e.
>>> [[CustomNamespace:+]], but have it be exclusive.
>>> I'm not saying I want to just magically have it work differently but
>>> is there an equivalent to that which isn't exclusive. I want to be
>>> able to search a category within a namespace. My goal would be able
>>> to do [[CustomNamespace:+]][[Category:Meeting]]. But currently "+"
>>> is exclusive so once it sees the wildcard it breaks from the query
>>> parsing and treats it as [[CustomNamespace:+]].
>>>
>>> Thanks,
>>> Garrett
>>> --------------------------------------------------------------------
>>> -
>>> -
>>> -------- 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
|

Re: Option for non exclusive "+" wild card.

kghbln
Except for the "$wgNamespacesToBeSearchedDefault" setting sandbox is set
up identically. I do not think that this setting should make the
difference. However there was an issue with that setting which already
got fixed in master and 2.5.x which will roll out with SMW 2.5.2 tomorrow.

I assume that $smwgNamespacesWithSemanticLinks is done after the
enableSemantics call.

Cheers Karsten

Am 15.05.2017 um 17:30 schrieb George, Garrett J. (JSC-CB111)[SGT, INC]:

> I believe it's a problem with the setup of the namespace. I have this in my LocalSetting.php.
>
>     define("NS_CONSOLE", 3000);
>     $wgExtraNamespaces[NS_CONSOLE] = "Console";
>     $wgNamespacesToBeSearchedDefault = array(NS_CONSOLE => true);
>     $smwgNamespacesWithSemanticLinks[NS_CONSOLE] = true;
>    
> When I got to /index.php/Category:Meeting Minutes I see the 2 pages in the Console namespace that should be coming up. But when I run the query nothing shows up.
> -----Original Message-----
> From: James HK [mailto:[hidden email]]
> Sent: Monday, May 15, 2017 10:09 AM
> To: George, Garrett J. (JSC-CB111)[SGT, INC] <[hidden email]>
> Cc: [hidden email]
> Subject: Re: [Semediawiki-user] Option for non exclusive "+" wild card.
>
> Hi,
>
>> namespaces to be searched. However, my custom namespace is not being
>> tracke
> I suspect you followed the recommendation of [0], right?
>
> [0] https://www.semantic-mediawiki.org/wiki/Help:Custom_namespaces
>
> Cheers
>
> On 5/16/17, George, Garrett J. (JSC-CB111)[SGT, INC] <[hidden email]> wrote:
>> It shows the same for me, but only for help. Help is under the default
>> namespaces to be searched. However, my custom namespace is not being
>> tracked properly. I'm not sure if there's some code to go into
>> DefaultSettings.php for SMW or LocalSettings.php for MW.
>>
>> It's possible that under
>> /SemanticMediaWiki/includes/query/SMW_QueryParser.php in the function
>> getArticleDescription() the line
>>     $idx = \SMW\Localizer::getInstance()->getNamespaceIndexByName(
>> $list[0] ); Is acting up when called with a category.
>>
>> Querying just for [[Console:+]] works but when I combine it with a
>> category it's not working.
>>
>> -----Original Message-----
>> From: James HK [mailto:[hidden email]]
>> Sent: Monday, May 15, 2017 10:01 AM
>> To: George, Garrett J. (JSC-CB111)[SGT, INC]
>> <[hidden email]>
>> Cc: [hidden email]
>> Subject: Re: [Semediawiki-user] Option for non exclusive "+" wild card.
>>
>> Hi,
>>
>>> That’s what I believed to be the solution to the problem however I’m
>>> not getting the proper pages to be returned when I run this ajax
>>> request It doesn’t return any error so it’s running through the
>>> parser properly but I’m not getting any of the pages.
>> As for the API #ask output of the mentioned request, it shows the same
>> result [0, 1].
>>
>> [0]
>> https://sandbox.semantic-mediawiki.org/w/api.php?action=ask&query=[[Ca
>> tegory:CategoryWithNamespaceTest]]
>>
>> [1]
>> https://sandbox.semantic-mediawiki.org/w/api.php?action=ask&query=[[Ca
>> tegory:CategoryWithNamespaceTest]][[Help:%2B]]
>>
>> Cheers
>>
>> On 5/15/17, George, Garrett J. (JSC-CB111)[SGT, INC]
>> <[hidden email]> wrote:
>>> That’s what I believed to be the solution to the problem however I’m
>>> not getting the proper pages to be returned when I run this ajax request.
>>>
>>> $.ajax({
>>>     url: mw.util.wikiScript("api"),
>>>     data: {
>>>       format: "json",
>>>       action: "ask",
>>>       query: "[[Category:Meeting Minutes]] [[Console:+]]"
>>>     },
>>>     dataType: "json",
>>>     success: function(data) {
>>>       console.log(data)
>>>     },
>>>     error: function(xhr) {
>>>       console.log("Error: Request Failed")
>>>     }
>>>   })
>>> };
>>>
>>> It doesn’t return any error so it’s running through the parser
>>> properly but I’m not getting any of the pages.
>>>
>>> The category page contains 2 pages from the Console namespace in the
>>> category Meeting Minutes similar to how your custom namespaces are.
>>> But when I execute the ajax request I don't get any pages.
>>> Data.query.results is an empty array.
>>>
>>> -----Original Message-----
>>> From: James HK [mailto:[hidden email]]
>>> Sent: Monday, May 15, 2017 9:50 AM
>>> To: George, Garrett J. (JSC-CB111)[SGT, INC]
>>> <[hidden email]>
>>> Cc: [hidden email]
>>> Subject: Re: [Semediawiki-user] Option for non exclusive "+" wild card.
>>>
>>> Hi,
>>>
>>>> way to utilize the "+" wildcard, i.e. [[CustomNamespace:+]], but
>>>> have it be exclusive.
>>> I'm not entirely sure what you refer to as "exclusive".
>>>
>>>> My goal would be able to do [[CustomNamespace:+]][[Category:Meeting]].
>>> This query will apply a conjunctive condition as to "all entities
>>> with category Meeting that are contained within the CustomNamespace"
>>> (as demonstrated by [0]).
>>>
>>> Currently it does what is expected of it, so what is the behviour you
>>> have envisioned?
>>>
>>> [0]
>>> https://sandbox.semantic-mediawiki.org/wiki/CategoryWithNamespaceTest
>>>
>>> Cheers
>>>
>>> On 5/15/17, George, Garrett J. (JSC-CB111)[SGT, INC]
>>> <[hidden email]> wrote:
>>>> Hey all,
>>>>
>>>> I've been working with some custom namespaces and am wondering if
>>>> there is a way to utilize the "+" wildcard, i.e.
>>>> [[CustomNamespace:+]], but have it be exclusive.
>>>> I'm not saying I want to just magically have it work differently but
>>>> is there an equivalent to that which isn't exclusive. I want to be
>>>> able to search a category within a namespace. My goal would be able
>>>> to do [[CustomNamespace:+]][[Category:Meeting]]. But currently "+"
>>>> is exclusive so once it sees the wildcard it breaks from the query
>>>> parsing and treats it as [[CustomNamespace:+]].
>>>>
>>>> Thanks,
>>>> Garrett
>>>> --------------------------------------------------------------------
>>>> -
>>>> -
>>>> -------- 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



------------------------------------------------------------------------------
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