Re: [learningreg-dev] Problem Harvesting with pyoai 2.4.4

120 views
Skip to first unread message

Grata, Walt

unread,
Feb 20, 2013, 1:56:47 PM2/20/13
to learnin...@googlegroups.com
David we host OAI-PMH at https://node01.public.learningregistry.net/OAI-PMH, however I'm getting no results with the above script, but http://node01.public.learningregistry.net/OAI-PMH?verb=ListRecords&metadataPrefix=oai_dc gives me results


On Wed, Feb 20, 2013 at 12:42 PM, David Rick <davidr...@gmail.com> wrote:
Hello,
I am new to the Learning Registry.  I am trying to use the the pyoai 2.4.4  Python package to connect to nodes listed in the advanced options at http://browser.learnreg1.sri.com/.   I am using the same code listed on the http://pypi.python.org/pypi/pyoai page.  Here is a sample:
 
>>> from oaipmh.client import Client
>>> from oaipmh.metadata import MetadataRegistry, oai_dc_reader
>>> URL = 'http://node01.public.learningregistry.net'
>>> registry = MetadataRegistry()
>>> registry.registerReader('oai_dc', oai_dc_reader)
>>> client = Client(URL, registry)
>>> for record in client.listRecords(metadataPrefix='oai_dc'):
 print record
 
The code fails with:
 
  File "C:\Python27\lib\urllib2.py", line 527, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 405: Method Not Allowed
 
Any help would be greatly appreciated.
 

David Rick

Database Developer

Learning.com

--
You received this message because you are subscribed to the Google Groups "Learning Registry Developers List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to learningreg-d...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Jim Klo

unread,
Feb 20, 2013, 2:11:31 PM2/20/13
to <learningreg-dev@googlegroups.com>
So one major thing to note… pyoai may not work with LR's OAI-PMH implementation, as the OAI-PMH schema used by LR is an amended version of OAI-PMH 2.0.  It may require some hand holding to tweak which schema pyoai uses to make it work. Fundamentally  it functions and operates like OAI-PMH 2.0, however the schema has been altered to be more conducive to the use cases Learning Registry is working to solve.

Also know that OAI-PMH does not currently disseminate the full LR dataset, but only those resource_data that are encoded in XML with select schemas.  We are NOT currently translating any of the JSON formatted paradata or LRMI into XML.

- Jim

Jim Klo
Senior Software Engineer
Center for Software Engineering
SRI International
t. @nsomnac

David Rick

unread,
Feb 20, 2013, 3:04:58 PM2/20/13
to learnin...@googlegroups.com
Hey Jim - Thanks for your replay?   Can you tell me what is the best approach for harvesting data from a node.  It appears that there are several approaches and code samples if I look at the GitHub Learning Registry page.

Jim Klo

unread,
Feb 20, 2013, 3:33:40 PM2/20/13
to <learningreg-dev@googlegroups.com>, learnin...@googlegroups.com
The simplest way is probably basic harvest with list records. Similar to OAI, however it's a native JSON response from LR.

Can you describe your use case more? There might be more suitable solutions. 

- Jim

Jim Klo

unread,
Feb 20, 2013, 9:21:21 PM2/20/13
to <learningreg-dev@googlegroups.com>
Also, as discovered while running through the test suite, there appears to be a bug in the request to make a resumption token in the OAI-PMH code… I'm trying to determine what that is currently… It should be fixed in the upcoming release as the unit test is failing for this.

- Jim

Jim Klo
Senior Software Engineer
Center for Software Engineering
SRI International

On Feb 20, 2013, at 12:04 PM, David Rick <davidr...@gmail.com>
 wrote:

Reply all
Reply to author
Forward
0 new messages