diff options
author | tilly-Q <nattilypigeonfowl@gmail.com> | 2014-03-18 16:49:48 -0400 |
---|---|---|
committer | tilly-Q <nattilypigeonfowl@gmail.com> | 2014-03-23 16:40:12 -0400 |
commit | 74d7ff96142c2da375e12df91e23fb50c2b2af88 (patch) | |
tree | 633de1c46efbb6d4e752bc613a6731cbfe6ffacc | |
parent | 7a29c67bf92830427e30590fe5a7b720da7520d4 (diff) | |
download | mediagoblin-74d7ff96142c2da375e12df91e23fb50c2b2af88.tar.lz mediagoblin-74d7ff96142c2da375e12df91e23fb50c2b2af88.tar.xz mediagoblin-74d7ff96142c2da375e12df91e23fb50c2b2af88.zip |
Big update. I added in a json-ld context file which will be used in all our
metadata columns in the future. The context describes the dublin core elements.
It still has not been finalized however.
-rw-r--r-- | mediagoblin/routing.py | 4 | ||||
-rw-r--r-- | mediagoblin/templates/mediagoblin/metadata_contexts/v1 | 70 | ||||
-rw-r--r-- | mediagoblin/views.py | 6 | ||||
-rw-r--r-- | setup.py | 1 |
4 files changed, 80 insertions, 1 deletions
diff --git a/mediagoblin/routing.py b/mediagoblin/routing.py index 1393f01c..a6b2a543 100644 --- a/mediagoblin/routing.py +++ b/mediagoblin/routing.py @@ -28,7 +28,9 @@ _log = logging.getLogger(__name__) def get_url_map(): add_route('index', '/', 'mediagoblin.views:root_view') add_route('terms_of_service','/terms_of_service', - 'mediagoblin.views:terms_of_service') + 'mediagoblin.views:terms_of_service'), + add_route('metadata_context','/metadata_context/v<int:version_number>/', + 'mediagoblin.views:metadata_context_view'), mount('/auth', auth_routes) mount('/mod', moderation_routes) diff --git a/mediagoblin/templates/mediagoblin/metadata_contexts/v1 b/mediagoblin/templates/mediagoblin/metadata_contexts/v1 new file mode 100644 index 00000000..1325d920 --- /dev/null +++ b/mediagoblin/templates/mediagoblin/metadata_contexts/v1 @@ -0,0 +1,70 @@ +{ + "@context": { + "dc": "http://purl.org/dc/elements/1.1/", + "xsd": "http://www.w3.org/2001/XMLSchema#", + "contributor":{ + "@id":"dc:title", + "@type":"xsd:string" + }, + "coverage":{ + "@id":"dc:coverage", + "@type":"xsd:string" + }, + "created":{ + "@id":"dc:created", + "@type":"xsd:date" + }, + "creator":{ + "@id":"dc:created", + "@type":"xsd:date" + }, + "date":{ + "@id":"dc:date", + "@type":"xsd:date" + }, + "description":{ + "@id":"dc:description", + "@type":"xsd:string" + }, + "format":{ + "@id":"dc:format", + "@type":"xsd:string" + }, + "identifier":{ + "@id":"dc:identifier", + "@type":"xsd:string" + }, + "language":{ + "@id":"dc:language", + "@type":"xsd:string" + }, + "publisher":{ + "@id":"dc:publisher", + "@type":"xsd:string" + }, + "relation":{ + "@id":"dc:relation", + "@type":"xsd:string" + }, + "rights":{ + "@id":"dc:rights", + "@type":"xsd:anyURI" + }, + "source":{ + "@id":"dc:source", + "@type":"xsd:string" + }, + "subject":{ + "@id":"dc:subject", + "@type":"xsd:string" + }, + "title": { + "@id":"dc:title", + "@type":"xsd:string" + }, + "type":{ + "@id":"dc:type", + "@type":"xsd:string" + } + } +} diff --git a/mediagoblin/views.py b/mediagoblin/views.py index 009e48e4..1ed71473 100644 --- a/mediagoblin/views.py +++ b/mediagoblin/views.py @@ -62,3 +62,9 @@ def terms_of_service(request): return render_to_response(request, 'mediagoblin/terms_of_service.html', {}) + +def metadata_context_view(request): + version = request.matchdict['version_number'] + return render_to_response(request, + 'mediagoblin/metadata_contexts/v{version}'.format( + version=version), {}) @@ -66,6 +66,7 @@ try: 'six>=1.4.1', 'oauthlib==0.5.0', 'unidecode', + 'jsonschema', ## Annoying. Please remove once we can! We only indirectly ## use pbr, and currently it breaks things, presumably till |