Citizendium Forums
March 20, 2010, 01:01:51 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: POSTING RULES FOR MAIN CZ BOARDS: (1) The CZ Forums are Citizens-only (a "Citizen" is a Citizendium member). Non-Citizens may use only the "Non-member discussion" and "General help" boards, but still must register before posting (it's easy!). Non-Citizen posts elsewhere will be summarily deleted. (2) All must now use their own real names. To edit your displayed name, click on Profile > Account Related Settings. (3) Citizens must now link to their CZ user pages. To edit your signature, click on Profile > Forum Profile Information.
Click here to return to the wiki
 
   Home   Help Search Login Register  
Pages: [1] 2
  Print  
Author Topic: API vs. database  (Read 4083 times)
Tillmann Eben
New Arrival
*
Posts: 9


« on: July 29, 2009, 06:15:04 AM »

To generate some pics for RationalWiki (I'm the user larron), I tried to do some api inquiries.

While  an inquiry like:

http://en.citizendium.org/api.php?action=query&list=usercontribs&uclimit=10&ucuser=Derek_Hodges&format=xml

works, the follow-up

http://en.citizendium.org/api.php?action=query&list=usercontribs&uclimit=10&ucuser=Derek_Hodges&format=xml&ucstart=2009-02-04T02%3A05%3A35Z

creates this error:

<error code="internal_api_error_DBUnexpectedError" info="Exception Caught: A database error has occurred
Query: SELECT  rev_timestamp,page_namespace,page_title,rev_user_text,rev_page,rev_id,page_latest,rev_comment,rev_minor_edit,page_is_new  FROM revision,page  WHERE (page_id=rev_page) AND rev_deleted = '0' AND rev_user_text = 'Derek Hodges' AND (rev_timestamp<='20090204020535')  ORDER BY rev_user_text DESC, rev_timestamp DESC LIMIT 11 
Function: ApiQueryContributions::execute
Error: 1 ERROR:  invalid input syntax for type timestamp with time zone: "20090204020535"
"/>

Somehow, the database doesn't like the format of the timestamp - and I can't find out which format it should be....

Any help out there?
Logged
Matt Innis
Administrator
Forum Regular
****
Posts: 980


« Reply #1 on: July 29, 2009, 06:11:23 PM »

I'm not sure if this will help (or that I remember correctly), but it seems that I was trying to import a wikipedia page with a history last year and it wouldn't import until I renamed the default name of the file to remove the hyphen "-".  Hope that helps somehow?
Logged

Tillmann Eben
New Arrival
*
Posts: 9


« Reply #2 on: July 31, 2009, 01:57:33 AM »

Renaming doesn't help - the timestamp seemed to be processed correctly, as the query says:
rev_timestamp<='20090204020535'
but then, somehow the information on the time-zone is lost...

P.S.: I'd rather preferred this to be discussed in the Technical Forum...
Logged
Daniel Mietchen
Forum Regular
****
Posts: 842



WWW
« Reply #3 on: July 31, 2009, 03:00:37 AM »

P.S.: I'd rather preferred this to be discussed in the Technical Forum...
I left a note there.
Logged

Hayford Peirce
Administrator
Forum Regular
****
Posts: 1582



« Reply #4 on: July 31, 2009, 09:22:22 AM »

P.S.: I'd rather preferred this to be discussed in the Technical Forum...

It can't be discussed there because you're not a Citizendium member, at least not that I have been able to verify.

I moved the discussion here to the non-members' Forum.  Why don't you become a member?
Logged

Tillmann Eben
New Arrival
*
Posts: 9


« Reply #5 on: July 31, 2009, 10:37:45 AM »

P.S.: I'd rather preferred this to be discussed in the Technical Forum...

It can't be discussed there because you're not a Citizendium member, at least not that I have been able to verify.

Please excuse my poor choice of words: it shouldn't be a discussion, I'd rather hoped for an answer to my question. There seems to be something amiss with the way the SQL query is produced.

I hoped that posting it in the Technical Forum would spike the interest of those with technical expertise, the webmaster or whoever. IMO, as it seems to be a bug, it should be handled though I'm not a member.

I moved the discussion here to the non-members' Forum.  Why don't you become a member?
Because I'm not interested in becoming a member? It should be possible for an outsider to hint to bugs without learning the secret hand-shakes. :-)

 I appreciate some of the work at CZ. But I strongly  dislike  your Health Sciences/Healing Arts. I don't want to have anything to do with this kind of stuff, so I stick to the anonymity of wikipedia ....
Logged
Tillmann Eben
New Arrival
*
Posts: 9


« Reply #6 on: July 31, 2009, 10:39:11 AM »

P.S.: I'd rather preferred this to be discussed in the Technical Forum...
I left a note there.

Thanks!
Logged
Howard C. Berkowitz
Forum Regular
****
Posts: 2032


« Reply #7 on: July 31, 2009, 11:34:27 AM »

P.S.: I'd rather preferred this to be discussed in the Technical Forum...

It can't be discussed there because you're not a Citizendium member, at least not that I have been able to verify.

Please excuse my poor choice of words: it shouldn't be a discussion, I'd rather hoped for an answer to my question. There seems to be something amiss with the way the SQL query is produced.

I hoped that posting it in the Technical Forum would spike the interest of those with technical expertise, the webmaster or whoever. IMO, as it seems to be a bug, it should be handled though I'm not a member.

I moved the discussion here to the non-members' Forum.  Why don't you become a member?
Because I'm not interested in becoming a member? It should be possible for an outsider to hint to bugs without learning the secret hand-shakes. :-)

 I appreciate some of the work at CZ. But I strongly  dislike  your Health Sciences/Healing Arts. I don't want to have anything to do with this kind of stuff, so I stick to the anonymity of wikipedia ....

Well, for nonmembers, we basically support the browser interface.  Yes, I'm perfectly aware that there's no block to public APIs, but I'm personally a little hesitant to offer out-of-the-ordinary technical support to someone that does not want to join the community.  There are limited resources available to Citizens for the API, SQL, etc. level of query.

For the record, I think the Healing Arts problem, especially with respect to Homeopathy, is awful, but I'm also aware of both efforts to fix the specific article, and a growing consensus that the split is basically dysfunctional.
Logged

http://en.citizendium.org/wiki/User:Howard_C._Berkowitz

Prime Minister, you can't take the bull by the horns if you're grasping the nettle. I mean, if you grasped the nettle with one hand, you could take the bull by one horn with the other hand, but not by both horns because your hand wouldn't be big enough, and if you took a bull by only one horn it would be rather dangerous because...' (Yes Prime Minister II, pp. 221-2)
Tillmann Eben
New Arrival
*
Posts: 9


« Reply #8 on: July 31, 2009, 02:52:12 PM »


Well, for nonmembers, we basically support the browser interface.  Yes, I'm perfectly aware that there's no block to public APIs, but I'm personally a little hesitant to offer out-of-the-ordinary technical support to someone that does not want to join the community.  There are limited resources available to Citizens for the API, SQL, etc. level of query.


Clearly, I'd profit from a solution, i.e., a removal of the bug in your software: It's my hobby-horse to generate graphs of various wikis, and the best way to gather data for all parties involved :-) is via the APIs.
BUT: as far as I can see, it is a bug in your software. One would think that it is in your own interest to remove it, as otherwise, sometimes some member will run into it.
I'm not asking for out-of-the-ordinary technical support, but I would appreciate it if you could fix your malfunction.
Logged
Howard C. Berkowitz
Forum Regular
****
Posts: 2032


« Reply #9 on: July 31, 2009, 03:28:09 PM »


Clearly, I'd profit from a solution, i.e., a removal of the bug in your software: It's my hobby-horse to generate graphs of various wikis, and the best way to gather data for all parties involved :-) is via the APIs.
BUT: as far as I can see, it is a bug in your software. One would think that it is in your own interest to remove it, as otherwise, sometimes some member will run into it.
I'm not asking for out-of-the-ordinary technical support, but I would appreciate it if you could fix your malfunction.

Bugs should be fixed, but there's an issue of priorities. I can think of several known bugs for which there are awkward workarounds, which we constantly encounter when creating articles. Nevertheless, there have been more critical things to be fixed, or specifically needed enhancements to be added.

If the bug is affecting only your hobbyhorse, speaking personally only, I just don't see why resources should be expended on it, when you have said that you don't plan to contribute content to CZ.
Logged

http://en.citizendium.org/wiki/User:Howard_C._Berkowitz

Prime Minister, you can't take the bull by the horns if you're grasping the nettle. I mean, if you grasped the nettle with one hand, you could take the bull by one horn with the other hand, but not by both horns because your hand wouldn't be big enough, and if you took a bull by only one horn it would be rather dangerous because...' (Yes Prime Minister II, pp. 221-2)
Tillmann Eben
New Arrival
*
Posts: 9


« Reply #10 on: July 31, 2009, 03:34:57 PM »

Fair enough - I didn't know that your resources were tied up  fixing critical things.
My best wishes for your efforts - and then, perhaps, sometimes you'll be able to tend to this menial task...
Logged
Russell D. Jones
Forum Communicator
***
Posts: 134


WWW
« Reply #11 on: August 02, 2009, 03:41:53 PM »

I'm not so sure it's our software.  The historywiki API also has trouble processing requests using timestamps for any time other than the present.  In other words, I can query the DB for the most recent this or that, but can not query the DB for the 500 or so this or that starting January 1, 2009, 00:00:00.  I've assumed this was some sort of query issue on my part (since I was not all that familiar with API or DB's), but I took some time last winter to really learn how to query the DB about a particular time and came to the conclusion that my mediawiki software just couldn't process such a query.  It's still on my list of issues to have my tech guru look at.
Logged

Tillmann Eben
New Arrival
*
Posts: 9


« Reply #12 on: August 03, 2009, 12:44:02 AM »

Thanks, Russel D. Jones
  • According to Citizendium's API documentation page , enumerating recent changes is limited to the last 500 (resp. 5000 for bots) entries. There is no similar restriction for user contributions.
  • In fact, the example I gave above should look up the last 20 entries, so it would be within the limits of such a restriction
  • I get similar errors of the database when I use other queries involving timestamps.

I really think it's the way the timestamp is processed for the use of the SQL query which causes the problem.

Logged
Drew R. Smith
Forum Communicator
***
Posts: 178


« Reply #13 on: August 03, 2009, 01:23:18 AM »

I don't know anything about API's or SQL's or any of that, but for what its worth your query doesn't work with wikipedia either.

The best I could find would be

http://en.citizendium.org/wiki?limit=50&title=Special%3AContributions&contribs=user&target=Derek+Hodges&namespace=&year=2009&month=7

But you cant get specific dates, times, or that fancy XML output.
Logged

Tillmann Eben
New Arrival
*
Posts: 9


« Reply #14 on: August 03, 2009, 01:36:49 AM »

I don't know anything about API's or SQL's or any of that, but for what its worth your query doesn't work with wikipedia either.

The best I could find would be

http://en.citizendium.org/wiki?limit=50&title=Special%3AContributions&contribs=user&target=Derek+Hodges&namespace=&year=2009&month=7

But you cant get specific dates, times, or that fancy XML output.

Logged
Pages: [1] 2
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.8 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!