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
"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",
"resource_locator": "http://learningregistrydev.schoolpathways.com/800px-Educational_separation_in_the_US_prior_to_Brown_Map.svg.png"
};
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.