rest.xsd 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  2. <xsd:annotation>
  3. <xsd:documentation xml:lang="en">
  4. Open Simulator Export/Import XML schema
  5. August 2008
  6. </xsd:documentation>
  7. </xsd:annotation>
  8. <!-- WARNING!!!
  9. This is currently a draft, it does not reflect
  10. what is exported, nor what will be understood
  11. on import. It is included as a working document
  12. and this comment will be removed at such time as
  13. the schema corresponds to reality.
  14. -->
  15. <!--
  16. REST-related information
  17. Inventory data is always framed by an
  18. inventory element. Consists of zero or
  19. more elements representing either folders
  20. or items within those folders. The inventory
  21. element represents the "real" root folder.
  22. -->
  23. <xsd:element name="inventory" type="inventory_ct" />
  24. <!--
  25. The inventory complex type is just an arbitrary
  26. sequence of folders and items. In reality it is
  27. typically just folders. Both item and folder
  28. have corresponding complex types. It is distinct
  29. from folders insofar as it has no other defining
  30. attributes.
  31. -->
  32. <xsd:complexType name="inventory_ct">
  33. <xsd:element name="folder" type="folder_ct" maxOccurs="unbounded"/>
  34. <xsd:element name="item" type="item_ct" maxOccurs="unbounded" />
  35. </xsd:complexType>
  36. <xsd:complexType name="folder_ct">
  37. <xsd:attribute name="UUID" type="uuid_st" />
  38. <xsd:attribute name="name" type="name_st" />
  39. <xsd:attribute name="type" type="folder_type_st" />
  40. <xsd:attribute name="description" type="xsd:string" /> <!-- added -->
  41. <xsd:attribute name="version" type="unsignedShort" />
  42. <xsd:attribute name="owner" type="uuid_st" />
  43. <xsd:attribute name="creator" type="uuid_st" /> <!-- added -->
  44. <xsd:attribute name="creationdate" type="date_st" /> <!-- added -->
  45. <xsd:attribute name="parent" type="uuid_st" />
  46. <xsd:element name="permissions" type="permissions_ct" maxOccurs="unbounded" /> <!-- added -->
  47. <xsd:element name="folder" type="folder_ct" maxOccurs="unbounded" />
  48. <xsd:element name="item" type="item_ct" maxOccurs="unbounded" />
  49. </xsd:complexType>
  50. <xsd:complexType name="item_ct">
  51. <xsd:attribute name="UUID" type="uuid_st" />
  52. <xsd:attribute name="name" type="name_st" />
  53. <xsd:attribute name="type" type="inventory_type_st" />
  54. <xsd:attribute name="description" type="xsd:string" />
  55. <xsd:attribute name="version" type="unsignedShort" /> <!-- added -->
  56. <xsd:attribute name="owner" type="uuid_st" />
  57. <xsd:attribute name="creator" type="uuid_st" />
  58. <xsd:attribute name="creationdate" type="date_st" />
  59. <xsd:attribute name="folder" type="uuid_st" />
  60. <xsd:attribute name="groupid" type="uuid_st" />
  61. <xsd:attribute name="groupowned" type="xsd:boolean" />
  62. <xsd:attribute name="saletype" type="sale_st" />
  63. <xsd:attribute name="saleprice" type="xsd:decimal" />
  64. <xsd:element name="permissions" type="permissions_ct" maxOccurs="unbounded" />
  65. </xsd:complexType>
  66. <xsd:complexType name="asset_ct">
  67. <xsd:attribute name="UUID" type="uuid_st" />
  68. <xsd:attribute name="name" type="name_st" />
  69. <xsd:attribute name="type" type="asset_type_st" />
  70. <xsd:attribute name="description" type="xsd:string" />
  71. <xsd:attribute name="version" type="unsignedShort" /> <!-- added -->
  72. <xsd:attribute name="owner" type="uuid_st" />
  73. <xsd:attribute name="creator" type="uuid_st" />
  74. <xsd:attribute name="creationdate" type="date_st" />
  75. <xsd:attribute name="temporary" type="xsd:boolean" />
  76. <xsd:attribute name="local" type="xsd:boolean" />
  77. <xsd:attribute name="inline" type="xsd:boolean" />
  78. </xsd:complexType>
  79. <!-- Constrained Simple Data types -->
  80. <!--
  81. We need to specify name as a simple type because on
  82. some platforms it is constrained by a certain length
  83. limitation. For completeness we indicate that whitespace
  84. should be preserved exactly as specified.
  85. -->
  86. <xsd:simpleType name="name_st">
  87. <xsd:restriction base="xsd:string">
  88. <whiteSpace value="preserve" />
  89. <minLength value="0" />
  90. <maxLength value="64" />
  91. </xsd:restriction>
  92. </xsd:simpleType>
  93. <!--
  94. Type information in the folder is meant to indicate
  95. the preferred asset type for this folder. As such, that
  96. currently corresponds to the type values allowed for
  97. assets, however that is not mandated, so for
  98. now at least I'll represent this as a distinct
  99. enumeration.
  100. This seems inappropriate; it seems like the folder's
  101. content should reflect the InventoryType classifications
  102. rather than the asset types.
  103. -->
  104. <xsd:simpleType name="folder_type_st">
  105. <xsd:restriction base="xsd:string">
  106. <xsd:enumeration value="Texture" />
  107. <xsd:enumeration value="Sound" />
  108. <xsd:enumeration value="CallingCard" />
  109. <xsd:enumeration value="Landmark" />
  110. <xsd:enumeration value="Script" />
  111. <xsd:enumeration value="Clothing" />
  112. <xsd:enumeration value="Object" />
  113. <xsd:enumeration value="Notecard" />
  114. <xsd:enumeration value="LSLText" />
  115. <xsd:enumeration value="LSLByteCode" />
  116. <xsd:enumeration value="TextureTGA" />
  117. <xsd:enumeration value="BodyPart" />
  118. <xsd:enumeration value="SoundWAV" />
  119. <xsd:enumeration value="ImageTGA" />
  120. <xsd:enumeration value="ImageJPEG" />
  121. <xsd:enumeration value="Animation" />
  122. <xsd:enumeration value="Gesture" />
  123. <xsd:enumeration value="Simstate" />
  124. <xsd:enumeration value="Unknown" />
  125. <xsd:enumeration value="LostAndFoundFolder" />
  126. <xsd:enumeration value="SnapshotFolder" />
  127. <xsd:enumeration value="TrashFolder" />
  128. <xsd:enumeration value="Folder" />
  129. <xsd:enumeration value="RootFolder" />
  130. </xsd:restriction>
  131. </xsd:simpleType>
  132. <!--
  133. Inventory item type designates an asset class, rather
  134. than a specific asset type. For example, "SnapShot"
  135. might include a number of asset types such as JPEG,
  136. TGA, etc.. This is not a consistent interpretation,
  137. classifications such as LostAndFound are meta-types
  138. relative to asset classes.
  139. These types should be abstract and not be tied to a
  140. specific platform. A world's import facility should be
  141. responsible for mapping these to meaningful internal
  142. representations.
  143. These types were based on information in:
  144. libsecondlife/InventoryManager.cs
  145. -->
  146. <xsd:simpleType name="inventory_type_st">
  147. <xsd:restriction base="xsd:string">
  148. <xsd:enumeration value="Texture" />
  149. <xsd:enumeration value="Sound" />
  150. <xsd:enumeration value="CallingCard" />
  151. <xsd:enumeration value="Landmark" />
  152. <xsd:enumeration value="Script" />
  153. <xsd:enumeration value="Clothing" />
  154. <xsd:enumeration value="Object" />
  155. <xsd:enumeration value="Notecard" />
  156. <xsd:enumeration value="LSL" />
  157. <xsd:enumeration value="LSLBytecode" />
  158. <xsd:enumeration value="TextureTGA" />
  159. <xsd:enumeration value="BodyPart" />
  160. <xsd:enumeration value="Snapshot" />
  161. <xsd:enumeration value="Attachment" />
  162. <xsd:enumeration value="Wearable" />
  163. <xsd:enumeration value="Animation" />
  164. <xsd:enumeration value="Gesture" />
  165. <xsd:enumeration value="Folder" />
  166. <xsd:enumeration value="Unknown" />
  167. <xsd:enumeration value="LostAndFound" />
  168. <xsd:enumeration value="Trash" />
  169. <xsd:enumeration value="Root" />
  170. </xsd:restriction>
  171. </xsd:simpleType>
  172. <!--
  173. The asset types seem to be even more disarrayed than
  174. the inventory types. It seems to be little more than
  175. a reiteration of the inventory type information,
  176. which adds little or nothing to the overall data
  177. model.
  178. Of course, given that these are drawn from the
  179. libsecondlife definitions, we aren't at liberty to
  180. simply redefine them in place. But the XML definitions
  181. here could be made more useful.
  182. These types were based on information in:
  183. libsecondlife/AssetManager.cs
  184. -->
  185. <xsd:simpleType name="asset_type_st">
  186. <xsd:restriction base="xsd:string">
  187. <xsd:enumeration value="Texture" />
  188. <xsd:enumeration value="Sound" />
  189. <xsd:enumeration value="CallingCard" />
  190. <xsd:enumeration value="Landmark" />
  191. <xsd:enumeration value="Script" />
  192. <xsd:enumeration value="Clothing" />
  193. <xsd:enumeration value="Object" />
  194. <xsd:enumeration value="Notecard" />
  195. <xsd:enumeration value="LSLText" />
  196. <xsd:enumeration value="LSLByteCode" />
  197. <xsd:enumeration value="TextureTGA" />
  198. <xsd:enumeration value="BodyPart" />
  199. <xsd:enumeration value="SoundWAV" />
  200. <xsd:enumeration value="ImageTGA" />
  201. <xsd:enumeration value="ImageJPEG" />
  202. <xsd:enumeration value="Animation" />
  203. <xsd:enumeration value="Gesture" />
  204. <xsd:enumeration value="Simstate" />
  205. <xsd:enumeration value="Unknown" />
  206. <xsd:enumeration value="LostAndFoundFolder" />
  207. <xsd:enumeration value="SnapshotFolder" />
  208. <xsd:enumeration value="TrashFolder" />
  209. <xsd:enumeration value="Folder" />
  210. <xsd:enumeration value="RootFolder" />
  211. </xsd:restriction>
  212. </xsd:simpleType>
  213. <!-- This is describing the apparent form of a UUID. If
  214. we ever want a more metaphysical definition we'll
  215. need to add to it.
  216. -->
  217. <xsd:simpleType name="uuid_st">
  218. <xsd:restriction base="xsd:string">
  219. <xsd:pattern value="[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}"/>
  220. </xsd:restriction>
  221. </xsd:simpleType>
  222. <!-- This constrains the date representation. Currently
  223. it is simply an integer representing the elapsed
  224. ?? since ??.
  225. -->
  226. <xsd:simpleType name="date_st">
  227. <xsd:restriction base="xsd:positiveInteger">
  228. </xsd:restriction>
  229. </xsd:simpleType>
  230. <!-- This constrains the representation of sale price.
  231. Currently it is a simple decimal with no unit
  232. specified.
  233. Issues: interoperability.
  234. -->
  235. <xsd:simpleType name="sale_st">
  236. <xsd:restriction base="xsd:decimal">
  237. </xsd:restriction>
  238. </xsd:simpleType>
  239. </xsd:schema>