Wiki Namespaces

Any posts related to the categorization and standardization of IMSLP

Moderators: vinteuil, Davydov

Post Reply
gardano
forum adept
Posts: 62
Joined: Wed Mar 02, 2011 8:08 pm
notabot: 42
notabot2: Human

Wiki Namespaces

Post by gardano »

Hi all,
I'm trying to parse the update feed from the wiki, and what I'd hoped to do was to determine the kind of update via the namespace property of the returned dictionary. It seemed that
* "ns=0" gives a composition (this seems to work fine), and
* "ns=14" would give a composer. This doesn't work out so well. I get composers in most instances, but for the latest update query, I got back also "Category:User baroque flutists-3" and "Category:User baroque flutists".

Are the items with "Baroque flutists" etc an anomaly with the data, or are the namespaces not completely implemented yet?

Alternatively, if this isn't the best way to get the latest updates and additions to the wiki via the API, any other suggestions?

Here's the query I'm using: http://imslp.org/api.php?action=query&l ... ormat=json
(rcstart is set to the last time my app pulled data from the wiki).

Thanks much,
Gardano
KGill
Copyright Reviewer
Posts: 1295
Joined: Thu Apr 09, 2009 10:16 pm
notabot: 42
notabot2: Human

Re: Wiki Namespaces

Post by KGill »

Perhaps 'ns=14' would just signify a category? Composers are not in a separate namespace than the other categories (such as those for tags, templates, etc.), so I'd imagine that it would be difficult to tell the difference using this method. Is there any way to modify the query to check what categories the page is included in? (Should be in Category:Composers in this case)
imslp
Site Admin
Posts: 1642
Joined: Thu Jan 01, 1970 12:00 am

Re: Wiki Namespaces

Post by imslp »

KGill is right. NS_CATEGORY is defined as 14. Category:Composers should contain all composer categories.
gardano
forum adept
Posts: 62
Joined: Wed Mar 02, 2011 8:08 pm
notabot: 42
notabot2: Human

Re: Wiki Namespaces

Post by gardano »

imslp wrote:KGill is right. NS_CATEGORY is defined as 14. Category:Composers should contain all composer categories.
Oh, OK. I'm sure I made the invalid assumption purely because most new categories are of composers, but not all. I'll have to look through the API and see if I can pre-filter the requests, or alternatively, find a way to filter the requests by calling the API again. This last option of course is not optimal because I want to keep the HTTP Requests to a minimum, both for the device and for the server's sake.

I'll have to find out what unique property distinguishes a composer from, say, a user.

Thanks!
Gardano
imslp
Site Admin
Posts: 1642
Joined: Thu Jan 01, 1970 12:00 am

Re: Wiki Namespaces

Post by imslp »

Hmm, would list=categorymembers on Category:Composers work?
gardano
forum adept
Posts: 62
Joined: Wed Mar 02, 2011 8:08 pm
notabot: 42
notabot2: Human

Re: Wiki Namespaces

Post by gardano »

imslp wrote:Hmm, would list=categorymembers on Category:Composers work?
:¬) Yep, I'm doing that for the initial load of the composers. What I'm trying to do with this query is to refresh the app with all new compositions and composers since the last time the app was launched.

AHHH now that I think of it, I really only need to identify the new *compositions* that have been added. If there is no composer foreign-keyed to the new composition, then I'd know that I need to do a query on that composition to grab its composer.

So I can use the NS=0 to grab compositions and that will be all I need.
kalliwoda
active poster
Posts: 504
Joined: Fri Dec 19, 2008 8:36 pm
notabot: YES
notabot2: Bot
Location: Berlin, Germany

Re: Wiki Namespaces

Post by kalliwoda »

gardano wrote
What I'm trying to do with this query is to refresh the app with all new compositions and composers since the last time the app was launched.
Now, that is something I have been looking for on imslp for a long time, would your app also work in a regular browser?
gardano
forum adept
Posts: 62
Joined: Wed Mar 02, 2011 8:08 pm
notabot: 42
notabot2: Human

Re: Wiki Namespaces

Post by gardano »

kalliwoda wrote:
gardano wrote
What I'm trying to do with this query is to refresh the app with all new compositions and composers since the last time the app was launched.
Now, that is something I have been looking for on imslp for a long time, would your app also work in a regular browser?
Actually, I don't know. This is something for the iPad app I'm writing for IMSLP, and so it's more technical and doesn't return content appropriate for a web browser. I haven't looked into how it would work using just a web browser, I'm afraid.

--Gardano
Post Reply