Project

General

Profile

« Previous | Next » 

Revision 42502

first implementation of oafProtoSchema.xsd

View differences:

modules/dnet-openaire-data-protos/trunk/src/main/resources/eu/dnetlib/data/proto/xsd/oafProtoSchema.xsd
1
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
2
	<xs:element name="Oaf">
3
		<xs:complexType>
4
			<xs:sequence>
5
				<xs:element name="kind" type="kindType" minOccurs="1"/>
6
				<xs:choice>
7
					<xs:element ref="entity"/>
8
					<xs:element ref="rel"/>
9
				</xs:choice>
10
				<xs:element name="dataInfo" type="dataInfoType"/>
11
			</xs:sequence>
12
		</xs:complexType>
13
	</xs:element>
14
	<xs:simpleType name="kindType">
15
		<xs:restriction base="xs:string">
16
			<xs:enumeration value="relation"/>
17
			<xs:enumeration value="entity"/>
18
		</xs:restriction>
19
	</xs:simpleType>
20
	<xs:element name="entity">
21
		<xs:complexType>
22
			<xs:sequence>
23
				<xs:element name="type" type="entityType" minOccurs="1"/>
24
				<xs:element name="id" type="xs:string" minOccurs="1"/>
25
				<xs:choice>
26
					<xs:element ref="person"/>
27
					<xs:element ref="result"/>
28
					<!-- ... other entities ... -->
29
				</xs:choice>
30
				<xs:element name="originalId" type="xs:string" maxOccurs="unbounded" />
31
				<xs:element name="collectedfrom" type="keyValueType" maxOccurs="unbounded" />
32
				<xs:element name="pid" type="structuredPropertyType" maxOccurs="unbounded" />
33
				<xs:element name="dateofcollection" type="xs:string"/> <!-- replace with xs:date or xs:datetime ?? -->
34
				<xs:element name="dateoftransformation" type="xs:string"/> <!-- replace with xs:date or xs:datetime ?? -->
35

  
36
			</xs:sequence>
37
		</xs:complexType>
38
	</xs:element>
39

  
40
	<xs:simpleType name="entityType">
41
		<xs:restriction base="xs:string">
42
			<xs:enumeration value="result"/>
43
			<xs:enumeration value="person"/>
44
			<xs:enumeration value="datasource"/>
45
			<xs:enumeration value="project"/>
46
			<xs:enumeration value="organization"/>
47
		</xs:restriction>
48
	</xs:simpleType>
49

  
50
	<!-- RESULT -->
51
	<xs:element name="result">
52
		<xs:complexType>
53
			<xs:sequence>
54
				<xs:element name="metadata" type="resultMetadataType"/>
55
				<xs:element name="instance" type="instanceType"/>
56
				<xs:element name="externalReference" type="externalReferenceType"/>
57
				<!-- <xs:element ref="author"/> -->
58
			</xs:sequence>
59
		</xs:complexType>
60
	</xs:element>
61
	<xs:complexType name="instanceType">
62
		<xs:sequence>
63
			<xs:element name="licence" type="qualifierType"/>
64
			<xs:element name="instancetype" type="qualifierType"/>
65
			<xs:element name="hostedby" type="keyValueType"/>
66
			<xs:element name="url" type="xs:anyURI"/>
67
		</xs:sequence>
68
	</xs:complexType>
69
	<xs:complexType name="externalReferenceType">
70
		<xs:sequence>
71
			<xs:element name="sitename" type="xs:string"/>
72
			<xs:element name="label" type="xs:string"/>
73
			<xs:element name="url" type="xs:string"/>
74
			<xs:element name="description" type="xs:string"/>
75
			<xs:element name="qualifier" type="qualifierType"/>
76
			<xs:element name="refidentifier" type="xs:string"/>
77
			<xs:element name="query" type="xs:string"/>
78
			<xs:element name="dataInfo" type="dataInfoType"/>
79
		</xs:sequence>
80
	</xs:complexType>
81
	<xs:complexType name="resultMetadataType">
82
		<xs:sequence>
83
			<xs:element name="resulttype" type="qualifierType"/> <!-- resulttype allows subclassing results into publications or datasets -->
84
			<xs:element name="language" type="qualifierType"/>
85
			<xs:element name="country" type="qualifierType" maxOccurs="unbounded"/>
86
			<xs:element name="subject" type="structuredPropertyType" maxOccurs="unbounded"/>
87
			<xs:element name="title" type="structuredPropertyType" maxOccurs="unbounded"/>
88
			<xs:element name="relevantdate" type="structuredPropertyType" maxOccurs="unbounded"/>
89
			<xs:element name="description" type="stringFieldType" maxOccurs="unbounded"/>
90
			<xs:element name="dateofacceptance" type="stringFieldType" />
91
			<xs:element name="publisher" type="stringFieldType" />
92
			<xs:element name="embargoenddate" type="stringFieldType" />
93
			<xs:element name="source" type="stringFieldType" maxOccurs="unbounded"/>
94
			<xs:element name="fulltext" type="stringFieldType" maxOccurs="unbounded"/>
95
			<xs:element name="format" type="stringFieldType" maxOccurs="unbounded"/>
96
			<xs:element name="contributor" type="stringFieldType" maxOccurs="unbounded"/>
97
			<xs:element name="context" type="contextType" maxOccurs="unbounded"/>
98
			<xs:element name="journal" type="journalType" />
99
			<xs:element name="storagedate" type="stringFieldType" />
100
			<xs:element name="resourcetype" type="qualifierType" />
101
			<xs:element name="device" type="stringFieldType" />
102
			<xs:element name="size" type="stringFieldType" />
103
			<xs:element name="version" type="stringFieldType" />
104
			<xs:element name="lastmetadataupdate" type="stringFieldType" />
105
			<xs:element name="metadataversionnumber" type="stringFieldType" />
106
		</xs:sequence>
107
	</xs:complexType>
108
	<xs:complexType name="contextType">
109
		<xs:sequence>
110
			<xs:element name="id" type="xs:string" minOccurs="1"/>
111
			<xs:element name="datInfo" type="dataInfoType"/>
112
		</xs:sequence>
113
	</xs:complexType>
114

  
115
	<xs:complexType name="journalType">
116
		<xs:sequence>
117
			<xs:element name="name" type="xs:string"/>
118
			<xs:element name="issnPrinted" type="xs:string"/>
119
			<xs:element name="issnOnline" type="xs:string"/>
120
			<xs:element name="issnLinking" type="xs:string"/>
121
			<xs:element name="datInfo" type="dataInfoType"/>
122
		</xs:sequence>
123
	</xs:complexType>
124

  
125

  
126
	<!-- END OF RESULT -->
127

  
128
	<!-- PERSON -->
129
	<xs:element name="person">
130
		<xs:complexType>
131
			<xs:sequence>
132
				<xs:element name="metadata" type="personMetadataType"/>
133
			</xs:sequence>
134
		</xs:complexType>
135
	</xs:element>
136

  
137
	<xs:complexType name="personMetadataType">
138
		<xs:sequence>
139
			<xs:element name="firstname" type="stringFieldType" />
140
			<xs:element name="secondnames" type="stringFieldType" maxOccurs="unbounded" />
141
			<xs:element name="fullname" type="stringFieldType" />
142
			<xs:element name="fax" type="stringFieldType" />
143
			<xs:element name="email" type="stringFieldType" />
144
			<xs:element name="phone" type="stringFieldType" />
145
			<xs:element name="nationality" type="qualifierType" />
146
		</xs:sequence>
147
	</xs:complexType>
148

  
149
	<!-- END OF PERSON -->
150

  
151

  
152

  
153

  
154

  
155

  
156
	<!-- RELATIONSHIPS -->
157

  
158
	<xs:element name="rel">
159
		<xs:complexType>
160
			<xs:sequence>
161
				<xs:element name="relType" type="relationshipType" minOccurs="1"/>
162
				<xs:element name="subRelType" type="subRelationshipType" minOccurs="1"/>
163
				<xs:element name="relClass" type="xs:string"/> <!-- we need to restrict the possible values here -->
164

  
165
				<xs:element name="source" type="xs:string"/>
166
				<xs:element name="target" type="xs:string"/>
167

  
168
				<xs:choice>
169
					<xs:element name="personResult" type="personResultType"/>
170
					<xs:element name="resultProject" type="resultProjectType"/>
171
					<!-- ... -->
172
				</xs:choice>
173

  
174
			</xs:sequence>
175
		</xs:complexType>
176
	</xs:element>
177

  
178
	<xs:simpleType name="relationshipType">
179
		<xs:restriction base="xs:string">
180
			<xs:enumeration value="datasourceOrganization"/>
181
			<xs:enumeration value="personResult"/>
182
			<xs:enumeration value="projectOrganization"/>
183
			<xs:enumeration value="projectPerson"/>
184
			<xs:enumeration value="resultOrganization"/>
185
			<xs:enumeration value="resultProject"/>
186
			<xs:enumeration value="resultResult"/>
187
			<xs:enumeration value="personPerson"/>
188
			<xs:enumeration value="organizationOrganization"/>
189
		</xs:restriction>
190
	</xs:simpleType>
191

  
192
	<xs:simpleType name="subRelationshipType">
193
		<xs:restriction base="xs:string">
194
			<xs:enumeration value="provision"/>
195
			<xs:enumeration value="coauthorship"/>
196
			<xs:enumeration value="authorship"/>
197
			<xs:enumeration value="participation"/>
198
			<xs:enumeration value="contactPerson"/>
199
			<xs:enumeration value="outcome"/>
200
			<xs:enumeration value="similarity"/>
201
			<xs:enumeration value="publicationDataset"/>
202
			<xs:enumeration value="affiliation"/>
203
			<xs:enumeration value="dedup"/>
204
			<xs:enumeration value="dedupSimilarity"/>
205
			<xs:enumeration value="supplement"/>
206
			<xs:enumeration value="part"/>
207
		</xs:restriction>
208
	</xs:simpleType>
209

  
210
	<xs:complexType name="personResultType">
211
		<xs:all>
212
			<xs:element name="authorship">
213
				<xs:complexType>
214
					<xs:sequence>
215
						<xs:element name="relMetadata" type="relMetadataType" minOccurs="1" />
216
						<xs:element name="ranking" type="xs:string"/> <!-- use numeric value here -->
217
						<xs:element name="affiliation" type="xs:string"/>
218
					</xs:sequence>
219
				</xs:complexType>
220
			</xs:element>
221
		</xs:all>
222
	</xs:complexType>
223

  
224
	<xs:complexType name="resultProjectType">
225
		<xs:all>
226
			<xs:element name="outcome">
227
				<xs:complexType>
228
					<xs:sequence>
229
						<xs:element name="relMetadata" type="relMetadataType" minOccurs="1" />
230
					</xs:sequence>
231
				</xs:complexType>
232
			</xs:element>
233
		</xs:all>
234
	</xs:complexType>
235

  
236
	<!-- BASIC TYPES -->
237
	<xs:complexType name="dataInfoType">
238
		<xs:sequence>
239
			<xs:element name="inferred" type="xs:boolean"/>
240
			<xs:element name="deletedbyinference" type="xs:boolean"/>
241
			<xs:element name="trust" type="xs:string"/>
242
			<xs:element name="provenanceaction" type="qualifierType" minOccurs="1"/>
243
		</xs:sequence>
244
	</xs:complexType>
245

  
246
	<xs:complexType name="qualifierType">
247
		<xs:sequence>
248
			<xs:element name="classid" type="xs:string"/>
249
			<xs:element name="classname" type="xs:string"/>
250
			<xs:element name="schemeid" type="xs:string"/>
251
			<xs:element name="schemename" type="xs:string"/>
252
			<xs:element name="dataInfo" type="dataInfoType"/>
253
		</xs:sequence>
254
	</xs:complexType>
255

  
256
	<xs:complexType name="keyValueType">
257
		<xs:sequence>
258
			<xs:element name="key" type="xs:string" minOccurs="1"/>
259
			<xs:element name="value" type="xs:string"/>
260
			<xs:element name="dataInfo" type="dataInfoType"/>
261
		</xs:sequence>
262
	</xs:complexType>
263

  
264
	<xs:complexType name="structuredPropertyType">
265
		<xs:sequence>
266
			<xs:element name="value" type="xs:string" minOccurs="1"/>
267
			<xs:element name="qualifier" type="qualifierType"/>
268
			<xs:element name="dataInfo" type="dataInfoType"/>
269
		</xs:sequence>
270
	</xs:complexType>
271

  
272
	<xs:complexType name="stringFieldType">
273
		<xs:sequence>
274
			<xs:element name="value" type="xs:string" minOccurs="1"/>
275
			<xs:element name="dataInfo" type="dataInfoType"/>
276
		</xs:sequence>
277
	</xs:complexType>
278

  
279
	<xs:complexType name="relMetadataType">
280
		<xs:sequence>
281
			<xs:element name="semantics" type="qualifierType"/>
282
			<xs:element name="startdate" type="xs:string"/>
283
			<xs:element name="enddate" type="xs:string"/>
284
		</xs:sequence>
285
	</xs:complexType>
286

  
287
</xs:schema>

Also available in: Unified diff