graph_per_aspect.trig 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. # This layout follows the graph-per-aspect pattern
  2. # (http://patterns.dataincubator.org/book/graph-per-aspect.html).
  3. PREFIX dc: <http://purl.org/dc/elements/1.1/>
  4. PREFIX fcrepo: <http://fedora.info/definitions/v4/repository#>
  5. PREFIX fcsystem: <info:fcsystem/>
  6. PREFIX fcg: <info:fcsystem/graph/>
  7. PREFIX foaf: <http://xmlns.com/foaf/0.1/>
  8. PREFIX ldp: <http://www.w3.org/ns/ldp#>
  9. PREFIX ns: <http://example.edu/lakesuperior/ns#>
  10. PREFIX premis: <http://www.loc.gov/premis/rdf/v1#>
  11. PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
  12. # Admin data graphs.
  13. # Triples used by the application business logic are stored here.
  14. # These are a convenient way to get resource metadata (e.g. with a HEAD
  15. # request) without loading large graphs, e.g. ones with many children
  16. # or many user-provided properties.
  17. # System root.
  18. <info:fcsystem/graph/admin/> {
  19. <info:fcres/> a
  20. fcrepo:RepositoryRoot , fcrepo:Resource , fcrepo:Container ,
  21. ldp:Container , ldp:BasicContainer , ldp:RDFSource ;
  22. .
  23. }
  24. <info:fcsystem/graph/admin/a/b/c> {
  25. <info:fcres/a/b/c> a fcrepo:Resource ;
  26. # Timestamps are simplified for readability.
  27. fcrepo:created "2017-11-23"^^xsd:date ;
  28. fcrepo:lastModified "2017-11-27"^^xsd:date ;
  29. fcrepo:hasVersion
  30. <info:fcres/a/b/c/fcr:versions/v1> , <info:fcres/a/b/c;v2> , <info:fcres/a/b/c;v3> ;
  31. .
  32. }
  33. <info:fcsystem/graph/admin/a/b/c/fcr:versions/v1> {
  34. <info:fcres/a/b/c/fcr:versions/v1> a fcrepo:Version ;
  35. fcrepo:created "2017-11-23"^^xsd:date ;
  36. fcrepo:lastModified "2017-11-23"^^xsd:date ;
  37. .
  38. }
  39. <info:fcsystem/graph/admin/a/b/c/fcr:versions/v2> {
  40. <info:fcres/a/b/c/fcr:versions/v2> a fcrepo:Version ;
  41. fcrepo:created "2017-11-23"^^xsd:date ;
  42. fcrepo:lastModified "2017-11-24"^^xsd:date ;
  43. .
  44. }
  45. <info:fcsystem/graph/admin/a/b/c/fcr:versions/v3> {
  46. <info:fcres/a/b/c/fcr:versions/v3> a fcrepo:Version ;
  47. fcrepo:created "2017-11-23"^^xsd:date ;
  48. fcrepo:lastModified "2017-11-25"^^xsd:date ;
  49. .
  50. }
  51. # Pairtree information used to mimic hierarchical structures.
  52. <info:fcsystem/graph/admin/a> {
  53. <info:fcres/a>
  54. a ldp:Container , ldp:BasicContainer , ldp:Resource , ldp:RDFSSource ;
  55. a fcrepo:Pairtree ;
  56. }
  57. <info:fcsystem/graph/admin/a/b> {
  58. <info:fcres/a/b>
  59. a ldp:Container , ldp:BasicContainer , ldp:Resource , ldp:RDFSSource ;
  60. a fcrepo:Pairtree ;
  61. .
  62. }
  63. # "Structural" data. This separation is made mostly to optimize retrieval of
  64. # information needed by the application business logic without having to
  65. # retrieve or filter out predicates with potentially large amounts of objects,
  66. # such as `ldp:contains`.
  67. <info:fcsystem/graph/structure/> {
  68. <info:fcres/> ldp:contains <info:fcres/a/b/c> .
  69. # fcsystem:contains is used to mimic path hierarchies. It does not coincide
  70. # with LDP containment.
  71. <info:fcres/> fcsystem:contains <info:fcres/a> .
  72. }
  73. <info:fcsystem/graph/structure/a> {
  74. <info:fcres/a> fcsystem:contains <info:fcres/a/b> .
  75. }
  76. <info:fcsystem/graph/structure/a/b> {
  77. <info:fcres/a/b> fcsystem:contains <info:fcres/a/b/c> .
  78. }
  79. # Resource graphs. These statements are user-provided and not used for any
  80. # application business logic.
  81. # Note that "fragments", i.e. hash URIs, are stored within the same graph.
  82. <info:fcsystem/graph/userdata/_main/a/b/c> {
  83. <info:fcres/a/b/c> a ns:Book ;
  84. fcrepo:hasParent <info:fcres/a> ;
  85. dc:title "Moby Dick" ;
  86. dc:creator "Herman Melville" ;
  87. dc:subject "Fishing" ;
  88. .
  89. <info:fcres/a/b/c#chapter1> a ns:BookChapter ;
  90. dc:title "Loomings." ;
  91. .
  92. <info:fcres/a/b/c#chapter2> a ns:BookChapter ;
  93. dc:title "The Carpet-Bag." ;
  94. .
  95. }
  96. # Previous states (versions) of a resource.
  97. <info:fcsystem/graph/userdata/_main/a/b/c/fcr:versions/v1> {
  98. <info:fcres/a/b/c/fcr:versions/v1> a ns:Book ;
  99. fcrepo:hasParent <info:fcres/> ;
  100. dc:title "Moby Dick" ;
  101. .
  102. }
  103. <info:fcsystem/graph/userdata/_main/a/b/c/fcr:versions/v2> {
  104. <info:fcres/a/b/c/fcr:versions/v2> a ns:Book ;
  105. fcrepo:hasParent <info:fcres/> ;
  106. dc:title "Moby Dick" ;
  107. dc:creator "Herman Melvil" ;
  108. .
  109. }
  110. <info:fcsystem/graph/userdata/_main/a/b/c/fcr:versions/v3> {
  111. <info:fcres/a/b/c/fcr:versions/v3> a ns:Book ;
  112. fcrepo:hasParent <info:fcres/> ;
  113. dc:title "Moby Dick" ;
  114. dc:creator "Herman Melville" ;
  115. .
  116. }
  117. # Metadata graph. This contains information about graphs and their
  118. # relationships.
  119. <info:fcsystem/meta> {
  120. # This may not be used by the application logic if we use naming
  121. # conventions, but is still good LD practice.
  122. <info:fcsystem/graph/admin/> foaf:primaryTopic <info:fcres/> .
  123. <info:fcsystem/graph/userdata/_main/> foaf:primaryTopic <info:fcres/> .
  124. <info:fcsystem/graph/structure/> foaf:primaryTopic <info:fcres/> .
  125. <info:fcsystem/graph/admin/a/b/c> foaf:primaryTopic <info:fcres/a/b/c> .
  126. <info:fcsystem/graph/userdata/_main/a/b/c> foaf:primaryTopic <info:fcres/a/b/c> .
  127. # Pairtree information is kept in one graph so no metadata are needed.
  128. }
  129. # Historic version metadata. This is kept separate to optimize current resource
  130. # lookups.
  131. <info:fcsystem/histmeta> {
  132. <info:fcsystem/graph/admin/a/b/c/fcr:versions/v1>
  133. foaf:primaryTopic <info:fcres/a/b/c/fcr:versions/v1> ;
  134. fcrepo:created "2017-11-24"^^xsd:date ;
  135. fcrepo:hasVersionLabel "v1" ;
  136. .
  137. <info:fcsystem/graph/admin/a/b/c/fcr:versions/v2>
  138. foaf:primaryTopic <info:fcres/a/b/c/fcr:versions/v2> ;
  139. fcrepo:created "2017-11-25"^^xsd:date ;
  140. fcrepo:hasVersionLabel "v2" ;
  141. .
  142. <info:fcsystem/graph/admin/a/b/c/fcr:versions/v3>
  143. foaf:primaryTopic <info:fcres/a/b/c/fcr:versions/v3> ;
  144. fcrepo:created "2017-11-26"^^xsd:date ;
  145. fcrepo:hasVersionLabel "v3" ;
  146. .
  147. <info:fcsystem/graph/userdata/_main/a/b/c/fcr:versions/v1>
  148. foaf:primaryTopic <info:fcres/a/b/c/fcr:versions/v1> ;
  149. fcrepo:created "2017-11-24"^^xsd:date ;
  150. fcrepo:hasVersionLabel "v1" ;
  151. # Provenance data can also be added.
  152. premis:actor <http://ex.org/user/1325> ;
  153. .
  154. <info:fcsystem/graph/userdata/_main/a/b/c/fcr:versions/v2>
  155. foaf:primaryTopic <info:fcres/a/b/c/fcr:versions/v2> ;
  156. fcrepo:created "2017-11-25"^^xsd:date ;
  157. fcrepo:hasVersionLabel "v2" ;
  158. .
  159. <info:fcsystem/graph/userdata/_main/a/b/c/fcr:versions/v3>
  160. foaf:primaryTopic <info:fcres/a/b/c/fcr:versions/v3> ;
  161. fcrepo:created "2017-11-26"^^xsd:date ;
  162. fcrepo:hasVersionLabel "v3" ;
  163. .
  164. }