Skip to content
Permalink
Browse files
refactor(triplestore): remove embedded-jena-tdb related code (#2043)
* remove embedded-jena-tdb related code

* remove TriplestoreTypes

* remove triplestore param from sparql queries in admin

* remove triplestore param from sparql queries in v1

* remove triplestore param from sparql queries in v2

* remove more triplestore params

* minor improvements

* fix: cache calls twirl template instead of resolving it, when trying to build cache from triplestore

* fix: more wrong twirl template calls

* docs: remove Jena TDB from docs

Co-authored-by: Balduin Landolt <33053745+BalduinLandolt@users.noreply.github.com>
  • Loading branch information
mpro7 and BalduinLandolt committed Apr 25, 2022
1 parent bdc4f39 commit a5ea62eeaaadb97caa456e7dc9e6946c44abcf5b
Showing with 622 additions and 1,766 deletions.
  1. +2 −7 docs/05-internals/design/principles/design-overview.md
  2. +9 −160 docs/05-internals/design/principles/store-module.md
  3. +1 −1 docs/05-internals/development/overview.md
  4. +0 −12 webapi/src/main/resources/application.conf
  5. +13 −11 webapi/src/main/scala/org/knora/webapi/responders/Responder.scala
  6. +9 −9 webapi/src/main/scala/org/knora/webapi/responders/admin/GroupsResponderADM.scala
  7. +14 −23 webapi/src/main/scala/org/knora/webapi/responders/admin/ListsResponderADM.scala
  8. +16 −24 webapi/src/main/scala/org/knora/webapi/responders/admin/PermissionsResponderADM.scala
  9. +22 −30 webapi/src/main/scala/org/knora/webapi/responders/admin/ProjectsResponderADM.scala
  10. +15 −19 webapi/src/main/scala/org/knora/webapi/responders/admin/SipiResponderADM.scala
  11. +26 −20 webapi/src/main/scala/org/knora/webapi/responders/admin/UsersResponderADM.scala
  12. +18 −15 webapi/src/main/scala/org/knora/webapi/responders/v1/CkanResponderV1.scala
  13. +2 −3 webapi/src/main/scala/org/knora/webapi/responders/v1/ListsResponderV1.scala
  14. +14 −19 webapi/src/main/scala/org/knora/webapi/responders/v1/ProjectsResponderV1.scala
  15. +24 −41 webapi/src/main/scala/org/knora/webapi/responders/v1/ResourcesResponderV1.scala
  16. +11 −6 webapi/src/main/scala/org/knora/webapi/responders/v1/SearchResponderV1.scala
  17. +13 −16 webapi/src/main/scala/org/knora/webapi/responders/v1/UsersResponderV1.scala
  18. +26 −37 webapi/src/main/scala/org/knora/webapi/responders/v1/ValuesResponderV1.scala
  19. +21 −32 webapi/src/main/scala/org/knora/webapi/responders/v2/OntologyResponderV2.scala
  20. +29 −44 webapi/src/main/scala/org/knora/webapi/responders/v2/ResourcesResponderV2.scala
  21. +20 −26 webapi/src/main/scala/org/knora/webapi/responders/v2/SearchResponderV2.scala
  22. +33 −24 webapi/src/main/scala/org/knora/webapi/responders/v2/StandoffResponderV2.scala
  23. +11 −16 webapi/src/main/scala/org/knora/webapi/responders/v2/ValuesResponderV2.scala
  24. +34 −32 webapi/src/main/scala/org/knora/webapi/responders/v2/ontology/Cache.scala
  25. +11 −11 webapi/src/main/scala/org/knora/webapi/responders/v2/ontology/Cardinalities.scala
  26. +15 −9 webapi/src/main/scala/org/knora/webapi/responders/v2/ontology/OntologyHelpers.scala
  27. +22 −27 webapi/src/main/scala/org/knora/webapi/settings/KnoraSettings.scala
  28. +0 −9 webapi/src/main/scala/org/knora/webapi/settings/KnoraSettingsConstants.scala
  29. +0 −1 webapi/src/main/scala/org/knora/webapi/settings/package.scala
  30. +8 −11 webapi/src/main/scala/org/knora/webapi/store/triplestore/TriplestoreManager.scala
  31. +0 −465 webapi/src/main/scala/org/knora/webapi/store/triplestore/embedded/JenaTDBActor.scala
  32. +9 −59 webapi/src/main/scala/org/knora/webapi/store/triplestore/http/HttpTriplestoreConnector.scala
  33. +1 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/admin/canDeleteList.scala.txt
  34. +1 −4 ...pi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/admin/changeParentNode.scala.txt
  35. +0 −3 .../org/knora/webapi/messages/twirl/queries/sparql/admin/createNewAdministrativePermission.scala.txt
  36. +0 −3 ...knora/webapi/messages/twirl/queries/sparql/admin/createNewDefaultObjectAccessPermission.scala.txt
  37. +0 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/admin/createNewGroup.scala.txt
  38. +0 −3 ...i/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/admin/createNewListNode.scala.txt
  39. +0 −3 ...pi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/admin/createNewProject.scala.txt
  40. +0 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/admin/createNewUser.scala.txt
  41. +0 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/admin/deleteNode.scala.txt
  42. +0 −3 ...pi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/admin/deletePermission.scala.txt
  43. +1 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/admin/getFileValue.scala.txt
  44. +1 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/admin/getGroups.scala.txt
  45. +1 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/admin/getListNode.scala.txt
  46. +1 −3 ...main/twirl/org/knora/webapi/messages/twirl/queries/sparql/admin/getListNodeWithChildren.scala.txt
  47. +1 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/admin/getLists.scala.txt
  48. +1 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/admin/getNodePath.scala.txt
  49. +1 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/admin/getParentNode.scala.txt
  50. +1 −3 .../src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/admin/getPermissionByIRI.scala.txt
  51. +1 −3 ...src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/admin/getProjectAdminData.scala.txt
  52. +1 −3 .../main/twirl/org/knora/webapi/messages/twirl/queries/sparql/admin/getProjectAdminMembers.scala.txt
  53. +1 −3 ...i/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/admin/getProjectMembers.scala.txt
  54. +1 −3 .../src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/admin/getProjectOfEntity.scala.txt
  55. +1 −3 ...c/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/admin/getProjectPermissions.scala.txt
  56. +1 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/admin/getProjects.scala.txt
  57. +1 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/admin/getUsers.scala.txt
  58. +1 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/admin/isEntityUsed.scala.txt
  59. +1 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/admin/isNodeUsed.scala.txt
  60. +0 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/admin/updateGroup.scala.txt
  61. +0 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/admin/updateListInfo.scala.txt
  62. +0 −3 .../src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/admin/updateNodePosition.scala.txt
  63. +0 −3 ...pi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/admin/updatePermission.scala.txt
  64. +0 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/admin/updateProject.scala.txt
  65. +0 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/admin/updateUser.scala.txt
  66. +0 −3 .../src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/admin/updateUserPassword.scala.txt
  67. +0 −2 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/addValueVersion.scala.txt
  68. +0 −2 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/changeComment.scala.txt
  69. +0 −2 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/changeLink.scala.txt
  70. +0 −2 ...pi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/changeResourceLabel.scala.txt
  71. +1 −3 .../src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/checkResourceDeletion.scala.txt
  72. +1 −3 ...c/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/checkResourceLabelChange.scala.txt
  73. +1 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/checkValueDeletion.scala.txt
  74. +1 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/ckanDokubib.scala.txt
  75. +1 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/ckanIncunabula.scala.txt
  76. +0 −2 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/createLink.scala.txt
  77. +0 −2 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/createNewResources.scala.txt
  78. +0 −2 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/createValue.scala.txt
  79. +0 −2 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/deleteLink.scala.txt
  80. +0 −2 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/deleteResource.scala.txt
  81. +0 −2 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/deleteValue.scala.txt
  82. +1 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/findLinkValueByIri.scala.txt
  83. +1 −3 .../src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/findLinkValueByObject.scala.txt
  84. +1 −3 .../src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/findResourceWithValue.scala.txt
  85. +1 −3 ...pi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/findValueInVersions.scala.txt
  86. +1 −3 ...wirl/org/knora/webapi/messages/twirl/queries/sparql/v1/getAdministrativePermissionByIri.scala.txt
  87. +1 −3 ...a/webapi/messages/twirl/queries/sparql/v1/getAdministrativePermissionForProjectAndGroup.scala.txt
  88. +1 −3 ...rg/knora/webapi/messages/twirl/queries/sparql/v1/getAdministrativePermissionsForProject.scala.txt
  89. +1 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/getContext.scala.txt
  90. +1 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/getCreatedResource.scala.txt
  91. +1 −3 ...wirl/org/knora/webapi/messages/twirl/queries/sparql/v1/getDefaultObjectAccessPermission.scala.txt
  92. +1 −3 ...org/knora/webapi/messages/twirl/queries/sparql/v1/getDefaultObjectAccessPermissionByIri.scala.txt
  93. +1 −3 ...ora/webapi/messages/twirl/queries/sparql/v1/getDefaultObjectAccessPermissionsForProject.scala.txt
  94. +1 −3 ...c/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/getFileValuesForResource.scala.txt
  95. +1 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/getGraphData.scala.txt
  96. +1 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/getGroupByIri.scala.txt
  97. +1 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/getGroupByName.scala.txt
  98. +1 −3 ...i/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/getGroupMembersByIri.scala.txt
  99. +1 −3 .../src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/getGroupMembersByName.scala.txt
  100. +0 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/getGroups.scala.txt
  101. +1 −3 .../src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/getIncomingReferences.scala.txt
  102. +1 −3 ...rc/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/getLastModificationDate.scala.txt
  103. +1 −3 ...irl/org/knora/webapi/messages/twirl/queries/sparql/v1/getLinkSourceAndTargetPermissions.scala.txt
  104. +1 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/getList.scala.txt
  105. +1 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/getNodePath.scala.txt
  106. +1 −3 .../main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/getObjectAccessPermission.scala.txt
  107. +1 −3 ...ain/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/getProjectAdminMembersByIri.scala.txt
  108. +1 −3 ...irl/org/knora/webapi/messages/twirl/queries/sparql/v1/getProjectAdminMembersByShortname.scala.txt
  109. +1 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/getProjectByIri.scala.txt
  110. +1 −3 .../src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/getProjectByShortcode.scala.txt
  111. +1 −3 .../src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/getProjectByShortname.scala.txt
  112. +1 −3 ...src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/getProjectMembersByIri.scala.txt
  113. +1 −3 ...in/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/getProjectMembersByShortname.scala.txt
  114. +0 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/getProjects.scala.txt
  115. +1 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/getRegions.scala.txt
  116. +1 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/getResourceClass.scala.txt
  117. +1 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/getResourceInfo.scala.txt
  118. +1 −3 .../twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/getResourcePropertiesAndValues.scala.txt
  119. +5 −18 ...rc/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/getResourceSearchResult.scala.txt
  120. +1 −3 ...n/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/getResourceTypesForNamedGraph.scala.txt
  121. +1 −3 ...in/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/getResourcesByProjectAndType.scala.txt
  122. +1 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/getUserByEmail.scala.txt
  123. +1 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/getUserByIri.scala.txt
  124. +0 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/getUsers.scala.txt
  125. +1 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/getValue.scala.txt
  126. +1 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/getVersionHistory.scala.txt
  127. +1 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/isPartOf.scala.txt
  128. +6 −38 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/searchExtended.scala.txt
  129. +4 −19 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v1/searchFulltext.scala.txt
  130. +1 −3 ...rc/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v2/addCardinalitiesToClass.scala.txt
  131. +0 −2 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v2/addValueVersion.scala.txt
  132. +1 −3 ...ain/twirl/org/knora/webapi/messages/twirl/queries/sparql/v2/changeClassLabelsOrComments.scala.txt
  133. +0 −2 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v2/changeLinkMetadata.scala.txt
  134. +0 −2 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v2/changeLinkTarget.scala.txt
  135. +1 −3 ...src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v2/changeOntologyMetadata.scala.txt
  136. +1 −3 ...c/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v2/changePropertyGuiElement.scala.txt
  137. +1 −3 .../twirl/org/knora/webapi/messages/twirl/queries/sparql/v2/changePropertyLabelsOrComments.scala.txt
  138. +1 −3 ...src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v2/changeResourceMetadata.scala.txt
  139. +0 −2 ...src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v2/changeValuePermissions.scala.txt
  140. +1 −3 .../src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v2/checkResourceDeletion.scala.txt
  141. +1 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v2/checkValueDeletion.scala.txt
  142. +1 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v2/createClass.scala.txt
  143. +0 −2 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v2/createLink.scala.txt
  144. +1 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v2/createNewMapping.scala.txt
  145. +0 −2 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v2/createNewResources.scala.txt
  146. +1 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v2/createOntology.scala.txt
  147. +1 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v2/createProperty.scala.txt
  148. +0 −2 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v2/createValue.scala.txt
  149. +1 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v2/deleteClass.scala.txt
  150. +0 −2 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v2/deleteLink.scala.txt
  151. +1 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v2/deleteOntology.scala.txt
  152. +1 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v2/deleteProperty.scala.txt
  153. +1 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v2/deleteResource.scala.txt
  154. +0 −2 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v2/deleteValue.scala.txt
  155. +1 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v2/eraseResource.scala.txt
  156. +0 −3 ...src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v2/getAllOntologyMetadata.scala.txt
  157. +1 −2 ...wirl/org/knora/webapi/messages/twirl/queries/sparql/v2/getAllResourcesInProjectPrequery.scala.txt
  158. +1 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v2/getClassDefinition.scala.txt
  159. +1 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v2/getDeleteDate.scala.txt
  160. +1 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v2/getGraphData.scala.txt
  161. +1 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v2/getMapping.scala.txt
  162. +1 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v2/getOntologyGraph.scala.txt
  163. +1 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v2/getOntologyInfo.scala.txt
  164. +1 −3 .../src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v2/getPropertyDefinition.scala.txt
  165. +1 −3 .../twirl/org/knora/webapi/messages/twirl/queries/sparql/v2/getResourcePropertiesAndValues.scala.txt
  166. +1 −2 .../twirl/org/knora/webapi/messages/twirl/queries/sparql/v2/getResourceValueVersionHistory.scala.txt
  167. +1 −3 .../org/knora/webapi/messages/twirl/queries/sparql/v2/getResourcesByClassInProjectPrequery.scala.txt
  168. +1 −3 ...i/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v2/getStandoffTagByUUID.scala.txt
  169. +1 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v2/isClassUsedInData.scala.txt
  170. +1 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v2/isEntityUsed.scala.txt
  171. +1 −3 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v2/isOntologyUsed.scala.txt
  172. +1 −3 .../main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v2/replaceClassCardinalities.scala.txt
  173. +2 −5 webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v2/searchFulltext.scala.txt
  174. +1 −3 .../src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v2/searchResourceByLabel.scala.txt
  175. +1 −3 webapi/src/main/twirl/org/knora/webapi/queries/sparql/v2/isPropertyUsed.scala.txt
  176. +19 −14 webapi/src/test/scala/org/knora/webapi/responders/v1/ResourcesResponderV1Spec.scala
  177. +13 −26 webapi/src/test/scala/org/knora/webapi/responders/v1/ValuesResponderV1Spec.scala
  178. +16 −16 webapi/src/test/scala/org/knora/webapi/responders/v2/ResourcesResponderV2Spec.scala
  179. +3 −3 webapi/src/test/scala/org/knora/webapi/responders/v2/StandoffResponderV2Spec.scala
  180. +5 −11 webapi/src/test/scala/org/knora/webapi/store/triplestore/AllTriplestoreSpec.scala
@@ -279,19 +279,14 @@ SPARQL queries are generated from templates, using the
[Twirl](https://github.com/playframework/twirl) template engine. For
example, if we're querying a resource, the template will contain a
placeholder for the resource's IRI. The templates can be found under
`src/main/twirl/queries/sparql`. In many cases, different SPARQL must
be generated for different triplestores; the Twirl template function
then takes the name of the triplestore as a parameter, and may delegate
to triplestore-specific templates.
`src/main/twirl/queries/sparql`.

Responders are not expected to know which triplestore is being used or how it
is accessed. To perform a SPARQL SELECT query, a responder sends a `SparqlSelectRequest`
To perform a SPARQL SELECT query, a responder sends a `SparqlSelectRequest`
message to the `storeManager` actor, like this:

```scala
for {
isEntityUsedSparql <- Future(queries.sparql.v2.txt.isEntityUsed(
triplestore = settings.triplestoreType,
entityIri = entityIri,
ignoreKnoraConstraints = ignoreKnoraConstraints,
ignoreRdfSubjectAndObject = ignoreRdfSubjectAndObject
@@ -7,6 +7,9 @@

## Overview

**GraphDB and embedded Jena TDB triplestores support is deprecated** since
[v20.1.1](https://github.com/dasch-swiss/dsp-api/releases/tag/v20.1.1) of DSP-API.

The store module houses the different types of data stores supported by
Knora. At the moment, only triplestores and IIIF servers (Sipi) are supported.
The triplestore support is implemented in the
@@ -20,170 +23,16 @@ which is started when Knora starts. The `StoreManager` then starts the
`TriplestoreManager` and `IIIFManager`, which each in turn starts their
correct actor implementation.

## HTTP-based Triplestores

HTTP-based triplestore support is implemented in the
`org.knora.webapi.triplestore.http` package.

An HTTP-based triplestore is one that is accessed remotely over the HTTP
protocol. `HttpTriplestoreConnector` supports the open source triplestore
- [Apache Jena Fuseki](https://jena.apache.org).

### Apache Jena Fuseki

## Embedded Triplestores

Embedded triplestores are implemented in the
`org.knora.webapi.triplestore.embedded` package.

An embedded triplestore is one that runs in the same JVM as the Knora
API server.

### Apache Jena TDB

The support for embedded Jena TDB is currently dropped. The
documentation and the code will remain in the repository. You can use it
at your own risk.

The support for the embedded Jena-TDB triplestore is implemented in
`org.knora.webapi.triplestore.embedded.JenaTDBActor`.

The relevant Jena libraries that are used are the following:

- Jena API - The library used to work programmatically with RDF data
- Jena TDB - Their implementation of a triple store

#### Concurrency

Jena provides concurrency on different levels.

On the Jena TDB level there is the `Dataset` object, representing the
triple store. On every access, a transaction (read or write) can be
started.

On the Jena API level there is a `Model` object, which is equivalent to
an RDF `Graph`. Here we can lock the model, so that MRSW (Multiple
Reader Single Writer) access is allowed.

- <https://jena.apache.org/documentation/tdb/tdb_transactions.html>
- <https://jena.apache.org/documentation/notes/concurrency-howto.html>
## Triplestores

#### Implementation
Currently, the only supported triplestore is [Apache Jena Fuseki](https://jena.apache.org), a HTTP-based triplestore.

We employ transactions on the `Dataset` level. This means that every
thread that accesses the triplestore, starts a read or write enabled
transaction.
HTTP-based triplestore support is implemented in the `org.knora.webapi.triplestore.http` package.

The transaction mechanism in TDB is based on write-ahead-logging. All
changes made inside a write-transaction are written to journals, then
propagated to the main database at a suitable moment. This design allows
for read-transactions to proceed without locking or other overhead over
the base database.

Transactional TDB supports one active write transaction, and multiple
read transactions at the same time. Read-transactions started before a
write-transaction commits see the database in a state without any
changes visible. Any transaction starting after a write-transaction
commits sees the database with the changes visible, whether fully
propagates back to the database or not. There can be active read
transactions seeing the state of the database before the updates, and
read transactions seeing the state of the database after the updates
running at the same time.

#### Configuration

In `application.conf` set to use the embedded triplestore:

```
triplestore {
dbtype = "embedded-jena-tdb"
embedded-jena-tdb {
persisted = true // "false" -> memory, "true" -> disk
loadExistingData = false // "false" -> use data if exists, "false" -> create a fresh store
storage-path = "_TMP" // ignored if "memory"
}
reload-on-start = false // ignored if "memory" as it will always reload
rdf-data = [
{
path = "knora-ontologies/knora-base.ttl"
name = "http://www.knora.org/ontology/knora-base"
}
{
path = "knora-ontologies/salsah-gui.ttl"
name = "http://www.knora.org/ontology/salsah-gui"
}
{
path = "test_data/ontologies/incunabula-onto.ttl"
name = "http://www.knora.org/ontology/0803/incunabula"
}
{
path = "test_data/demo_data/incunabula-demo-data.ttl"
name = "http://www.knora.org/data/incunabula"
}
{
path = "test_data/ontologies/images-onto.ttl"
name = "http://www.knora.org/ontology/0804/dokubib"
}
{
path = "test_data/demo_data/images-demo-data.ttl"
name = "http://www.knora.org/data/dokubib"
}
]
}
```

Here the storage is set to `persistent`, meaning that a Jena TDB store
will be created under the defined `tdb-storage-path`. The
`reload-on-start` flag, if set to `true` would reload the triplestore
with the data referenced in `rdf-data`.

#### TDB Disk Persisted Store

Make sure to set `reload-on-start` to `true` if run for the first time.
This will create a TDB store and load the data.

If only *read access* is performed, then Knora can be run once with
reloading enabled. After that, reloading can be turned off, and the
persisted TDB store can be reused, as any data found under the
`tdb-storage-path` will be reused.

If the TDB storage files get corrupted, then just delete the folder and
reload the data anew.

#### Actor Messages

- `ResetTripleStoreContent(rdfDataObjects: List[RdfDataObject])`
- `ResetTripleStoreContentACK()`

The embedded Jena TDB can receive reset messages, and will ACK when
reloading of the data is finished. `RdfDataObject` is a simple case
class, containing the path and name (the same as `rdf-data` in the
config file)

As an example, to use it inside a test you could write something like:

```scala
val rdfDataObjects = List (
RdfDataObject(path = "knora-ontologies/knora-base.ttl",
name = "http://www.knora.org/ontology/knora-base"),
RdfDataObject(path = "knora-ontologies/salsah-gui.ttl",
name = "http://www.knora.org/ontology/salsah-gui"),
RdfDataObject(path = "test_data/ontologies/incunabula-onto.ttl",
name = "http://www.knora.org/ontology/0803/incunabula"),
RdfDataObject(path = "test_data/all_data/incunabula-data.ttl",
name = "http://www.knora.org/data/incunabula")
)
An HTTP-based triplestore is one that is accessed remotely over the HTTP
protocol. `HttpTriplestoreConnector` supports the open source triplestore [Apache Jena Fuseki](https://jena.apache.org).

"Reload data " in {
storeManager ! ResetTripleStoreContent(rdfDataObjects)
expectMsg(300.seconds, ResetTripleStoreContentACK())
}
```

## IIIF Servers

Currently, only support for SIPI is implemented in
`org.knora.webapi.store.iiifSipiConnector`.
Currently, only support for SIPI is implemented in `org.knora.webapi.store.iiifSipiConnector`.
@@ -24,7 +24,7 @@ installation of Knora. The different parts are:
A number of triplestore implementations are available, including [free
software](http://www.gnu.org/philosophy/free-sw.en.html) as well as
proprietary options. DSP-API is designed to work with any
standards-compliant triplestore. It is primarily tested with [Apache Jena](https://jena.apache.org/).
standards-compliant triplestore. It is primarily tested with [Apache Jena Fuseki](https://jena.apache.org/).

## Sipi

@@ -510,7 +510,6 @@ app {
triplestore {
dbtype = "fuseki"
dbtype = ${?KNORA_WEBAPI_TRIPLESTORE_DBTYPE}
// dbtype = "embedded-jena-tdb"
// dbtype = "fake-triplestore"

use-https = false
@@ -540,17 +539,6 @@ app {
password = ${?KNORA_WEBAPI_TRIPLESTORE_FUSEKI_PASSWORD}
}

embedded-jena-tdb {
persisted = true // "false" -> memory, "true" -> disk
loadExistingData = false // "false" -> use data if exists, "false" -> create a fresh store
storage-path = "_TMP" // ignored if "memory"
}

fake-jena-tdb {
fake-persisted-storage = true
fake-triplestore-data-dir = "src/main/resources/query-log"
}

reload-on-start = false // ignored if "memory" as it will always reload

# This data is automatically loaded during resetting of the triple store content initiated
@@ -6,23 +6,27 @@
package org.knora.webapi
package responders

import exceptions.{BadRequestException, DuplicateValueException, UnexpectedMessageException}
import messages.store.triplestoremessages.SparqlSelectRequest
import messages.util.ResponderData
import messages.util.rdf.SparqlSelectResult
import messages.{SmartIri, StringFormatter}
import settings.{KnoraDispatchers, KnoraSettings, KnoraSettingsImpl}
import akka.actor.{ActorRef, ActorSystem}
import akka.actor.ActorRef
import akka.actor.ActorSystem
import akka.event.LoggingAdapter
import akka.http.scaladsl.util.FastFuture
import akka.pattern._
import akka.util.Timeout
import com.typesafe.scalalogging.{LazyLogging, Logger}
import com.typesafe.scalalogging.LazyLogging
import com.typesafe.scalalogging.Logger
import org.knora.webapi.store.cacheservice.settings.CacheServiceSettings

import scala.concurrent.{ExecutionContext, Future}
import scala.concurrent.ExecutionContext
import scala.concurrent.Future
import scala.language.postfixOps

import exceptions.{BadRequestException, DuplicateValueException, UnexpectedMessageException}
import messages.store.triplestoremessages.SparqlSelectRequest
import messages.util.ResponderData
import messages.util.rdf.SparqlSelectResult
import messages.{SmartIri, StringFormatter}
import settings.{KnoraDispatchers, KnoraSettings, KnoraSettingsImpl}

/**
* Responder helper methods.
*/
@@ -118,7 +122,6 @@ abstract class Responder(responderData: ResponderData) extends LazyLogging {
isEntityUsedSparql <- Future(
org.knora.webapi.messages.twirl.queries.sparql.v2.txt
.isEntityUsed(
triplestore = settings.triplestoreType,
entityIri = entityIri,
ignoreKnoraConstraints = ignoreKnoraConstraints,
ignoreRdfSubjectAndObject = ignoreRdfSubjectAndObject
@@ -145,7 +148,6 @@ abstract class Responder(responderData: ResponderData) extends LazyLogging {
isClassUsedInDataSparql <- Future(
org.knora.webapi.messages.twirl.queries.sparql.v2.txt
.isClassUsedInData(
triplestore = settings.triplestoreType,
classIri = classIri
)
.toString()
@@ -11,17 +11,22 @@ import org.knora.webapi._
import org.knora.webapi.exceptions._
import org.knora.webapi.feature.FeatureFactoryConfig
import org.knora.webapi.messages.IriConversions._
import org.knora.webapi.messages.OntologyConstants
import org.knora.webapi.messages.SmartIri
import org.knora.webapi.messages.admin.responder.groupsmessages._
import org.knora.webapi.messages.admin.responder.projectsmessages.{ProjectADM, ProjectGetADM, ProjectIdentifierADM}
import org.knora.webapi.messages.admin.responder.projectsmessages.ProjectADM
import org.knora.webapi.messages.admin.responder.projectsmessages.ProjectGetADM
import org.knora.webapi.messages.admin.responder.projectsmessages.ProjectIdentifierADM
import org.knora.webapi.messages.admin.responder.usersmessages._
import org.knora.webapi.messages.admin.responder.valueObjects.GroupStatus
import org.knora.webapi.messages.store.triplestoremessages._
import org.knora.webapi.messages.util.KnoraSystemInstances
import org.knora.webapi.messages.util.ResponderData
import org.knora.webapi.messages.util.rdf.SparqlSelectResult
import org.knora.webapi.messages.util.{KnoraSystemInstances, ResponderData}
import org.knora.webapi.messages.v1.responder.projectmessages._
import org.knora.webapi.messages.{OntologyConstants, SmartIri}
import org.knora.webapi.responders.IriLocker
import org.knora.webapi.responders.Responder
import org.knora.webapi.responders.Responder.handleUnexpectedMessage
import org.knora.webapi.responders.{IriLocker, Responder}

import java.util.UUID
import scala.concurrent.Future
@@ -88,7 +93,6 @@ class GroupsResponderADM(responderData: ResponderData) extends Responder(respond
sparqlQuery <- Future(
org.knora.webapi.messages.twirl.queries.sparql.admin.txt
.getGroups(
triplestore = settings.triplestoreType,
maybeIri = None
)
.toString()
@@ -210,7 +214,6 @@ class GroupsResponderADM(responderData: ResponderData) extends Responder(respond
sparqlQuery <- Future(
org.knora.webapi.messages.twirl.queries.sparql.admin.txt
.getGroups(
triplestore = settings.triplestoreType,
maybeIri = Some(groupIri)
)
.toString()
@@ -326,7 +329,6 @@ class GroupsResponderADM(responderData: ResponderData) extends Responder(respond
sparqlQueryString <- Future(
org.knora.webapi.messages.twirl.queries.sparql.v1.txt
.getGroupMembersByIri(
triplestore = settings.triplestoreType,
groupIri
)
.toString()
@@ -461,7 +463,6 @@ class GroupsResponderADM(responderData: ResponderData) extends Responder(respond
createNewGroupSparqlString = org.knora.webapi.messages.twirl.queries.sparql.admin.txt
.createNewGroup(
adminNamedGraphIri = OntologyConstants.NamedGraphs.AdminNamedGraph,
triplestore = settings.triplestoreType,
groupIri,
groupClassIri = OntologyConstants.KnoraAdmin.UserGroup,
name = createRequest.name.value,
@@ -726,7 +727,6 @@ class GroupsResponderADM(responderData: ResponderData) extends Responder(respond
org.knora.webapi.messages.twirl.queries.sparql.admin.txt
.updateGroup(
adminNamedGraphIri = "http://www.knora.org/data/admin",
triplestore = settings.triplestoreType,
groupIri,
maybeName = groupUpdatePayload.name.map(_.value),
maybeDescriptions = groupUpdatePayload.descriptions.map(_.value),

0 comments on commit a5ea62e

Please sign in to comment.