rdf 1.99.1 → 2.0.0.beta1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/{README → README.md} +9 -44
  3. data/VERSION +1 -1
  4. data/bin/rdf +1 -1
  5. data/lib/rdf.rb +40 -49
  6. data/lib/rdf/changeset.rb +161 -0
  7. data/lib/rdf/cli.rb +195 -33
  8. data/lib/rdf/cli/vocab-loader.rb +13 -3
  9. data/lib/rdf/format.rb +44 -26
  10. data/lib/rdf/mixin/enumerable.rb +133 -97
  11. data/lib/rdf/mixin/enumerator.rb +8 -0
  12. data/lib/rdf/mixin/indexable.rb +1 -1
  13. data/lib/rdf/mixin/mutable.rb +101 -22
  14. data/lib/rdf/mixin/queryable.rb +21 -32
  15. data/lib/rdf/mixin/transactable.rb +94 -0
  16. data/lib/rdf/mixin/writable.rb +12 -3
  17. data/lib/rdf/model/dataset.rb +48 -0
  18. data/lib/rdf/model/graph.rb +73 -43
  19. data/lib/rdf/model/list.rb +61 -33
  20. data/lib/rdf/model/literal.rb +20 -19
  21. data/lib/rdf/model/literal/double.rb +20 -4
  22. data/lib/rdf/model/literal/numeric.rb +15 -13
  23. data/lib/rdf/model/node.rb +15 -16
  24. data/lib/rdf/model/statement.rb +1 -43
  25. data/lib/rdf/model/term.rb +10 -8
  26. data/lib/rdf/model/uri.rb +35 -34
  27. data/lib/rdf/model/value.rb +1 -1
  28. data/lib/rdf/nquads.rb +2 -11
  29. data/lib/rdf/ntriples.rb +1 -1
  30. data/lib/rdf/ntriples/reader.rb +33 -46
  31. data/lib/rdf/ntriples/writer.rb +42 -5
  32. data/lib/rdf/query.rb +6 -40
  33. data/lib/rdf/query/pattern.rb +4 -17
  34. data/lib/rdf/query/solutions.rb +6 -6
  35. data/lib/rdf/reader.rb +65 -14
  36. data/lib/rdf/repository.rb +365 -229
  37. data/lib/rdf/transaction.rb +211 -84
  38. data/lib/rdf/util.rb +1 -0
  39. data/lib/rdf/util/cache.rb +5 -5
  40. data/lib/rdf/util/file.rb +12 -9
  41. data/lib/rdf/util/logger.rb +272 -0
  42. data/lib/rdf/version.rb +2 -2
  43. data/lib/rdf/vocab/owl.rb +82 -77
  44. data/lib/rdf/vocab/rdfs.rb +22 -17
  45. data/lib/rdf/vocab/xsd.rb +5 -0
  46. data/lib/rdf/vocabulary.rb +50 -56
  47. data/lib/rdf/writer.rb +104 -52
  48. metadata +45 -90
  49. data/lib/rdf/mixin/inferable.rb +0 -5
  50. data/lib/rdf/vocab/cc.rb +0 -128
  51. data/lib/rdf/vocab/cert.rb +0 -245
  52. data/lib/rdf/vocab/dc.rb +0 -948
  53. data/lib/rdf/vocab/dc11.rb +0 -167
  54. data/lib/rdf/vocab/dcat.rb +0 -214
  55. data/lib/rdf/vocab/doap.rb +0 -337
  56. data/lib/rdf/vocab/exif.rb +0 -941
  57. data/lib/rdf/vocab/foaf.rb +0 -614
  58. data/lib/rdf/vocab/geo.rb +0 -157
  59. data/lib/rdf/vocab/gr.rb +0 -1501
  60. data/lib/rdf/vocab/ht.rb +0 -236
  61. data/lib/rdf/vocab/ical.rb +0 -528
  62. data/lib/rdf/vocab/ma.rb +0 -513
  63. data/lib/rdf/vocab/mo.rb +0 -2412
  64. data/lib/rdf/vocab/og.rb +0 -222
  65. data/lib/rdf/vocab/ogc.rb +0 -58
  66. data/lib/rdf/vocab/prov.rb +0 -1550
  67. data/lib/rdf/vocab/rsa.rb +0 -72
  68. data/lib/rdf/vocab/rss.rb +0 -66
  69. data/lib/rdf/vocab/schema.rb +0 -10569
  70. data/lib/rdf/vocab/sioc.rb +0 -669
  71. data/lib/rdf/vocab/skos.rb +0 -238
  72. data/lib/rdf/vocab/skosxl.rb +0 -57
  73. data/lib/rdf/vocab/v.rb +0 -383
  74. data/lib/rdf/vocab/vcard.rb +0 -841
  75. data/lib/rdf/vocab/vmd.rb +0 -383
  76. data/lib/rdf/vocab/void.rb +0 -186
  77. data/lib/rdf/vocab/vs.rb +0 -28
  78. data/lib/rdf/vocab/wdrs.rb +0 -134
  79. data/lib/rdf/vocab/wot.rb +0 -167
  80. data/lib/rdf/vocab/xhtml.rb +0 -8
  81. data/lib/rdf/vocab/xhv.rb +0 -505
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rdf
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.99.1
4
+ version: 2.0.0.beta1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arto Bendiken
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-12-17 00:00:00.000000000 Z
13
+ date: 2016-02-22 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: link_header
@@ -33,95 +33,79 @@ dependencies:
33
33
  - !ruby/object:Gem::Version
34
34
  version: 0.0.8
35
35
  - !ruby/object:Gem::Dependency
36
- name: rdf-spec
36
+ name: hamster
37
37
  requirement: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: '1.1'
42
- - - ">="
43
- - !ruby/object:Gem::Version
44
- version: 1.1.13
45
- type: :development
41
+ version: '2.0'
42
+ type: :runtime
46
43
  prerelease: false
47
44
  version_requirements: !ruby/object:Gem::Requirement
48
45
  requirements:
49
46
  - - "~>"
50
47
  - !ruby/object:Gem::Version
51
- version: '1.1'
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: 1.1.13
48
+ version: '2.0'
55
49
  - !ruby/object:Gem::Dependency
56
- name: rdf-rdfxml
50
+ name: rdf-spec
57
51
  requirement: !ruby/object:Gem::Requirement
58
52
  requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '1.1'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
53
+ - - ">="
67
54
  - !ruby/object:Gem::Version
68
- version: '1.1'
69
- - !ruby/object:Gem::Dependency
70
- name: rdf-rdfa
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
55
+ version: 2.0.0.beta
56
+ - - "<"
74
57
  - !ruby/object:Gem::Version
75
- version: '1.1'
58
+ version: '3'
76
59
  type: :development
77
60
  prerelease: false
78
61
  version_requirements: !ruby/object:Gem::Requirement
79
62
  requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: '1.1'
83
- - !ruby/object:Gem::Dependency
84
- name: rdf-turtle
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - "~>"
63
+ - - ">="
88
64
  - !ruby/object:Gem::Version
89
- version: '1.1'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - "~>"
65
+ version: 2.0.0.beta
66
+ - - "<"
95
67
  - !ruby/object:Gem::Version
96
- version: '1.1'
68
+ version: '3'
97
69
  - !ruby/object:Gem::Dependency
98
70
  name: rdf-vocab
99
71
  requirement: !ruby/object:Gem::Requirement
100
72
  requirements:
101
- - - "~>"
73
+ - - ">="
102
74
  - !ruby/object:Gem::Version
103
- version: '0.8'
75
+ version: 2.0.0.beta
76
+ - - "<"
77
+ - !ruby/object:Gem::Version
78
+ version: '3'
104
79
  type: :development
105
80
  prerelease: false
106
81
  version_requirements: !ruby/object:Gem::Requirement
107
82
  requirements:
108
- - - "~>"
83
+ - - ">="
109
84
  - !ruby/object:Gem::Version
110
- version: '0.8'
85
+ version: 2.0.0.beta
86
+ - - "<"
87
+ - !ruby/object:Gem::Version
88
+ version: '3'
111
89
  - !ruby/object:Gem::Dependency
112
90
  name: rdf-xsd
113
91
  requirement: !ruby/object:Gem::Requirement
114
92
  requirements:
115
- - - "~>"
93
+ - - ">="
116
94
  - !ruby/object:Gem::Version
117
- version: '1.1'
95
+ version: 2.0.0.beta
96
+ - - "<"
97
+ - !ruby/object:Gem::Version
98
+ version: '3'
118
99
  type: :development
119
100
  prerelease: false
120
101
  version_requirements: !ruby/object:Gem::Requirement
121
102
  requirements:
122
- - - "~>"
103
+ - - ">="
123
104
  - !ruby/object:Gem::Version
124
- version: '1.1'
105
+ version: 2.0.0.beta
106
+ - - "<"
107
+ - !ruby/object:Gem::Version
108
+ version: '3'
125
109
  - !ruby/object:Gem::Dependency
126
110
  name: rest-client
127
111
  requirement: !ruby/object:Gem::Requirement
@@ -230,13 +214,14 @@ extra_rdoc_files: []
230
214
  files:
231
215
  - AUTHORS
232
216
  - CREDITS
233
- - README
217
+ - README.md
234
218
  - UNLICENSE
235
219
  - VERSION
236
220
  - bin/rdf
237
221
  - etc/doap.nt
238
222
  - lib/df.rb
239
223
  - lib/rdf.rb
224
+ - lib/rdf/changeset.rb
240
225
  - lib/rdf/cli.rb
241
226
  - lib/rdf/cli/vocab-loader.rb
242
227
  - lib/rdf/format.rb
@@ -245,12 +230,13 @@ files:
245
230
  - lib/rdf/mixin/enumerable.rb
246
231
  - lib/rdf/mixin/enumerator.rb
247
232
  - lib/rdf/mixin/indexable.rb
248
- - lib/rdf/mixin/inferable.rb
249
233
  - lib/rdf/mixin/mutable.rb
250
234
  - lib/rdf/mixin/queryable.rb
251
235
  - lib/rdf/mixin/readable.rb
236
+ - lib/rdf/mixin/transactable.rb
252
237
  - lib/rdf/mixin/type_check.rb
253
238
  - lib/rdf/mixin/writable.rb
239
+ - lib/rdf/model/dataset.rb
254
240
  - lib/rdf/model/graph.rb
255
241
  - lib/rdf/model/list.rb
256
242
  - lib/rdf/model/literal.rb
@@ -287,49 +273,18 @@ files:
287
273
  - lib/rdf/util/aliasing.rb
288
274
  - lib/rdf/util/cache.rb
289
275
  - lib/rdf/util/file.rb
276
+ - lib/rdf/util/logger.rb
290
277
  - lib/rdf/util/uuid.rb
291
278
  - lib/rdf/version.rb
292
- - lib/rdf/vocab/cc.rb
293
- - lib/rdf/vocab/cert.rb
294
- - lib/rdf/vocab/dc.rb
295
- - lib/rdf/vocab/dc11.rb
296
- - lib/rdf/vocab/dcat.rb
297
- - lib/rdf/vocab/doap.rb
298
- - lib/rdf/vocab/exif.rb
299
- - lib/rdf/vocab/foaf.rb
300
- - lib/rdf/vocab/geo.rb
301
- - lib/rdf/vocab/gr.rb
302
- - lib/rdf/vocab/ht.rb
303
- - lib/rdf/vocab/ical.rb
304
- - lib/rdf/vocab/ma.rb
305
- - lib/rdf/vocab/mo.rb
306
- - lib/rdf/vocab/og.rb
307
- - lib/rdf/vocab/ogc.rb
308
279
  - lib/rdf/vocab/owl.rb
309
- - lib/rdf/vocab/prov.rb
310
280
  - lib/rdf/vocab/rdfs.rb
311
281
  - lib/rdf/vocab/rdfv.rb
312
- - lib/rdf/vocab/rsa.rb
313
- - lib/rdf/vocab/rss.rb
314
- - lib/rdf/vocab/schema.rb
315
- - lib/rdf/vocab/sioc.rb
316
- - lib/rdf/vocab/skos.rb
317
- - lib/rdf/vocab/skosxl.rb
318
- - lib/rdf/vocab/v.rb
319
- - lib/rdf/vocab/vcard.rb
320
- - lib/rdf/vocab/vmd.rb
321
- - lib/rdf/vocab/void.rb
322
- - lib/rdf/vocab/vs.rb
323
- - lib/rdf/vocab/wdrs.rb
324
- - lib/rdf/vocab/wot.rb
325
- - lib/rdf/vocab/xhtml.rb
326
- - lib/rdf/vocab/xhv.rb
327
282
  - lib/rdf/vocab/xsd.rb
328
283
  - lib/rdf/vocabulary.rb
329
284
  - lib/rdf/writer.rb
330
285
  homepage: http://ruby-rdf.github.com/
331
286
  licenses:
332
- - Public Domain
287
+ - Unlicense
333
288
  metadata: {}
334
289
  post_install_message:
335
290
  rdoc_options: []
@@ -339,15 +294,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
339
294
  requirements:
340
295
  - - ">="
341
296
  - !ruby/object:Gem::Version
342
- version: 1.9.2
297
+ version: '2.0'
343
298
  required_rubygems_version: !ruby/object:Gem::Requirement
344
299
  requirements:
345
- - - ">="
300
+ - - ">"
346
301
  - !ruby/object:Gem::Version
347
- version: '0'
302
+ version: 1.3.1
348
303
  requirements: []
349
304
  rubyforge_project: rdf
350
- rubygems_version: 2.4.8
305
+ rubygems_version: 2.5.1
351
306
  signing_key:
352
307
  specification_version: 4
353
308
  summary: A Ruby library for working with Resource Description Framework (RDF) data.
@@ -1,5 +0,0 @@
1
- module RDF
2
- ##
3
- # @see http://github.com/bendiken/rdfs
4
- module Inferable; end
5
- end
@@ -1,128 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
- # This file generated automatically using vocab-fetch from http://creativecommons.org/ns#
3
- require 'rdf'
4
- module RDF
5
- # @deprecated Please use `RDF::Vocab::CC` from the rdf-vocab gem instead
6
- class CC < RDF::StrictVocabulary("http://creativecommons.org/ns#")
7
-
8
- # Class definitions
9
- term :Jurisdiction,
10
- label: "Jurisdiction".freeze,
11
- type: "rdfs:Class".freeze
12
- term :License,
13
- label: "License".freeze,
14
- subClassOf: "dc:LicenseDocument".freeze,
15
- type: "rdfs:Class".freeze
16
- term :Permission,
17
- label: "Permission".freeze,
18
- type: "rdfs:Class".freeze
19
- term :Prohibition,
20
- label: "Prohibition".freeze,
21
- type: "rdfs:Class".freeze
22
- term :Requirement,
23
- label: "Requirement".freeze,
24
- type: "rdfs:Class".freeze
25
- term :Work,
26
- label: "Work".freeze,
27
- type: "rdfs:Class".freeze
28
-
29
- # Property definitions
30
- property :attributionName,
31
- domain: "cc:Work".freeze,
32
- label: "attributionName".freeze,
33
- range: "rdfs:Literal".freeze,
34
- type: "rdf:Property".freeze
35
- property :attributionURL,
36
- domain: "cc:Work".freeze,
37
- label: "attributionURL".freeze,
38
- range: "rdfs:Resource".freeze,
39
- type: "rdf:Property".freeze
40
- property :deprecatedOn,
41
- domain: "cc:License".freeze,
42
- label: "deprecatedOn".freeze,
43
- range: "xsd:date".freeze,
44
- type: "rdf:Property".freeze
45
- property :jurisdiction,
46
- domain: "cc:License".freeze,
47
- label: "jurisdiction".freeze,
48
- range: "cc:Jurisdiction".freeze,
49
- type: "rdf:Property".freeze
50
- property :legalcode,
51
- domain: "cc:License".freeze,
52
- label: "legalcode".freeze,
53
- range: "rdfs:Resource".freeze,
54
- type: "rdf:Property".freeze
55
- property :license,
56
- domain: "cc:Work".freeze,
57
- label: "license".freeze,
58
- "owl:sameAs" => %(xhv:license).freeze,
59
- range: "cc:License".freeze,
60
- subPropertyOf: "dc:license".freeze,
61
- type: "rdf:Property".freeze
62
- property :morePermissions,
63
- domain: "cc:Work".freeze,
64
- label: "morePermissions".freeze,
65
- range: "rdfs:Resource".freeze,
66
- subPropertyOf: "dc:relation".freeze,
67
- type: "rdf:Property".freeze
68
- property :permits,
69
- domain: "cc:License".freeze,
70
- label: "permits".freeze,
71
- range: "cc:Permission".freeze,
72
- type: "rdf:Property".freeze
73
- property :prohibits,
74
- domain: "cc:License".freeze,
75
- label: "prohibits".freeze,
76
- range: "cc:Prohibition".freeze,
77
- type: "rdf:Property".freeze
78
- property :requires,
79
- domain: "cc:License".freeze,
80
- label: "requires".freeze,
81
- range: "cc:Requirement".freeze,
82
- type: "rdf:Property".freeze
83
- property :useGuidelines,
84
- domain: "cc:Work".freeze,
85
- label: "useGuidelines".freeze,
86
- range: "rdfs:Resource".freeze,
87
- subPropertyOf: "dc:relation".freeze,
88
- type: "rdf:Property".freeze
89
-
90
- # Extra definitions
91
- term :Attribution,
92
- label: "Attribution".freeze,
93
- type: "cc:Requirement".freeze
94
- term :CommercialUse,
95
- label: "CommercialUse".freeze,
96
- type: "cc:Prohibition".freeze
97
- term :Copyleft,
98
- label: "Copyleft".freeze,
99
- type: "cc:Requirement".freeze
100
- term :DerivativeWorks,
101
- label: "DerivativeWorks".freeze,
102
- type: "cc:Permission".freeze
103
- term :Distribution,
104
- label: "Distribution".freeze,
105
- type: "cc:Permission".freeze
106
- term :HighIncomeNationUse,
107
- label: "HighIncomeNationUse".freeze,
108
- type: "cc:Prohibition".freeze
109
- term :LesserCopyleft,
110
- label: "LesserCopyleft".freeze,
111
- type: "cc:Requirement".freeze
112
- term :Notice,
113
- label: "Notice".freeze,
114
- type: "cc:Requirement".freeze
115
- term :Reproduction,
116
- label: "Reproduction".freeze,
117
- type: "cc:Permission".freeze
118
- term :ShareAlike,
119
- label: "ShareAlike".freeze,
120
- type: "cc:Requirement".freeze
121
- term :Sharing,
122
- label: "Sharing".freeze,
123
- type: "cc:Permission".freeze
124
- term :SourceCode,
125
- label: "SourceCode".freeze,
126
- type: "cc:Requirement".freeze
127
- end
128
- end
@@ -1,245 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
- # This file generated automatically using vocab-fetch from http://www.w3.org/ns/auth/cert#
3
- require 'rdf'
4
- module RDF
5
- # @deprecated Please use `RDF::Vocab::CERT` from the rdf-vocab gem instead
6
- class CERT < RDF::StrictVocabulary("http://www.w3.org/ns/auth/cert#")
7
-
8
- # Class definitions
9
- term :Certificate,
10
- comment: %(A certificate is a Document that is signed.
11
- As explained here http://www.pgpi.org/doc/pgpintro/#p16
12
- 'A digital certificate consists of three things:
13
- * A public key.
14
- * Certificate information. \('Identity' information about the
15
- user, such as name, user ID, and so on.\)
16
- * One or more digital signatures.'
17
- ).freeze,
18
- label: "Certificate".freeze,
19
- "rdfs:isDefinedBy" => %(cert:).freeze,
20
- subClassOf: "foaf:Document".freeze,
21
- type: "owl:Class".freeze,
22
- "vs:term_status" => %(unstable).freeze
23
- term :Key,
24
- comment: %(the class of keys).freeze,
25
- label: "Key".freeze,
26
- "rdfs:isDefinedBy" => %(cert:).freeze,
27
- type: "owl:Class".freeze,
28
- "vs:term_status" => %(unstable).freeze
29
- term :PGPCertificate,
30
- comment: %(the class of PGP Certificates).freeze,
31
- label: "PGPCertificate".freeze,
32
- "owl:equivalentClass" => %(wot:PubKey).freeze,
33
- "rdfs:isDefinedBy" => %(cert:).freeze,
34
- subClassOf: "cert:Certificate".freeze,
35
- type: "owl:Class".freeze,
36
- "vs:term_status" => %(unstable).freeze
37
- term :PrivateKey,
38
- comment: %(Private Key).freeze,
39
- label: "PrivateKey".freeze,
40
- "rdfs:isDefinedBy" => %(cert:).freeze,
41
- subClassOf: "cert:Key".freeze,
42
- type: "owl:Class".freeze
43
- term :PublicKey,
44
- comment: %(Public Key).freeze,
45
- label: "PublicKey".freeze,
46
- "rdfs:isDefinedBy" => %(cert:).freeze,
47
- subClassOf: "cert:Key".freeze,
48
- type: "owl:Class".freeze,
49
- "vs:term_status" => %(unstable).freeze
50
- term :RSAKey,
51
- comment: %(
52
- The union of the public and private components of an RSAKey.
53
- Usually those pieces are not kept together
54
- ).freeze,
55
- label: "RSA Key".freeze,
56
- "rdfs:isDefinedBy" => %(cert:).freeze,
57
- subClassOf: "cert:Key".freeze,
58
- type: "owl:Class".freeze,
59
- "vs:term_status" => %(unstable).freeze
60
- term :RSAPublicKey,
61
- comment: %(
62
- The RSA public key. Padded message m are encrypted by applying the function
63
- modulus\(power\(m,exponent\),modulus\)
64
- ).freeze,
65
- label: "RSA Public Key".freeze,
66
- "rdfs:isDefinedBy" => %(cert:).freeze,
67
- "rdfs:seeAlso" => %(http://en.wikipedia.org/wiki/RSA).freeze,
68
- subClassOf: ["cert:PublicKey".freeze, "cert:RSAKey".freeze],
69
- type: "owl:Class".freeze,
70
- "vs:term_status" => %(unstable).freeze
71
- term :Signature,
72
- comment: %(the class of signtatures).freeze,
73
- label: "Signature".freeze,
74
- "rdfs:isDefinedBy" => %(cert:).freeze,
75
- type: "owl:Class".freeze,
76
- "vs:term_status" => %(unstable).freeze
77
- term :X509Certificate,
78
- comment: %(the class of X509 Certificates).freeze,
79
- label: "X509Certificate".freeze,
80
- "rdfs:isDefinedBy" => %(cert:).freeze,
81
- "rdfs:seeAlso" => %(http://en.wikipedia.org/wiki/X509).freeze,
82
- subClassOf: "cert:Certificate".freeze,
83
- type: "owl:Class".freeze,
84
- "vs:term_status" => %(unstable).freeze
85
-
86
- # Property definitions
87
- property :exponent,
88
- comment: %(
89
- The exponent used to encrypt the message. Number chosen between
90
- 1 and the totient\(p*q\). Often named 'e' .
91
- ).freeze,
92
- domain: "cert:RSAPublicKey".freeze,
93
- label: "exponent".freeze,
94
- range: "xsd:nonNegativeInteger".freeze,
95
- "rdfs:isDefinedBy" => %(cert:).freeze,
96
- type: "owl:DatatypeProperty".freeze,
97
- "vs:term_status" => %(unstable).freeze
98
- property :identity,
99
- comment: %(
100
- the identity of the public key. This is the entity that knows the private key and
101
- so can decrypt messages encrypted with the public key, or encrypt messages that can
102
- be decrypted with the public key.
103
- ).freeze,
104
- domain: "cert:PublicKey".freeze,
105
- label: "identity".freeze,
106
- "owl:inverseOf" => %(cert:key).freeze,
107
- "rdfs:isDefinedBy" => %(cert:).freeze,
108
- "skos:editorialNote" => %(
109
- It turns out that this relation is unintuitive to write out and to name.
110
- One should instead use cert:key
111
- ).freeze,
112
- type: ["rdf:Property".freeze, "owl:ObjectProperty".freeze],
113
- "vs:term_status" => %(archaic).freeze
114
- property :key,
115
- comment: %(relates an agent to a key - most often the public key.).freeze,
116
- domain: "foaf:Agent".freeze,
117
- label: "key".freeze,
118
- "owl:inverseOf" => %(cert:identity).freeze,
119
- range: ["cert:Key".freeze, "cert:PublicKey".freeze],
120
- "rdfs:isDefinedBy" => %(cert:).freeze,
121
- type: ["rdf:Property".freeze, "owl:InverseFunctionalProperty".freeze, "owl:ObjectProperty".freeze],
122
- "vs:term_status" => %(unstable).freeze
123
- property :modulus,
124
- comment: %(
125
- <p>The modulus of an RSA public and private key.
126
- Or the modulus of a DSA Key.
127
- The modulus is encoded as a hex binary. The binary is the same as the one encoded in the
128
- <a href="http://www.w3.org/TR/xmldsig-core/#sec-CryptoBinary">XML DSIG CryptoBinary</a>
129
- </p>
130
- <blockquote>
131
- This specification defines the ds:CryptoBinary simple type for representing arbitrary-length integers \(e.g. "bignums"\) in XML as octet strings. The integer value is first converted to a "big endian" bitstring. The bitstring is then padded with leading zero bits so that the total number of bits == 0 mod 8 \(so that there are an integral number of octets\). If the bitstring contains entire leading octets that are zero, these are removed \(so the high-order octet is always non-zero\).
132
- </blockquote>
133
- <p>The only difference is that the octet string is then encoded using either xsd:base64Binary or xsd:hexBinary. Currently for all usages of this relation, the xsd:hexBinary datatype should be used until the SPARQL working group specifies specifies in its <a href="http://www.w3.org/TR/sparql11-entailment/#DEntRegime">D-Entailment</a> that those two types are equivalent.</p>
134
- <p>It would have been better had there been a hexInteger datatype that was standard and supported by all tools.</p>
135
- ).freeze,
136
- domain: ["cert:RSAKey".freeze],
137
- label: "modulus".freeze,
138
- range: ["xsd:base64Binary".freeze, "xsd:hexBinary".freeze],
139
- "rdfs:isDefinedBy" => %(cert:).freeze,
140
- type: "owl:DatatypeProperty".freeze,
141
- "vs:term_status" => %(unstable).freeze
142
- property :privateExponent,
143
- comment: %(
144
- The exponent used to decrypt the message
145
- calculated as
146
- public_exponent*private_exponent = 1 modulo totient\(p*q\)
147
- The private exponent is often named 'd'
148
- ).freeze,
149
- domain: "cert:PrivateKey".freeze,
150
- label: "private".freeze,
151
- range: "xsd:nonNegativeInteger".freeze,
152
- "rdfs:isDefinedBy" => %(cert:).freeze,
153
- type: "owl:DatatypeProperty".freeze,
154
- "vs:term_status" => %(unstable).freeze
155
-
156
- # Datatype definitions
157
- term :hex,
158
- comment: %(<span xmlns="http://www.w3.org/1999/xhtml" xmlns:dc="http://purl.org/dc/terms/" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:skos="http://www.w3.org/2004/02/skos/core#" xmlns:vs="http://www.w3.org/2003/06/sw-vocab-status/ns#"><p>
159
- An encoding of a positive integer \(from 0 to infinity\) as a hexadecimal string that makes it easy to read and/or fun to present on the web.</p>
160
- <p>The purpose of this way of representing hexadecimals is to enable users to copy and paste hexadecimal notations as shown by most browsers, keychains or tools such as opensso, into their rdf representation of choice. There are a wide variety of ways in which such strings can be presented. One finds the following:</p>
161
- <pre>
162
- e1 dc d5 e1 00 8f 21 5e d5 cc 7c 7e c4 9c ad 86
163
- 64 aa dc 29 f2 8d d9 56 7f 31 b6 bd 1b fd b8 ee
164
- 51 0d 3c 84 59 a2 45 d2 13 59 2a 14 82 1a 0f 6e
165
- d3 d1 4a 2d a9 4c 7e db 90 07 fc f1 8d a3 8e 38
166
- 25 21 0a 32 c1 95 31 3c ba 56 cc 17 45 87 e1 eb
167
- fd 9f 0f 82 16 67 9f 67 fa 91 e4 0d 55 4e 52 c0
168
- 66 64 2f fe 98 8f ae f8 96 21 5e ea 38 9e 5c 4f
169
- 27 e2 48 ca ca f2 90 23 ad 99 4b cc 38 32 6d bf
170
- </pre>
171
- <p>
172
- Or the same as the above, with ':' instead of spaces. We can't guarantee that these are the only ways such tools will present hexadecimals, so we are very lax.</p>
173
- <p>The letters can be uppercase or lowercase, or mixed. </p>
174
- <p>Some strings may start with initial 00's, and can be stripped in this notation as they often are. Doing this could, in complement of 2 notation turn a positive number into a negative one, if the first hexadecimal character happens to be one of the set {'8', '9', 'a', 'A', 'b', 'B', 'c', 'C', 'd', 'D', 'e', 'E', 'f', 'F'} . As we interpret this string as a hexadecimal number leading 00s are not important \(Complement of 2 notation and hexadecimal overlap for positive numbers\)</p>
175
- <p> In order to make this fun, we allow any unicode characters in the string. A parser should </p>
176
- <ol>
177
- <li>remove all non hexadecimal characters</li>
178
- <li>treat the resulting as a hexadecimal representation of a number</li>
179
- </ol>
180
- <p>
181
- This will allow people to make an ascii - better yet a UTF-8 - picture of their public key when publishing it on the web.
182
- </p>
183
- <p>
184
- Cert hex is also a datatype property because we used to write it out like this
185
- </p>
186
- <pre>
187
- [] a rsa:RSAPublicKey;
188
- rsa:public_exponent [ cert:hex "e1 dc d5 ..."]
189
- </pre>
190
- <p> The above notation is now deprecated. Now we prefer the literal format below.</p>
191
- <pre>
192
- [] a rsa:RSAPublicKey;
193
- rsa:public_exponent "e1 dc d5 ..."^^cert:hex .
194
- </pre>
195
- </span>
196
- ).freeze,
197
- label: "hexadecimal".freeze,
198
- "owl:equivalentClass" => %(xsd:nonNegativeInteger).freeze,
199
- "rdfs:isDefinedBy" => %(cert:).freeze,
200
- "rdfs:seeAlso" => %(http://en.wikipedia.org/wiki/Hexadecimal).freeze,
201
- "skos:editorialNote" => %(<span xmlns="http://www.w3.org/1999/xhtml"><p>
202
- This relation should slowly be transited to just being a datatype.</p>
203
- <p>Being a datatype and a property is legal as explained here
204
- <a href="http://lists.w3.org/Archives/Public/semantic-web/2010Mar/0037.html">on the semantic web mailing list in March 2010</a>.
205
- But it may be somewhat confusing, especially if it goes against a pattern - still to be set - by the xsd datatypes as the follow up email makes clear. </p></span>
206
- ).freeze,
207
- type: "rdfs:Datatype".freeze,
208
- "vs:term_status" => %(archaic).freeze
209
-
210
- # Extra definitions
211
- term :"",
212
- comment: %(
213
- Ontology for Certificates and crypto stuff.
214
- This is in development.
215
- Some other ontologies to look at:
216
- * http://www.w3.org/2000/10/swap/crypto
217
- + has cwm builtins: http://www.w3.org/2000/10/swap/doc/Trust
218
- - a bit old perhaps. It imports daml+oil
219
- - would help to be more completely specified
220
- - uses literals as subjects a little liberally, which makes this a
221
- bit difficult to work with frameworks that don't permit this
222
- * http://xmlns.com/wot/0.1/
223
- - limited very much to PGP \(though on can map PGP to X509\)
224
- - a little coarse grained, mixes up the PGP certificate with the PGP
225
- public key
226
- *
227
- Todo:
228
- - add some classes and relations for DSA
229
- - should this all be in one file? Or should this be cut up a little? Say one file for the general CERT ontology, and then files for RSA, DSA, PGP, etc... Or perhaps it does not really matter?
230
- - expand more on the certification side of things
231
- - verify this by security experts
232
- - owl2 has some constructs for combined inverse functional properties.
233
- This may be useful to use in defining an RSA key which is identified
234
- by two numbers.
235
- - also create html version of the spec by using this as a template.
236
- - should comments such as this be in html?
237
- ).freeze,
238
- "dc:created" => %(2008-11-13).freeze,
239
- "foaf:maker" => %(http://bblfish.net/people/henry/card#me).freeze,
240
- label: "Ontology for Certificates and crypto stuff.".freeze,
241
- "rdfs:seeAlso" => [%(http://lists.foaf-project.org/mailman/listinfo/foaf-protocols).freeze, %(http://www.w3.org/ns/auth/X509Uml.svg).freeze, %(http://www.w3.org/ns/auth/rsa).freeze],
242
- type: "owl:Ontology".freeze,
243
- "vs:term_status" => %(unstable).freeze
244
- end
245
- end