1. ########################### test8.n3 ############################ 2. # test8.n3: Show how awww:InformationResource can be modeled as 3. # a function: Time x Request -> Representation. 4. # 5. # This is a DRAFT and surely will change without notice. 6. # It has not yet been tested. 7. # 8. # Author: David Booth 9. # Date: 27-Apr-2008 10. # License: GPL: http://creativecommons.org/license/cc-gpl 11. 12. ######################## Prefixes ########################### 13. 14. @prefix awww: . 15. @prefix tir: . # TimBL's ont of IRs 16. @prefix ir: . 17. 18. ################### AWWW ###################### 19. 20. awww:InformationResource a rdfs:Class ; 21. rdf:label "InformationResource" ; 22. rdf:comment """An information resource (IR), roughly as defined in 23. http://www.w3.org/TR/webarch/#def-information-resource 24. though that definition is flawed. Conceptually, an IR 25. is a function from time and request inputs to 26. representations: 27. f: Time x RequestInput --> Representation 28. The request input may include, for example, things like 29. the client's language and media type preferences (for 30. content negotiation), the requested URI(!) and 31. cookies. According to 32. http://www.w3.org/TR/webarch/#p43 'Other things, such as 33. cars and dogs (and, if you've printed this document on 34. physical sheets of paper, the artifact that you are holding 35. in your hand), are resources too. They are not information 36. resources, however . . . .', so I will take this to mean that an 37. information resource is an abstract entity, which makes sense 38. if we view it as conceptually a function. 39. """ ; 40. rdfs:subClassOf sumo:AbstractEntity . 41. 42. ################### Information Resources ###################### 43. 44. # An awww:InformationResource is viewed as a function f with 45. # two parameters: 46. # 47. # f: Time x Request --> Representation 48. # 49. # The Request parameter includes things like language and mime 50. # preferences, request URI(!) and cookies. Here are simple 51. # classes for Time, Request and Representation: 52. 53. ir:Time a rdf:Class ; 54. rdf:comment """Times""" . 55. 56. ir:Request a rdf:Class ; 57. rdf:comment """Requests. A request includes the requestor's 58. language and mime preferences, request URI, cookies, etc. 59. In essence it contains all inputs from the client that 60. can affect the resulting Representation.""" . 61. 62. ir:Representation a rdf:Class ; 63. rdf:comment """Representations. A representation includes 64. both metadata (such as language, mime type, etc.) and 65. content.""" . 66. 67. # Since a function can be viewed as a set of tuples, an 68. # awww:InformationResource will be modeled as a set of 69. # TrrTuples: 70. 71. ir:TrrTuple a rdf:Class ; 72. rdf:comment """The class of all tuples: 73. Time x Request x Representation 74. Each awww:InformationResource is a subclass of TrrTuple 75. that represents a particular function f: 76. f: (Time x Request) --> Representation 77. """ . 78. 79. # And each awww:InformationResource will thus be a particular 80. # subclass of TrrTuple, i.e., a particular set of tuples: 81. 82. { ?ir a awww:InformationResource . } 83. => { ?ir rdfs:subClassOf ir:TrrTuple . } . 84. 85. # The set of tuples for a given IR is defined using this property: 86. 87. ir:hasTrrTuple a rdf:Property ; 88. rdf:comment """The subject awww:InformationResource has 89. the object TrrTuple as a member.""" ; 90. rdfs:domain awww:InformationResource ; 91. rdfs:range ir:TrrTuple . 92. 93. # and each TrrTuple has the following properties comprising that tuple: 94. 95. ir:hasTime a rdf:Property ; 96. rdfs:domain ir:TrrTuple ; 97. rdfs:range ir:Time . 98. 99. ir:hasRequest a rdf:Property ; 100. rdfs:domain ir:TrrTuple ; 101. rdfs:range ir:Request . 102. 103. ir:hasRepresentation a rdf:Property ; 104. rdfs:domain ir:TrrTuple ; 105. rdfs:range ir:Representation . 106. 107. # Given the above, we can now define the notion of a 108. # RequestInvariantIR, which is an IR whose 109. # representations do not depend on the client's request. I.e., 110. # when a client dereferences the IR's URI, the resulting 111. # representation does not depend on the client's preferred 112. # language, preferred mime type, request URI (though bear in 113. # mind that it is a particular IR whose representation is 114. # being requested) or cookies. 115. 116. ir:RequestInvariantIR rdfs:subClassOf awww:InformationResource ; 117. rdf:comment """ 118. A RequestInvariantIR is an IR whose 119. representations do not depend on the client's request. I.e., 120. when a client dereferences the IR's URI, the resulting 121. representation does not depend on the client's preferred 122. language, preferred mime type, request URI (though bear in 123. mind that it is a particular IR whose representation is 124. being requested) or cookies. IRs that are simple documents 125. such as HTML documents, which can change over time 126. but are invariant over content negotiation, are 127. examples of RequestInvarientIRs.""" . 128. 129. # This rule defines the meaning of ir:RequestInvariantIR 130. # as an IR whose representations do not depend on the 131. # input request: 132. 133. { 134. ?ir a ir:RequestInvariantIR . 135. ?trr1 a ?ir ; 136. ir:hasTime ?t ; 137. ir:hasRequest ?req1 ; 138. ir:hasRepresentation ?rep1 . 139. ?trr2 a ?ir ; 140. ir:hasTime ?t ; 141. ir:hasRequest ?req2 ; 142. ir:hasRepresentation ?rep2 . 143. } => { ?rep1 = ?rep2 . } 144. 145. # Other subclasses of awww:InformationResource can be similarly 146. # defined for cases where the representations do not depend on 147. # language, mime type, or other aspects of the request. 148. # The ontology of Information Resources that TimBL defined at 149. # http://www.w3.org/2006/gen/ont 150. # and describe in 151. # http://www.w3.org/DesignIssues/Generic.html 152. # I have not bothered to so so here. 153. 154. # Given the above, here is an example of something we might 155. # say about a particular IR. This is an IR that gives the current 156. # time in the Eastern US timezone. Let's assume it does not have 157. # different representations for different langauges, mime types, 158. # etc. 159. 160. 161. a ir:RequestInvariantIR . 162. 163. _:trr1 a ; 164. ir:hasTime "2008-04-26T20:28:30" ; 165. ir:hasRequest _:req1 ; 166. ir:hasRepresentation """. . . Right now, the official U.S. time 167. . . . 20:28:30 . . . Saturday, April 26, 2008 168. . . . Eastern timezone . . .""" . 169. 170. _:trr2 a ; 171. ir:hasTime "2008-04-27T11:39:13" ; 172. ir:hasRequest _:req2 ; 173. ir:hasRepresentation """. . . Right now, the official U.S. time 174. . . . 11:39:13 . . . Sunday, April 27, 2008 175. . . . Eastern timezone . . .""" . 176.