rdf 3.1.10 → 3.1.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +33 -10
- data/VERSION +1 -1
- data/lib/rdf/vocab/owl.rb +366 -388
- data/lib/rdf/vocab/rdfs.rb +72 -74
- data/lib/rdf/vocab/rdfv.rb +74 -74
- data/lib/rdf/vocab/writer.rb +41 -25
- data/lib/rdf/vocab/xsd.rb +198 -463
- data/lib/rdf/vocabulary.rb +133 -85
- metadata +2 -2
data/lib/rdf/vocab/rdfs.rb
CHANGED
@@ -7,7 +7,6 @@ module RDF
|
|
7
7
|
# # Vocabulary for <http://www.w3.org/2000/01/rdf-schema#>
|
8
8
|
# #
|
9
9
|
# # The RDF Schema vocabulary (RDFS)
|
10
|
-
# # @see http://www.w3.org/2000/01/rdf-schema-more
|
11
10
|
# class RDFS < RDF::StrictVocabulary
|
12
11
|
# # The class of classes.
|
13
12
|
# # @return [RDF::Vocabulary::Term]
|
@@ -74,112 +73,111 @@ module RDF
|
|
74
73
|
|
75
74
|
# Ontology definition
|
76
75
|
ontology :"http://www.w3.org/2000/01/rdf-schema#",
|
77
|
-
"
|
78
|
-
"
|
79
|
-
type: "owl
|
76
|
+
"http://purl.org/dc/elements/1.1/title": "The RDF Schema vocabulary (RDFS)".freeze,
|
77
|
+
"http://www.w3.org/2000/01/rdf-schema#seeAlso": "http://www.w3.org/2000/01/rdf-schema-more".freeze,
|
78
|
+
type: "http://www.w3.org/2002/07/owl#Ontology".freeze
|
80
79
|
|
81
80
|
# Class definitions
|
82
81
|
term :Class,
|
83
|
-
comment:
|
84
|
-
isDefinedBy: "
|
82
|
+
comment: "The class of classes.".freeze,
|
83
|
+
isDefinedBy: "http://www.w3.org/2000/01/rdf-schema#".freeze,
|
85
84
|
label: "Class".freeze,
|
86
|
-
subClassOf: "
|
87
|
-
type: "
|
85
|
+
subClassOf: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze,
|
86
|
+
type: "http://www.w3.org/2000/01/rdf-schema#Class".freeze
|
88
87
|
term :Container,
|
89
|
-
comment:
|
90
|
-
isDefinedBy: "
|
88
|
+
comment: "The class of RDF containers.".freeze,
|
89
|
+
isDefinedBy: "http://www.w3.org/2000/01/rdf-schema#".freeze,
|
91
90
|
label: "Container".freeze,
|
92
|
-
subClassOf: "
|
93
|
-
type: "
|
91
|
+
subClassOf: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze,
|
92
|
+
type: "http://www.w3.org/2000/01/rdf-schema#Class".freeze
|
94
93
|
term :ContainerMembershipProperty,
|
95
|
-
comment:
|
96
|
-
|
97
|
-
isDefinedBy: "rdfs:".freeze,
|
94
|
+
comment: "The class of container membership properties, rdf:_1, rdf:_2, ...,\n all of which are sub-properties of 'member'.".freeze,
|
95
|
+
isDefinedBy: "http://www.w3.org/2000/01/rdf-schema#".freeze,
|
98
96
|
label: "ContainerMembershipProperty".freeze,
|
99
|
-
subClassOf: "rdf
|
100
|
-
type: "
|
97
|
+
subClassOf: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze,
|
98
|
+
type: "http://www.w3.org/2000/01/rdf-schema#Class".freeze
|
101
99
|
term :Datatype,
|
102
|
-
comment:
|
103
|
-
isDefinedBy: "
|
100
|
+
comment: "The class of RDF datatypes.".freeze,
|
101
|
+
isDefinedBy: "http://www.w3.org/2000/01/rdf-schema#".freeze,
|
104
102
|
label: "Datatype".freeze,
|
105
|
-
subClassOf: "
|
106
|
-
type: "
|
103
|
+
subClassOf: "http://www.w3.org/2000/01/rdf-schema#Class".freeze,
|
104
|
+
type: "http://www.w3.org/2000/01/rdf-schema#Class".freeze
|
107
105
|
term :Literal,
|
108
|
-
comment:
|
109
|
-
isDefinedBy: "
|
106
|
+
comment: "The class of literal values, eg. textual strings and integers.".freeze,
|
107
|
+
isDefinedBy: "http://www.w3.org/2000/01/rdf-schema#".freeze,
|
110
108
|
label: "Literal".freeze,
|
111
|
-
subClassOf: "
|
112
|
-
type: "
|
109
|
+
subClassOf: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze,
|
110
|
+
type: "http://www.w3.org/2000/01/rdf-schema#Class".freeze
|
113
111
|
term :Resource,
|
114
|
-
comment:
|
115
|
-
isDefinedBy: "
|
112
|
+
comment: "The class resource, everything.".freeze,
|
113
|
+
isDefinedBy: "http://www.w3.org/2000/01/rdf-schema#".freeze,
|
116
114
|
label: "Resource".freeze,
|
117
|
-
type: "
|
115
|
+
type: "http://www.w3.org/2000/01/rdf-schema#Class".freeze
|
118
116
|
|
119
117
|
# Property definitions
|
120
118
|
property :comment,
|
121
|
-
comment:
|
122
|
-
domain: "
|
123
|
-
isDefinedBy: "
|
119
|
+
comment: "A description of the subject resource.".freeze,
|
120
|
+
domain: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze,
|
121
|
+
isDefinedBy: "http://www.w3.org/2000/01/rdf-schema#".freeze,
|
124
122
|
label: "comment".freeze,
|
125
|
-
range: "
|
126
|
-
type: "rdf
|
123
|
+
range: "http://www.w3.org/2000/01/rdf-schema#Literal".freeze,
|
124
|
+
type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze
|
127
125
|
property :domain,
|
128
|
-
comment:
|
129
|
-
domain: "rdf
|
130
|
-
isDefinedBy: "
|
126
|
+
comment: "A domain of the subject property.".freeze,
|
127
|
+
domain: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze,
|
128
|
+
isDefinedBy: "http://www.w3.org/2000/01/rdf-schema#".freeze,
|
131
129
|
label: "domain".freeze,
|
132
|
-
range: "
|
133
|
-
type: "rdf
|
130
|
+
range: "http://www.w3.org/2000/01/rdf-schema#Class".freeze,
|
131
|
+
type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze
|
134
132
|
property :isDefinedBy,
|
135
|
-
comment:
|
136
|
-
domain: "
|
137
|
-
isDefinedBy: "
|
133
|
+
comment: "The defininition of the subject resource.".freeze,
|
134
|
+
domain: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze,
|
135
|
+
isDefinedBy: "http://www.w3.org/2000/01/rdf-schema#".freeze,
|
138
136
|
label: "isDefinedBy".freeze,
|
139
|
-
range: "
|
140
|
-
subPropertyOf: "
|
141
|
-
type: "rdf
|
137
|
+
range: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze,
|
138
|
+
subPropertyOf: "http://www.w3.org/2000/01/rdf-schema#seeAlso".freeze,
|
139
|
+
type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze
|
142
140
|
property :label,
|
143
|
-
comment:
|
144
|
-
domain: "
|
145
|
-
isDefinedBy: "
|
141
|
+
comment: "A human-readable name for the subject.".freeze,
|
142
|
+
domain: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze,
|
143
|
+
isDefinedBy: "http://www.w3.org/2000/01/rdf-schema#".freeze,
|
146
144
|
label: "label".freeze,
|
147
|
-
range: "
|
148
|
-
type: "rdf
|
145
|
+
range: "http://www.w3.org/2000/01/rdf-schema#Literal".freeze,
|
146
|
+
type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze
|
149
147
|
property :member,
|
150
|
-
comment:
|
151
|
-
domain: "
|
152
|
-
isDefinedBy: "
|
148
|
+
comment: "A member of the subject resource.".freeze,
|
149
|
+
domain: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze,
|
150
|
+
isDefinedBy: "http://www.w3.org/2000/01/rdf-schema#".freeze,
|
153
151
|
label: "member".freeze,
|
154
|
-
range: "
|
155
|
-
type: "rdf
|
152
|
+
range: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze,
|
153
|
+
type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze
|
156
154
|
property :range,
|
157
|
-
comment:
|
158
|
-
domain: "rdf
|
159
|
-
isDefinedBy: "
|
155
|
+
comment: "A range of the subject property.".freeze,
|
156
|
+
domain: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze,
|
157
|
+
isDefinedBy: "http://www.w3.org/2000/01/rdf-schema#".freeze,
|
160
158
|
label: "range".freeze,
|
161
|
-
range: "
|
162
|
-
type: "rdf
|
159
|
+
range: "http://www.w3.org/2000/01/rdf-schema#Class".freeze,
|
160
|
+
type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze
|
163
161
|
property :seeAlso,
|
164
|
-
comment:
|
165
|
-
domain: "
|
166
|
-
isDefinedBy: "
|
162
|
+
comment: "Further information about the subject resource.".freeze,
|
163
|
+
domain: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze,
|
164
|
+
isDefinedBy: "http://www.w3.org/2000/01/rdf-schema#".freeze,
|
167
165
|
label: "seeAlso".freeze,
|
168
|
-
range: "
|
169
|
-
type: "rdf
|
166
|
+
range: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze,
|
167
|
+
type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze
|
170
168
|
property :subClassOf,
|
171
|
-
comment:
|
172
|
-
domain: "
|
173
|
-
isDefinedBy: "
|
169
|
+
comment: "The subject is a subclass of a class.".freeze,
|
170
|
+
domain: "http://www.w3.org/2000/01/rdf-schema#Class".freeze,
|
171
|
+
isDefinedBy: "http://www.w3.org/2000/01/rdf-schema#".freeze,
|
174
172
|
label: "subClassOf".freeze,
|
175
|
-
range: "
|
176
|
-
type: "rdf
|
173
|
+
range: "http://www.w3.org/2000/01/rdf-schema#Class".freeze,
|
174
|
+
type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze
|
177
175
|
property :subPropertyOf,
|
178
|
-
comment:
|
179
|
-
domain: "rdf
|
180
|
-
isDefinedBy: "
|
176
|
+
comment: "The subject is a subproperty of a property.".freeze,
|
177
|
+
domain: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze,
|
178
|
+
isDefinedBy: "http://www.w3.org/2000/01/rdf-schema#".freeze,
|
181
179
|
label: "subPropertyOf".freeze,
|
182
|
-
range: "rdf
|
183
|
-
type: "rdf
|
180
|
+
range: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze,
|
181
|
+
type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze
|
184
182
|
end
|
185
183
|
end
|
data/lib/rdf/vocab/rdfv.rb
CHANGED
@@ -137,152 +137,152 @@ module RDF
|
|
137
137
|
|
138
138
|
# Ontology definition
|
139
139
|
ontology :"http://www.w3.org/1999/02/22-rdf-syntax-ns#",
|
140
|
-
"
|
141
|
-
"
|
140
|
+
"http://purl.org/dc/elements/1.1/description": %(This is the RDF Schema for the RDF vocabulary terms in the RDF Namespace, defined in RDF 1.1 Concepts.).freeze,
|
141
|
+
"http://purl.org/dc/elements/1.1/title": %(The RDF Concepts Vocabulary \(RDF\)).freeze,
|
142
142
|
type: "owl:Ontology".freeze
|
143
143
|
|
144
144
|
# Class definitions
|
145
145
|
term :Alt,
|
146
146
|
comment: %(The class of containers of alternatives.).freeze,
|
147
147
|
label: "Alt".freeze,
|
148
|
-
isDefinedBy: %(rdf
|
149
|
-
subClassOf: "
|
150
|
-
type: "
|
148
|
+
isDefinedBy: %(http://www.w3.org/1999/02/22-rdf-syntax-ns#).freeze,
|
149
|
+
subClassOf: "http://www.w3.org/2000/01/rdf-schema#Container".freeze,
|
150
|
+
type: "http://www.w3.org/2000/01/rdf-schema#Class".freeze
|
151
151
|
term :Bag,
|
152
152
|
comment: %(The class of unordered containers.).freeze,
|
153
153
|
label: "Bag".freeze,
|
154
|
-
isDefinedBy: %(rdf
|
155
|
-
subClassOf: "
|
156
|
-
type: "
|
154
|
+
isDefinedBy: %(http://www.w3.org/1999/02/22-rdf-syntax-ns#).freeze,
|
155
|
+
subClassOf: "http://www.w3.org/2000/01/rdf-schema#Container".freeze,
|
156
|
+
type: "http://www.w3.org/2000/01/rdf-schema#Class".freeze
|
157
157
|
term :CompoundLiteral,
|
158
158
|
comment: %(A class representing a compound literal.).freeze,
|
159
159
|
label: "CompoundLiteral".freeze,
|
160
160
|
isDefinedBy: %(http://www.w3.org/1999/02/22-rdf-syntax-ns#).freeze,
|
161
|
-
subClassOf: "
|
162
|
-
type: "
|
161
|
+
subClassOf: "http://www.w3.org/2000/01/rdf-schema#Class".freeze,
|
162
|
+
type: "http://www.w3.org/2000/01/rdf-schema#Class".freeze
|
163
163
|
term :List,
|
164
164
|
comment: %(The class of RDF Lists.).freeze,
|
165
165
|
label: "List".freeze,
|
166
|
-
isDefinedBy: %(rdf
|
167
|
-
subClassOf: "
|
168
|
-
type: "
|
166
|
+
isDefinedBy: %(http://www.w3.org/1999/02/22-rdf-syntax-ns#).freeze,
|
167
|
+
subClassOf: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze,
|
168
|
+
type: "http://www.w3.org/2000/01/rdf-schema#Class".freeze
|
169
169
|
term :Property,
|
170
170
|
comment: %(The class of RDF properties.).freeze,
|
171
171
|
label: "Property".freeze,
|
172
|
-
isDefinedBy: %(rdf
|
173
|
-
subClassOf: "
|
174
|
-
type: "
|
172
|
+
isDefinedBy: %(http://www.w3.org/1999/02/22-rdf-syntax-ns#).freeze,
|
173
|
+
subClassOf: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze,
|
174
|
+
type: "http://www.w3.org/2000/01/rdf-schema#Class".freeze
|
175
175
|
term :Seq,
|
176
176
|
comment: %(The class of ordered containers.).freeze,
|
177
177
|
label: "Seq".freeze,
|
178
|
-
isDefinedBy: %(rdf
|
179
|
-
subClassOf: "
|
180
|
-
type: "
|
178
|
+
isDefinedBy: %(http://www.w3.org/1999/02/22-rdf-syntax-ns#).freeze,
|
179
|
+
subClassOf: "http://www.w3.org/2000/01/rdf-schema#Container".freeze,
|
180
|
+
type: "http://www.w3.org/2000/01/rdf-schema#Class".freeze
|
181
181
|
term :Statement,
|
182
182
|
comment: %(The class of RDF statements.).freeze,
|
183
183
|
label: "Statement".freeze,
|
184
|
-
isDefinedBy: %(rdf
|
185
|
-
subClassOf: "
|
186
|
-
type: "
|
184
|
+
isDefinedBy: %(http://www.w3.org/1999/02/22-rdf-syntax-ns#).freeze,
|
185
|
+
subClassOf: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze,
|
186
|
+
type: "http://www.w3.org/2000/01/rdf-schema#Class".freeze
|
187
187
|
|
188
188
|
# Property definitions
|
189
189
|
property :direction,
|
190
190
|
comment: %(The direction component of a CompoundLiteral.).freeze,
|
191
|
-
domain: "rdf
|
191
|
+
domain: "http://www.w3.org/1999/02/22-rdf-syntax-ns#CompoundLiteral".freeze,
|
192
192
|
label: "direction".freeze,
|
193
|
-
range: "
|
193
|
+
range: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze,
|
194
194
|
isDefinedBy: %(http://www.w3.org/1999/02/22-rdf-syntax-ns#).freeze,
|
195
|
-
type: "rdf
|
195
|
+
type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze
|
196
196
|
property :first,
|
197
197
|
comment: %(The first item in the subject RDF list.).freeze,
|
198
|
-
domain: "rdf
|
198
|
+
domain: "http://www.w3.org/1999/02/22-rdf-syntax-ns#List".freeze,
|
199
199
|
label: "first".freeze,
|
200
|
-
range: "
|
201
|
-
isDefinedBy: %(rdf
|
202
|
-
type: "rdf
|
200
|
+
range: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze,
|
201
|
+
isDefinedBy: %(http://www.w3.org/1999/02/22-rdf-syntax-ns#).freeze,
|
202
|
+
type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze
|
203
203
|
property :object,
|
204
204
|
comment: %(The object of the subject RDF statement.).freeze,
|
205
|
-
domain: "rdf
|
205
|
+
domain: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement".freeze,
|
206
206
|
label: "object".freeze,
|
207
|
-
range: "
|
208
|
-
isDefinedBy: %(rdf
|
209
|
-
type: "rdf
|
207
|
+
range: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze,
|
208
|
+
isDefinedBy: %(http://www.w3.org/1999/02/22-rdf-syntax-ns#).freeze,
|
209
|
+
type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze
|
210
210
|
property :language,
|
211
211
|
comment: %(The language component of a CompoundLiteral.).freeze,
|
212
|
-
domain: "rdf
|
212
|
+
domain: "http://www.w3.org/1999/02/22-rdf-syntax-ns#CompoundLiteral".freeze,
|
213
213
|
label: "language".freeze,
|
214
|
-
range: "
|
214
|
+
range: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze,
|
215
215
|
isDefinedBy: %(http://www.w3.org/1999/02/22-rdf-syntax-ns#).freeze,
|
216
|
-
type: "rdf
|
216
|
+
type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze
|
217
217
|
property :predicate,
|
218
218
|
comment: %(The predicate of the subject RDF statement.).freeze,
|
219
|
-
domain: "rdf
|
219
|
+
domain: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement".freeze,
|
220
220
|
label: "predicate".freeze,
|
221
|
-
range: "
|
222
|
-
isDefinedBy: %(rdf
|
223
|
-
type: "rdf
|
221
|
+
range: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze,
|
222
|
+
isDefinedBy: %(http://www.w3.org/1999/02/22-rdf-syntax-ns#).freeze,
|
223
|
+
type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze
|
224
224
|
property :rest,
|
225
225
|
comment: %(The rest of the subject RDF list after the first item.).freeze,
|
226
|
-
domain: "rdf
|
226
|
+
domain: "http://www.w3.org/1999/02/22-rdf-syntax-ns#List".freeze,
|
227
227
|
label: "rest".freeze,
|
228
|
-
range: "rdf
|
229
|
-
isDefinedBy: %(rdf
|
230
|
-
type: "rdf
|
228
|
+
range: "http://www.w3.org/1999/02/22-rdf-syntax-ns#List".freeze,
|
229
|
+
isDefinedBy: %(http://www.w3.org/1999/02/22-rdf-syntax-ns#).freeze,
|
230
|
+
type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze
|
231
231
|
property :subject,
|
232
232
|
comment: %(The subject of the subject RDF statement.).freeze,
|
233
|
-
domain: "rdf
|
233
|
+
domain: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement".freeze,
|
234
234
|
label: "subject".freeze,
|
235
|
-
range: "
|
236
|
-
isDefinedBy: %(rdf
|
237
|
-
type: "rdf
|
235
|
+
range: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze,
|
236
|
+
isDefinedBy: %(http://www.w3.org/1999/02/22-rdf-syntax-ns#).freeze,
|
237
|
+
type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze
|
238
238
|
property :type,
|
239
239
|
comment: %(The subject is an instance of a class.).freeze,
|
240
|
-
domain: "
|
240
|
+
domain: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze,
|
241
241
|
label: "type".freeze,
|
242
|
-
range: "
|
243
|
-
isDefinedBy: %(rdf
|
244
|
-
type: "rdf
|
242
|
+
range: "http://www.w3.org/2000/01/rdf-schema#Class".freeze,
|
243
|
+
isDefinedBy: %(http://www.w3.org/1999/02/22-rdf-syntax-ns#).freeze,
|
244
|
+
type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze
|
245
245
|
property :value,
|
246
246
|
comment: %(Idiomatic property used for structured values.).freeze,
|
247
|
-
domain: "
|
247
|
+
domain: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze,
|
248
248
|
label: "value".freeze,
|
249
|
-
range: "
|
250
|
-
isDefinedBy: %(rdf
|
251
|
-
type: "rdf
|
249
|
+
range: "http://www.w3.org/2000/01/rdf-schema#Resource".freeze,
|
250
|
+
isDefinedBy: %(http://www.w3.org/1999/02/22-rdf-syntax-ns#).freeze,
|
251
|
+
type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property".freeze
|
252
252
|
|
253
253
|
# Datatype definitions
|
254
254
|
term :HTML,
|
255
255
|
comment: %(The datatype of RDF literals storing fragments of HTML content).freeze,
|
256
256
|
label: "HTML".freeze,
|
257
|
-
isDefinedBy: %(rdf
|
258
|
-
"
|
259
|
-
subClassOf: "
|
260
|
-
type: "
|
257
|
+
isDefinedBy: %(http://www.w3.org/1999/02/22-rdf-syntax-ns#).freeze,
|
258
|
+
"http://www.w3.org/2000/01/rdf-schema#seeAlso": %(http://www.w3.org/TR/rdf11-concepts/#section-html).freeze,
|
259
|
+
subClassOf: "http://www.w3.org/2000/01/rdf-schema#Literal".freeze,
|
260
|
+
type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze
|
261
261
|
property :JSON,
|
262
262
|
comment: %(The datatype of RDF literals storing JSON content.).freeze,
|
263
263
|
label: "JSON".freeze,
|
264
264
|
isDefinedBy: %(http://www.w3.org/1999/02/22-rdf-syntax-ns#).freeze,
|
265
|
-
type: "
|
265
|
+
type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze
|
266
266
|
term :PlainLiteral,
|
267
267
|
comment: %(The class of plain \(i.e. untyped\) literal values, as used in RIF and OWL 2).freeze,
|
268
268
|
label: "PlainLiteral".freeze,
|
269
|
-
isDefinedBy: %(rdf
|
270
|
-
"
|
271
|
-
subClassOf: "
|
272
|
-
type: "
|
269
|
+
isDefinedBy: %(http://www.w3.org/1999/02/22-rdf-syntax-ns#).freeze,
|
270
|
+
"http://www.w3.org/2000/01/rdf-schema#seeAlso": %(http://www.w3.org/TR/rdf-plain-literal/).freeze,
|
271
|
+
subClassOf: "http://www.w3.org/2000/01/rdf-schema#Literal".freeze,
|
272
|
+
type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze
|
273
273
|
term :XMLLiteral,
|
274
274
|
comment: %(The datatype of XML literal values.).freeze,
|
275
275
|
label: "XMLLiteral".freeze,
|
276
|
-
isDefinedBy: %(rdf
|
277
|
-
subClassOf: "
|
278
|
-
type: "
|
276
|
+
isDefinedBy: %(http://www.w3.org/1999/02/22-rdf-syntax-ns#).freeze,
|
277
|
+
subClassOf: "http://www.w3.org/2000/01/rdf-schema#Literal".freeze,
|
278
|
+
type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze
|
279
279
|
term :langString,
|
280
280
|
comment: %(The datatype of language-tagged string values).freeze,
|
281
281
|
label: "langString".freeze,
|
282
|
-
isDefinedBy: %(rdf
|
283
|
-
"
|
284
|
-
subClassOf: "
|
285
|
-
type: "
|
282
|
+
isDefinedBy: %(http://www.w3.org/1999/02/22-rdf-syntax-ns#).freeze,
|
283
|
+
"http://www.w3.org/2000/01/rdf-schema#seeAlso": %(http://www.w3.org/TR/rdf11-concepts/#section-Graph-Literal).freeze,
|
284
|
+
subClassOf: "http://www.w3.org/2000/01/rdf-schema#Literal".freeze,
|
285
|
+
type: "http://www.w3.org/2000/01/rdf-schema#Datatype".freeze
|
286
286
|
|
287
287
|
# Extra definitions
|
288
288
|
term :Description,
|
@@ -303,8 +303,8 @@ module RDF
|
|
303
303
|
term :nil,
|
304
304
|
comment: %(The empty list, with no items in it. If the rest of a list is nil then the list has no more items in it.).freeze,
|
305
305
|
label: "nil".freeze,
|
306
|
-
isDefinedBy: %(rdf
|
307
|
-
type: "rdf
|
306
|
+
isDefinedBy: %(http://www.w3.org/1999/02/22-rdf-syntax-ns#).freeze,
|
307
|
+
type: "http://www.w3.org/1999/02/22-rdf-syntax-ns#List".freeze
|
308
308
|
term :nodeID,
|
309
309
|
comment: %(RDF/XML Blank Node identifier).freeze,
|
310
310
|
label: "nodeID".freeze
|
data/lib/rdf/vocab/writer.rb
CHANGED
@@ -65,12 +65,30 @@ module RDF
|
|
65
65
|
on: ["--class-name NAME"],
|
66
66
|
use: :required,
|
67
67
|
description: "Name of created Ruby class (vocabulary format)."),
|
68
|
+
RDF::CLI::Option.new(
|
69
|
+
symbol: :extra,
|
70
|
+
datatype: String,
|
71
|
+
control: :none,
|
72
|
+
on: ["--extra URIEncodedJSON"],
|
73
|
+
description: "URI Encoded JSON representation of extra data"
|
74
|
+
) do |arg|
|
75
|
+
::JSON.parse(::CGI.unescape(arg)).inject({}) do |m1, (term, defs)|
|
76
|
+
d1 = defs.inject({}) {|m, (k,v)| m.merge(k.to_sym => v)}
|
77
|
+
m1.merge(term.to_sym => d1)
|
78
|
+
end
|
79
|
+
end,
|
68
80
|
RDF::CLI::Option.new(
|
69
81
|
symbol: :module_name,
|
70
82
|
datatype: String,
|
71
83
|
control: :text,
|
72
84
|
on: ["--module-name NAME"],
|
73
85
|
description: "Name of Ruby module containing class-name (vocabulary format)."),
|
86
|
+
RDF::CLI::Option.new(
|
87
|
+
symbol: :noDoc,
|
88
|
+
datatype: TrueClass,
|
89
|
+
control: :checkbox,
|
90
|
+
on: ["--noDoc"],
|
91
|
+
description: "Do not output Yard documentation."),
|
74
92
|
RDF::CLI::Option.new(
|
75
93
|
symbol: :strict,
|
76
94
|
datatype: TrueClass,
|
@@ -78,18 +96,6 @@ module RDF
|
|
78
96
|
on: ["--strict"],
|
79
97
|
description: "Make strict vocabulary"
|
80
98
|
) {true},
|
81
|
-
RDF::CLI::Option.new(
|
82
|
-
symbol: :extra,
|
83
|
-
datatype: String,
|
84
|
-
control: :none,
|
85
|
-
on: ["--extra URIEncodedJSON"],
|
86
|
-
description: "URI Encoded JSON representation of extra data"
|
87
|
-
) do |arg|
|
88
|
-
::JSON.parse(::CGI.unescape(arg)).inject({}) do |m1, (term, defs)|
|
89
|
-
d1 = defs.inject({}) {|m, (k,v)| m.merge(k.to_sym => v)}
|
90
|
-
m1.merge(term.to_sym => d1)
|
91
|
-
end
|
92
|
-
end,
|
93
99
|
]
|
94
100
|
end
|
95
101
|
|
@@ -144,30 +150,40 @@ module RDF
|
|
144
150
|
# This file generated automatically using rdf vocabulary format from #{source}
|
145
151
|
require 'rdf'
|
146
152
|
module #{module_name}
|
147
|
-
|
153
|
+
).gsub(/^ /, '')
|
154
|
+
|
155
|
+
@output.print %( # @!parse
|
148
156
|
# # Vocabulary for <#{base_uri}>
|
149
157
|
# #
|
150
|
-
).gsub(/^ /, '')
|
158
|
+
).gsub(/^ /, '') unless @options[:noDoc]
|
151
159
|
|
152
|
-
if vocab.ontology
|
160
|
+
if vocab.ontology && !@options[:noDoc]
|
153
161
|
ont_doc = []
|
154
|
-
|
162
|
+
%i(
|
163
|
+
http://purl.org/dc/terms/title
|
164
|
+
http://purl.org/dc/elements/1.1/title
|
165
|
+
label
|
166
|
+
comment
|
167
|
+
http://purl.org/dc/terms/description
|
168
|
+
http://purl.org/dc/elements/1.1/description
|
169
|
+
).each do |attr|
|
155
170
|
next unless vocab.ontology.attributes[attr]
|
156
171
|
Array(vocab.ontology.attributes[attr]).each do |v|
|
157
|
-
ont_doc << " # # " + v.to_s.gsub(/\
|
172
|
+
ont_doc << " # # " + v.to_s.gsub(/\s+/, ' ')
|
158
173
|
end
|
159
174
|
end
|
160
175
|
@output.puts ont_doc.join("\n # #\n") unless ont_doc.empty?
|
161
176
|
# Version Info
|
162
|
-
|
177
|
+
# See Also
|
178
|
+
Array(vocab.ontology.attributes[:'http://www.w3.org/2002/07/owl#versionInfo']).each do |vers|
|
163
179
|
@output.puts " # # @version #{vers}"
|
164
180
|
end
|
165
181
|
# See Also
|
166
|
-
Array(vocab.ontology.attributes[:
|
182
|
+
Array(vocab.ontology.attributes[:'http://www.w3.org/2000/01/rdf-schema#seeAlso']).each do |see|
|
167
183
|
@output.puts " # # @see #{see}"
|
168
184
|
end
|
169
185
|
end
|
170
|
-
@output.puts %( # class #{class_name} < RDF::#{"Strict" if strict}Vocabulary)
|
186
|
+
@output.puts %( # class #{class_name} < RDF::#{"Strict" if strict}Vocabulary) unless @options[:noDoc]
|
171
187
|
|
172
188
|
# Split nodes into Class/Property/Datatype/Other
|
173
189
|
term_nodes = {
|
@@ -207,16 +223,16 @@ module RDF
|
|
207
223
|
# Only document terms that can be accessed like a Ruby attribute
|
208
224
|
next unless name.to_s.match?(/^[_[:alpha:]](?:\w*)[!?=]?$/)
|
209
225
|
@output.puts(Array(attributes[:comment]).map do |comment|
|
210
|
-
" # # #{comment.to_s.gsub(/\
|
226
|
+
" # # #{comment.to_s.gsub(/\s+/, ' ')}"
|
211
227
|
end.join("\n # #\n")) if attributes[:comment]
|
212
228
|
@output.puts " # # @return [RDF::Vocabulary::Term]"
|
213
229
|
@output.puts " # attr_reader :#{name}"
|
214
230
|
@output.puts " #"
|
215
231
|
end
|
216
|
-
end
|
232
|
+
end unless @options[:noDoc]
|
217
233
|
|
218
234
|
# End of yard preamble
|
219
|
-
@output.puts " # end"
|
235
|
+
@output.puts " # end" unless @options[:noDoc]
|
220
236
|
@output.puts %( #{class_name} = Class.new(RDF::#{"Strict" if strict}Vocabulary("#{base_uri}")) do)
|
221
237
|
|
222
238
|
# Output term definitions
|
@@ -265,7 +281,7 @@ module RDF
|
|
265
281
|
if value.is_a?(Literal) && %w(: comment definition notation note editorialNote).include?(key.to_s)
|
266
282
|
"#{value.to_s.inspect}.freeze"
|
267
283
|
elsif value.is_a?(RDF::URI)
|
268
|
-
"#{value.
|
284
|
+
"#{value.to_s.inspect}.freeze"
|
269
285
|
elsif value.is_a?(RDF::Vocabulary::Term)
|
270
286
|
value.to_ruby(indent: indent + " ")
|
271
287
|
elsif value.is_a?(RDF::Term)
|
@@ -273,7 +289,7 @@ module RDF
|
|
273
289
|
elsif value.is_a?(RDF::List)
|
274
290
|
list_elements = value.map do |u|
|
275
291
|
if u.uri?
|
276
|
-
"#{u.
|
292
|
+
"#{u.to_s.inspect}.freeze"
|
277
293
|
elsif u.respond_to?(:to_ruby)
|
278
294
|
u.to_ruby(indent: indent + " ")
|
279
295
|
else
|