triannon 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6f1dc35cca4a3483f2cf722ab165da8c0b6fb38c
4
- data.tar.gz: 956ca6ac61d830d938420687efe744aa0156ddf2
3
+ metadata.gz: df73d4970ac16fd6e16ceaca420806ffcd734213
4
+ data.tar.gz: d2596bcef0e1f2f26004a5f6f856cd43062a6915
5
5
  SHA512:
6
- metadata.gz: 2ddab1a5203861a6ed730111295c3587c8043627263f9d52a4ed59ca1d7904050e2d77508be117ff9708ab5634334e7d9e35df9a0045d9021af707ef79c808e9
7
- data.tar.gz: 811ec9c95c928d34ef9420331a4266357f1ba21ba58de1117f21e2947334ea9ae039a785f145224ea74dd3d0147eb532f94a22f2a481aa17384cd676fff1039b
6
+ metadata.gz: d1771d459b311f7c97ea77f07a1ce04d2f18ce2d92d5765ca752d59b77a6acc52dee668d59d7259f14013c8dad3470a005b1ac1e04e013fda19aac3aa3f201f7
7
+ data.tar.gz: 0f6e883baa0961f8675a71f822759e81ac41f85f9730e59b9ecbe44a3cf0e6902db5eaad47d26764716a3ef95659c1a79904dae0358565985841f91c664bbca4
@@ -173,6 +173,8 @@ private
173
173
  data.sub!("\"http://www.w3.org/ns/oa-context-20130208.json\"", json_oa_context)
174
174
  elsif data.match(/"@context"\s*\:\s*"http\:\/\/www\.w3\.org\/ns\/oa\.jsonld"/)
175
175
  data.sub!("\"http://www.w3.org/ns/oa.jsonld\"", json_oa_context)
176
+ elsif data.match(/"@context"\s*\:\s*"http\:\/\/iiif\.io\/api\/presentation\/2\/context\.json"/)
177
+ data.sub!("\"http://iiif.io/api/presentation/2/context.json\"", json_iiif_context)
176
178
  end
177
179
  @json_ld ||= JSON.parse(data) rescue nil
178
180
  end
@@ -186,6 +188,15 @@ private
186
188
  end
187
189
  end
188
190
 
191
+ def json_iiif_context
192
+ # FIXME: this is a terrible place to do this!!
193
+ if Rails.root.to_s.match(/internal/) # testing via engine_cart
194
+ @json_oa_context ||= File.read(Rails.root.join("..", "..", "lib", "triannon", "iiif_presentation_2_context.json"))
195
+ else
196
+ @json_oa_context ||= File.read(Rails.root.join("lib", "triannon", "iiif_presentation_2_context.json"))
197
+ end
198
+ end
199
+
189
200
  def graph_exists?
190
201
  graph && graph.size > 0
191
202
  end
@@ -1,5 +1,6 @@
1
1
  require 'linkeddata'
2
2
  require 'rdf/open_annotation'
3
+ require 'rdf/iiif'
3
4
  require 'rdf/ldp'
4
5
  require 'rdf/fcrepo4'
5
6
  require 'rdf/triannon_vocab'
@@ -0,0 +1,72 @@
1
+ {
2
+ "sc": "http://iiif.io/api/presentation/2#",
3
+ "iiif": "http://iiif.io/api/image/2#",
4
+ "exif": "http://www.w3.org/2003/12/exif/ns#",
5
+ "oa": "http://www.w3.org/ns/oa#",
6
+ "cnt": "http://www.w3.org/2011/content#",
7
+ "dc": "http://purl.org/dc/elements/1.1/",
8
+ "dcterms": "http://purl.org/dc/terms/",
9
+ "dctypes": "http://purl.org/dc/dcmitype/",
10
+ "foaf": "http://xmlns.com/foaf/0.1/",
11
+ "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
12
+ "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
13
+ "xsd": "http://www.w3.org/2001/XMLSchema#",
14
+ "svcs": "http://rdfs.org/sioc/services#",
15
+
16
+ "license": {"@type":"@id", "@id":"dcterms:license"},
17
+ "service": {"@type":"@id", "@id":"svcs:has_service"},
18
+ "seeAlso": {"@type":"@id", "@id":"foaf:page"},
19
+ "within": {"@type":"@id", "@id":"dcterms:isPartOf"},
20
+ "profile": {"@type":"@id", "@id":"dcterms:conformsTo"},
21
+ "related": {"@type":"@id", "@id":"dcterms:relation"},
22
+ "logo": {"@type":"@id", "@id":"foaf:logo"},
23
+ "thumbnail": {"@type":"@id", "@id":"foaf:thumbnail"},
24
+ "startCanvas": {"@type":"@id", "@id":"sc:hasStartCanvas"},
25
+
26
+ "manifests": {"@type":"@id", "@id":"sc:hasManifests", "@container":"@list"},
27
+ "sequences": {"@type":"@id", "@id":"sc:hasSequences", "@container":"@list"},
28
+ "canvases": {"@type":"@id", "@id":"sc:hasCanvases", "@container":"@list"},
29
+ "resources": {"@type":"@id", "@id":"sc:hasAnnotations", "@container":"@list"},
30
+ "images": {"@type":"@id", "@id":"sc:hasImageAnnotations","@container":"@list"},
31
+ "otherContent": {"@type":"@id", "@id":"sc:hasLists", "@container":"@list"},
32
+ "structures": {"@type":"@id", "@id":"sc:hasRanges", "@container":"@list"},
33
+ "ranges" : {"@type": "@id", "@id": "sc:hasRanges", "@container":"@list"},
34
+
35
+ "metadata": {"@type":"@id", "@id":"sc:metadataLabels", "@container":"@list"},
36
+
37
+ "description": {"@id": "dc:description"},
38
+ "attribution": {"@id": "sc:attributionLabel"},
39
+ "height": {"@type":"xsd:integer", "@id":"exif:height"},
40
+ "width": {"@type":"xsd:integer", "@id":"exif:width"},
41
+ "viewingDirection": {"@id": "sc:viewingDirection", "@type":"@id"},
42
+ "viewingHint": {"@id": "sc:viewingHint", "@type":"@id"},
43
+
44
+ "left-to-right": {"@id":"sc:leftToRightDirection", "@type":"sc:ViewingDirection"},
45
+ "right-to-left": {"@id":"sc:rightToLeftDirection", "@type":"sc:ViewingDirection"},
46
+ "top-to-bottom": {"@id":"sc:topToBottomDirection", "@type":"sc:ViewingDirection"},
47
+ "bottom-to-top": {"@id":"sc:bottomToTopDirection", "@type":"sc:ViewingDirection"},
48
+
49
+ "paged": {"@id":"sc:pagedHint", "@type":"sc:ViewingHint"},
50
+ "non-paged": {"@id":"sc:nonPagedHint", "@type":"sc:ViewingHint"},
51
+ "continuous": {"@id":"sc:continuousHint", "@type":"sc:ViewingHint"},
52
+ "individuals": {"@id":"sc:individualsHint", "@type":"sc:ViewingHint"},
53
+ "top": {"@id":"sc:topHint", "@type":"sc:ViewingHint"},
54
+
55
+ "motivation": {"@type":"@id", "@id":"oa:motivatedBy"},
56
+ "resource": {"@type":"@id", "@id":"oa:hasBody"},
57
+ "on": {"@type":"@id", "@id":"oa:hasTarget"},
58
+ "full": {"@type":"@id", "@id":"oa:hasSource"},
59
+ "selector": {"@type":"@id", "@id":"oa:hasSelector"},
60
+ "stylesheet": {"@type":"@id", "@id":"oa:styledBy"},
61
+ "style": {"@id":"oa:styleClass"},
62
+
63
+ "default": {"@type":"@id", "@id" : "oa:default"},
64
+ "item": {"@type":"@id", "@id" : "oa:item"},
65
+ "chars": {"@id": "cnt:chars"},
66
+ "encoding": {"@id": "cnt:characterEncoding"},
67
+ "bytes": {"@id": "cnt:bytes"},
68
+ "format": {"@id": "dc:format"},
69
+ "language": {"@id": "dc:language"},
70
+ "value": {"@id": "rdf:value"},
71
+ "label": {"@id": "rdfs:label"}
72
+ }
@@ -1,3 +1,3 @@
1
1
  module Triannon
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: triannon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Beer
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-11-19 00:00:00.000000000 Z
12
+ date: 2014-11-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -53,6 +53,20 @@ dependencies:
53
53
  - - ">="
54
54
  - !ruby/object:Gem::Version
55
55
  version: '0'
56
+ - !ruby/object:Gem::Dependency
57
+ name: rdf-iiif
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ type: :runtime
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
56
70
  - !ruby/object:Gem::Dependency
57
71
  name: rdf-ldp
58
72
  requirement: !ruby/object:Gem::Requirement
@@ -275,6 +289,7 @@ files:
275
289
  - lib/triannon.rb
276
290
  - lib/triannon/engine.rb
277
291
  - lib/triannon/error.rb
292
+ - lib/triannon/iiif_presentation_2_context.json
278
293
  - lib/triannon/oa_context_20130208.json
279
294
  - lib/triannon/version.rb
280
295
  homepage:
@@ -297,7 +312,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
297
312
  version: '0'
298
313
  requirements: []
299
314
  rubyforge_project:
300
- rubygems_version: 2.4.2
315
+ rubygems_version: 2.4.3
301
316
  signing_key:
302
317
  specification_version: 4
303
318
  summary: Rails engine for working with storage of OpenAnnotations stored in Fedora4