Skip to content

Commit

Permalink
Merge branch 'master' into envelope-to-elem
Browse files Browse the repository at this point in the history
  • Loading branch information
dantb committed Jan 9, 2024
2 parents 38a8220 + fe86350 commit 3ef239e
Show file tree
Hide file tree
Showing 59 changed files with 306 additions and 234 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-delta-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
java-version: '21'
check-latest: true
- name: Checkout
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-delta-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
java-version: '21'
check-latest: true
- name: Checkout
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-delta-plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
java-version: '21'
check-latest: true
- name: Checkout
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-delta-static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
java-version: '21'
check-latest: true
- name: Checkout
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-docs-ext-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
java-version: '21'
check-latest: true
- name: Checkout
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
java-version: '21'
check-latest: true
- name: Checkout
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
java-version: '21'
check-latest: true
- name: Checkout
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-release-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
java-version: '21'
check-latest: true
- name: Set up proxy for docker buildx
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-release-sonatype.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
java-version: '21'
check-latest: true
- name: Publish To Sonatype
run: sbt -Dsbt.color=always -Dsbt.supershell=false ci-release
2 changes: 1 addition & 1 deletion .github/workflows/ci-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
java-version: '21'
check-latest: true
- name: Set up proxy for docker buildx
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-storage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
java-version: '21'
check-latest: true
- name: Checkout
uses: actions/checkout@v4
Expand Down
14 changes: 7 additions & 7 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,22 @@ val handleBarsVersion = "4.3.1"
val hikariVersion = "5.1.0"
val jenaVersion = "4.2.0"
val jsonldjavaVersion = "0.13.6"
val kamonVersion = "2.6.6"
val kamonVersion = "2.7.0"
val kanelaAgentVersion = "1.0.18"
val kindProjectorVersion = "0.13.2"
val log4catsVersion = "2.6.0"
val logbackVersion = "1.4.14"
val magnoliaVersion = "1.1.6"
val magnoliaVersion = "1.1.8"
val mockitoVersion = "1.17.30"
val munitVersion = "1.0.0-M10"
val munitCatsEffectVersion = "2.0.0-M4"
val nimbusJoseJwtVersion = "9.37.1"
val postgresJdbcVersion = "42.7.0"
val nimbusJoseJwtVersion = "9.37.3"
val postgresJdbcVersion = "42.7.1"
val pureconfigVersion = "0.17.4"
val scalaTestVersion = "3.2.17"
val scalaXmlVersion = "2.2.0"
val topBraidVersion = "1.3.2" // 1.4.1 fails to validate some test schemas
val testContainersVersion = "1.19.1"
val testContainersVersion = "1.19.3"

lazy val akkaActorTyped = "com.typesafe.akka" %% "akka-actor-typed" % akkaVersion

Expand Down Expand Up @@ -913,7 +913,7 @@ lazy val compilation = {
Seq(
scalaVersion := scalaCompilerVersion,
scalacOptions ~= { options: Seq[String] => options.filterNot(Set("-Wself-implicit", "-Xlint:infer-any", "-Wnonunit-statement")) },
javaSpecificationVersion := "17",
javaSpecificationVersion := "21",
javacOptions ++= Seq(
"-source",
javaSpecificationVersion.value,
Expand Down Expand Up @@ -977,7 +977,7 @@ lazy val servicePackaging = {
else version.value
},
Docker / daemonUser := "nexus",
dockerBaseImage := "eclipse-temurin:17-jre",
dockerBaseImage := "eclipse-temurin:21-jre",
dockerBuildxPlatforms := Seq("linux/arm64/v8", "linux/amd64"),
dockerExposedPorts := Seq(8080),
dockerUsername := Some("bluebrain"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import ch.epfl.bluebrain.nexus.delta.sdk.organizations.model.Organization
import ch.epfl.bluebrain.nexus.delta.sdk.projects.model.Project
import ch.epfl.bluebrain.nexus.delta.sdk.{Defaults, ScopeInitialization}
import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.Subject
import ch.epfl.bluebrain.nexus.delta.sourcing.model.{EntityType, Identity}
import ch.epfl.bluebrain.nexus.delta.sourcing.model.{EntityType, Identity, IriFilter}

/**
* The default creation of the default SparqlView as part of the project initialization.
Expand All @@ -38,8 +38,8 @@ class BlazegraphScopeInitialization(
private def defaultValue: IndexingBlazegraphViewValue = IndexingBlazegraphViewValue(
name = Some(defaults.name),
description = Some(defaults.description),
resourceSchemas = Set.empty,
resourceTypes = Set.empty,
resourceSchemas = IriFilter.None,
resourceTypes = IriFilter.None,
resourceTag = None,
includeMetadata = true,
includeDeprecated = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import ch.epfl.bluebrain.nexus.delta.sdk.model.{BaseUri, IdSegmentRef, Tags}
import ch.epfl.bluebrain.nexus.delta.sdk.permissions.model.Permission
import ch.epfl.bluebrain.nexus.delta.sdk.syntax._
import ch.epfl.bluebrain.nexus.delta.sdk.views.ViewRef
import ch.epfl.bluebrain.nexus.delta.sourcing.model.ProjectRef
import ch.epfl.bluebrain.nexus.delta.sourcing.model.{IriFilter, ProjectRef}
import ch.epfl.bluebrain.nexus.delta.sourcing.model.Tag.UserTag
import io.circe.generic.extras.Configuration
import io.circe.generic.extras.semiauto.deriveConfiguredEncoder
Expand Down Expand Up @@ -112,8 +112,8 @@ object BlazegraphView {
description: Option[String],
project: ProjectRef,
uuid: UUID,
resourceSchemas: Set[Iri],
resourceTypes: Set[Iri],
resourceSchemas: IriFilter,
resourceTypes: IriFilter,
resourceTag: Option[UserTag],
includeMetadata: Boolean,
includeDeprecated: Boolean,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import ch.epfl.bluebrain.nexus.delta.rdf.jsonld.decoder.{Configuration, JsonLdDe
import ch.epfl.bluebrain.nexus.delta.sdk.permissions.model.Permission
import ch.epfl.bluebrain.nexus.delta.sdk.views.ViewRef
import ch.epfl.bluebrain.nexus.delta.sourcing.model.Tag.{Latest, UserTag}
import ch.epfl.bluebrain.nexus.delta.sourcing.model.IriFilter
import ch.epfl.bluebrain.nexus.delta.sourcing.query.SelectFilter
import ch.epfl.bluebrain.nexus.delta.sourcing.stream.PipeChain
import io.circe.generic.extras.semiauto.deriveConfiguredEncoder
Expand Down Expand Up @@ -72,8 +73,8 @@ object BlazegraphViewValue {
final case class IndexingBlazegraphViewValue(
name: Option[String] = None,
description: Option[String] = None,
resourceSchemas: Set[Iri] = Set.empty,
resourceTypes: Set[Iri] = Set.empty,
resourceSchemas: IriFilter = IriFilter.None,
resourceTypes: IriFilter = IriFilter.None,
resourceTag: Option[UserTag] = None,
includeMetadata: Boolean = false,
includeDeprecated: Boolean = false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import ch.epfl.bluebrain.nexus.delta.sdk.projects.model.ApiMappings
import ch.epfl.bluebrain.nexus.delta.sdk.resolvers.ResolverContextResolution
import ch.epfl.bluebrain.nexus.delta.sdk.{ConfigFixtures, Defaults}
import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.{Subject, User}
import ch.epfl.bluebrain.nexus.delta.sourcing.model.Label
import ch.epfl.bluebrain.nexus.delta.sourcing.model.{IriFilter, Label}
import ch.epfl.bluebrain.nexus.delta.sourcing.postgres.DoobieScalaTestFixture
import ch.epfl.bluebrain.nexus.testkit.scalatest.ce.CatsEffectSpec

Expand Down Expand Up @@ -69,8 +69,8 @@ class BlazegraphScopeInitializationSpec
val resource = views.fetch(defaultViewId, project.ref).accepted
resource.value match {
case v: IndexingBlazegraphView =>
v.resourceSchemas shouldBe empty
v.resourceTypes shouldBe empty
v.resourceSchemas shouldBe IriFilter.None
v.resourceTypes shouldBe IriFilter.None
v.resourceTag shouldEqual None
v.includeDeprecated shouldEqual true
v.includeMetadata shouldEqual true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import ch.epfl.bluebrain.nexus.delta.sdk.permissions.model.Permission
import ch.epfl.bluebrain.nexus.delta.sdk.projects.model.{ApiMappings, ProjectContext}
import ch.epfl.bluebrain.nexus.delta.sdk.views.ViewRef
import ch.epfl.bluebrain.nexus.delta.sourcing.model.Tag.UserTag
import ch.epfl.bluebrain.nexus.delta.sourcing.model.{Label, ProjectRef}
import ch.epfl.bluebrain.nexus.delta.sourcing.model.{IriFilter, Label, ProjectRef}
import ch.epfl.bluebrain.nexus.testkit.scalatest.ce.CatsEffectSpec
import io.circe.literal._

Expand Down Expand Up @@ -62,8 +62,8 @@ class BlazegraphViewDecodingSpec extends CatsEffectSpec with Fixtures {
val expected = IndexingBlazegraphViewValue(
name = Some("viewName"),
description = Some("viewDescription"),
resourceSchemas = Set(context.vocab / "Person"),
resourceTypes = Set(context.vocab / "Person"),
resourceSchemas = IriFilter.restrictedTo(context.vocab / "Person"),
resourceTypes = IriFilter.restrictedTo(context.vocab / "Person"),
resourceTag = Some(UserTag.unsafe("release")),
includeMetadata = false,
includeDeprecated = false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import ch.epfl.bluebrain.nexus.delta.sdk.projects.model.ApiMappings
import ch.epfl.bluebrain.nexus.delta.sdk.resolvers.ResolverContextResolution
import ch.epfl.bluebrain.nexus.delta.sdk.views.ViewRef
import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.{Authenticated, Group, User}
import ch.epfl.bluebrain.nexus.delta.sourcing.model.Label
import ch.epfl.bluebrain.nexus.delta.sourcing.model.{IriFilter, Label}
import ch.epfl.bluebrain.nexus.delta.sourcing.model.Tag.UserTag
import ch.epfl.bluebrain.nexus.delta.sourcing.postgres.DoobieScalaTestFixture
import ch.epfl.bluebrain.nexus.testkit.scalatest.ce.CatsEffectSpec
Expand All @@ -45,8 +45,8 @@ class BlazegraphViewsSpec extends CatsEffectSpec with DoobieScalaTestFixture wit
val indexingValue = IndexingBlazegraphViewValue(
None,
None,
Set.empty,
Set.empty,
IriFilter.None,
IriFilter.None,
None,
includeMetadata = false,
includeDeprecated = false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import ch.epfl.bluebrain.nexus.delta.sdk.permissions.model.Permission
import ch.epfl.bluebrain.nexus.delta.sdk.views.ViewRef
import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.{Anonymous, Subject, User}
import ch.epfl.bluebrain.nexus.delta.sourcing.model.Tag.UserTag
import ch.epfl.bluebrain.nexus.delta.sourcing.model.{Label, ProjectRef}
import ch.epfl.bluebrain.nexus.delta.sourcing.model.{IriFilter, Label, ProjectRef}
import ch.epfl.bluebrain.nexus.testkit.scalatest.ce.CatsEffectSpec
import io.circe.Json

Expand All @@ -43,8 +43,8 @@ class BlazegraphViewsStmSpec extends CatsEffectSpec with Fixtures {
val indexingValue = IndexingBlazegraphViewValue(
None,
None,
Set.empty,
Set.empty,
IriFilter.None,
IriFilter.None,
None,
includeMetadata = false,
includeDeprecated = false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import ch.epfl.bluebrain.nexus.delta.sdk.stream.GraphResourceStream
import ch.epfl.bluebrain.nexus.delta.sdk.views.ViewRef
import ch.epfl.bluebrain.nexus.delta.sourcing.config.BatchConfig
import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.{Anonymous, Subject}
import ch.epfl.bluebrain.nexus.delta.sourcing.model.ProjectRef
import ch.epfl.bluebrain.nexus.delta.sourcing.model.{IriFilter, ProjectRef}
import ch.epfl.bluebrain.nexus.delta.sourcing.model.Tag.UserTag
import ch.epfl.bluebrain.nexus.delta.sourcing.offset.Offset
import ch.epfl.bluebrain.nexus.delta.sourcing.stream.ProjectionErr.CouldNotFindTypedPipeErr
Expand Down Expand Up @@ -49,10 +49,10 @@ class IndexingViewDefSuite extends NexusSuite {

private val namespace = s"${prefix}_${uuid}_1"

private val filterByTypeConfig = FilterByTypeConfig(Set(nxv + "PullRequest"))
private val filterByTypeConfig = FilterByTypeConfig(IriFilter.restrictedTo(nxv + "PullRequest"))
private val indexing = IndexingBlazegraphViewValue(
resourceTag = Some(UserTag.unsafe("some.tag")),
resourceTypes = Set(nxv + "PullRequest")
resourceTypes = IriFilter.restrictedTo(nxv + "PullRequest")
)

private val aggregate =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package ch.epfl.bluebrain.nexus.delta.plugins.blazegraph.model

import ch.epfl.bluebrain.nexus.delta.plugins.blazegraph.model.BlazegraphViewValue.{nextIndexingRev, IndexingBlazegraphViewValue}
import ch.epfl.bluebrain.nexus.delta.rdf.IriOrBNode.Iri
import ch.epfl.bluebrain.nexus.delta.sourcing.model.IriFilter
import ch.epfl.bluebrain.nexus.delta.sourcing.model.Tag.UserTag
import munit.FunSuite

Expand All @@ -21,8 +22,8 @@ class BlazegraphViewValueSuite extends FunSuite {

test("Views with different reindexing fields") {
val viewValues = List(
viewValue.copy(resourceSchemas = Set(Iri.unsafe("http://localhost/schema"))),
viewValue.copy(resourceTypes = Set(Iri.unsafe("https://localhost/type"))),
viewValue.copy(resourceSchemas = IriFilter.restrictedTo(Iri.unsafe("http://localhost/schema"))),
viewValue.copy(resourceTypes = IriFilter.restrictedTo(Iri.unsafe("https://localhost/type"))),
viewValue.copy(resourceTag = Some(UserTag.unsafe("tag"))),
viewValue.copy(includeMetadata = true),
viewValue.copy(includeDeprecated = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import ch.epfl.bluebrain.nexus.delta.sdk.sse.SseEncoder.SseData
import ch.epfl.bluebrain.nexus.delta.sdk.views.ViewRef
import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.{Subject, User}
import ch.epfl.bluebrain.nexus.delta.sourcing.model.Tag.UserTag
import ch.epfl.bluebrain.nexus.delta.sourcing.model.{Label, ProjectRef}
import ch.epfl.bluebrain.nexus.delta.sourcing.model.{IriFilter, Label, ProjectRef}
import io.circe.{Json, JsonObject}

import java.time.Instant
Expand All @@ -32,8 +32,8 @@ class BlazegraphViewsSerializationSuite extends SerializationSuite {
private val indexingValue = IndexingBlazegraphViewValue(
Some("viewName"),
Some("viewDescription"),
Set(nxv + "some-schema"),
Set(nxv + "SomeType"),
IriFilter.restrictedTo(nxv + "some-schema"),
IriFilter.restrictedTo(nxv + "SomeType"),
Some(UserTag.unsafe("some.tag")),
includeMetadata = false,
includeDeprecated = false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import ch.epfl.bluebrain.nexus.delta.sdk.http.HttpClientError.HttpClientStatusEr
import ch.epfl.bluebrain.nexus.delta.sdk.projects.model.ProjectStatistics
import ch.epfl.bluebrain.nexus.delta.sdk.stream.StreamConverter
import ch.epfl.bluebrain.nexus.delta.sdk.syntax._
import ch.epfl.bluebrain.nexus.delta.sourcing.model.ElemStream
import ch.epfl.bluebrain.nexus.delta.sourcing.model.{ElemStream, IriFilter}
import ch.epfl.bluebrain.nexus.delta.sourcing.offset.Offset
import ch.epfl.bluebrain.nexus.delta.sourcing.offset.Offset.Start
import ch.epfl.bluebrain.nexus.delta.sourcing.stream.{Elem, RemainingElems}
Expand Down Expand Up @@ -149,9 +149,10 @@ object DeltaClient {
}
}

private def typeQuery(types: Set[Iri]) =
if (types.isEmpty) Query.Empty
else Query(types.map(t => "type" -> t.toString).toList: _*)
private def typeQuery(restriction: IriFilter) = restriction match {
case IriFilter.None => Query.Empty
case IriFilter.Include(types) => Query(types.map(t => "type" -> t.toString).toList: _*)
}

private def elemAddress(source: RemoteProjectSource) =
(source.endpoint / "elems" / source.project.organization.value / source.project.project.value)
Expand Down
Loading

0 comments on commit 3ef239e

Please sign in to comment.