RE: [learningreg-dev] Getting started, stuck at the gate

33 views
Skip to first unread message

Jerome Grimmer

unread,
Feb 4, 2013, 10:17:58 AM2/4/13
to learnin...@googlegroups.com

I’m far from being a python or json expert, being more of a C/C# kind of guy, but it looks like you’re trying to sign your document with a public key.  Ordinarily documents are signed with a private key.  The public key can then be used by anyone who has the public key to verify the document/signature.

 

I see another problem with your data as well.  Ordinarily the payload_schema field is a single item not an array.  What is this [“hashtags”, “describing”, “resource_locator”, “format”] schema you are using?  It is important that others who are consuming data from the Learning Registry be able to understand the schema you are using.  At the present time, most are using LR_Paradata to publish paradata, and NSDL, Dublin Core, or LOM to publish metadata.  There has also been some discussion recently about putting LRMI metadata into the Learning Registry.  Here are some links to documentation you can use to learn about these schemas:

 

·         NSDL (a variant of Dublin Core) metadata guide: http://nsdl.org/contribute/metadata-guide

·         Dublin Core (an older usage guide but still useful): http://dublincore.org/documents/usageguide/elements.shtml

·         LOM (Learning Object Metadata): http://ltsc.ieee.org/wg12/files/LOM_1484_12_1_v1_Final_Draft.pdf

·         LRMI (Learning Resource Metadata Initiative – Shared Learning Collaborative (SLC) has made some small extensions to this schema and may be publishing with it soon): http://www.lrmi.net/the-specification

 

There’s documentation on the Learning Registry web site about their LR_Paradata schema.  I found the paradata cookbook to be especially useful.  Paradata is usually expressed as JSON, while metadata tends to be XML.

 

Jerome Grimmer

Southern Illinois University Carbondale

2450 Foundation Drive Suite 100

Springfield, IL

Phone: 217-786-3010 ext. 5857

Toll-free: 1-800-252-4822 ext. 5857

NOTE: My E-mail address has changed

jgri...@siuccwd.com

"If you think you're too small to make a difference, you've never spent a night with a mosquito." - An African Proverb

 

From: learnin...@googlegroups.com [mailto:learnin...@googlegroups.com] On Behalf Of Benjamin Smith
Sent: Monday, January 28, 2013 6:00 PM
To: learnin...@googlegroups.com
Subject: [learningreg-dev] Getting started, stuck at the gate

 

Following the "Learning Registry in 20 minutes" on Fedora 17 and/or CentOS 6 Linux platform, and consistently running into errors at the "Signing the Document" stage. I've tried installing pip via yum as well as with curl as suggested. I continue to get errors like: 

 

[lr@xr3 lr]$ cat test.json | python -m LRSignature.cmd sign --key "MyBigLongPrivateKey" --key-location "http://learningregistrydev.schoolpathways.com/GPG/public-key.txt" --passphrase "MyPassphrase" 

/usr/lib/python2.6/site-packages/LRSignature/cmd.py:240: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6

  raise InvalidJSONError(e.message)

Traceback (most recent call last):

  File "/usr/lib/python2.6/runpy.py", line 122, in _run_module_as_main

    "__main__", fname, loader, pkg_name)

  File "/usr/lib/python2.6/runpy.py", line 34, in _run_code

    exec code in run_globals

  File "/usr/lib/python2.6/site-packages/LRSignature/cmd.py", line 260, in <module>

    tool.run()

  File "/usr/lib/python2.6/site-packages/LRSignature/cmd.py", line 30, in run

    envelopeList = self.parseInput(rawInput)

  File "/usr/lib/python2.6/site-packages/LRSignature/cmd.py", line 240, in parseInput

    raise InvalidJSONError(e.message)

__main__.InvalidJSONError

 

 

Based on the "InvalidJSON" error, I installed seamonkey and modified the test.json file to read 

 

var a = {

"TOS": {

        "submission_TOS": "http://www.learningregistry.org/tos/cc0/v0-5/",

    },

    "active": true,

    "doc_type": "resource_data",

    "doc_version": "0.23.0",

    "identity": {

        "curator": "",

        "owner": "",

        "submitter": "Benjamin Smith",

        "signer": "Benjamin Smith",

        "submitter_type": "agent"

    },

    "keys": [

        "science",

        "Newton",

        "apple",

        "MyDogHasFleas"

    ],

    "payload_placement": "inline",

    "payload_schema": [

        "hashtags",

        "describing",

        "resource_locator",

        "format"

    ],

    "resource_data": "A picture from wikipedia",

    "resource_data_type": "metadata",

};

print(a.TOS.submission_TOS; 

 

 

 

and saw 

[lr@xr3 lr]$ js test.json 

 

So the json appears to parse correctly. I've tried this twice, on CentOS6 AND Fedora 17, I'm still baffled. Any idea what I'm missing? 

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

Steve Midgley

unread,
Feb 17, 2013, 11:29:29 PM2/17/13
to learnin...@googlegroups.com
Hey Benjamin,

Did this get resolved for you? I'm sure a few of us would be happy to help if not - just let the list know where you're at on setting up LR.

Steve

Jim Klo

unread,
Feb 18, 2013, 12:30:23 PM2/18/13
to <learningreg-dev@googlegroups.com>
My first observation is that you should be using at LEAST python 2.7.3, but that shouldn't be causing this error. Be aware that some Linux distros depend some version of preinstalled python 2.6 that you shouldn't upgrade. (Debian, Ubuntu, and possibly others; I'm not sure of the Red Hat variants). For these you install python according to the "make altinstall" instructions which *can* be a bit of a hassle.

I'd have to see the contents of your "test.json" file.  It should be in one of the following formats:

Also assuming you installed spider monkey instead of sea monkey. Spider monkey is the JS interpreter used by couchdb, Sea Monkey (also a mozilla project) is an all-in-one web browser, email client, irc, news, feed, and html editing application… :)  Spider Monkey is a helpful tool for debugging CouchDB MapReduce however it shouldn't be required for LRSignature (unless it's a core python dependency to get the json library, but I don't believe it is.)


Jim Klo
Senior Software Engineer
Center for Software Engineering
SRI International
t. @nsomnac
Reply all
Reply to author
Forward
0 new messages