-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Jena and Topbraid versions #4837
Changes from 3 commits
2227062
d40ff77
d55ef52
d8d9282
5e3da67
e7a9723
5672008
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,7 +41,7 @@ val fs2AwsVersion = "6.1.1" | |
val googleAuthClientVersion = "1.35.0" | ||
val handleBarsVersion = "4.4.0" | ||
val hikariVersion = "5.1.0" | ||
val jenaVersion = "4.2.0" | ||
val jenaVersion = "4.10.0" | ||
val jsonldjavaVersion = "0.13.6" | ||
val kamonVersion = "2.7.1" | ||
val kanelaAgentVersion = "1.0.18" | ||
|
@@ -57,7 +57,7 @@ val postgresJdbcVersion = "42.7.3" | |
val pureconfigVersion = "0.17.6" | ||
val scalaTestVersion = "3.2.18" | ||
val scalaXmlVersion = "2.2.0" | ||
val topBraidVersion = "1.3.2" // 1.4.1 fails to validate some test schemas | ||
val topBraidVersion = "1.4.3" // 1.4.1 fails to validate some test schemas | ||
val testContainersVersion = "1.19.7" | ||
val testContainersScalaVersion = "0.41.3" | ||
|
||
|
@@ -109,7 +109,7 @@ lazy val fs2Aws = "io.laserdisc" %% "fs2- | |
lazy val fs2AwsS3 = "io.laserdisc" %% "fs2-aws-s3" % fs2AwsVersion | ||
lazy val googleAuthClient = "com.google.oauth-client" % "google-oauth-client" % googleAuthClientVersion | ||
lazy val handleBars = "com.github.jknack" % "handlebars" % handleBarsVersion | ||
lazy val jenaArq = "org.apache.jena" % "jena-arq" % jenaVersion | ||
lazy val jenaArq = "org.apache.jena" % "jena-arq" % jenaVersion exclude ("com.apicatalog", "titanium-json-ld") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To make sure we don't use Json-LD 1.1 for now |
||
lazy val jsonldjava = "com.github.jsonld-java" % "jsonld-java" % jsonldjavaVersion | ||
lazy val kamonAkkaHttp = "io.kamon" %% "kamon-akka-http" % kamonVersion | ||
lazy val kamonCore = "io.kamon" %% "kamon-core" % kamonVersion | ||
|
@@ -127,7 +127,7 @@ lazy val pureconfigCats = "com.github.pureconfig" %% "pure | |
lazy val scalaReflect = "org.scala-lang" % "scala-reflect" % scalaCompilerVersion | ||
lazy val scalaTest = "org.scalatest" %% "scalatest" % scalaTestVersion | ||
lazy val scalaXml = "org.scala-lang.modules" %% "scala-xml" % scalaXmlVersion | ||
lazy val topBraidShacl = "org.topbraid" % "shacl" % topBraidVersion | ||
lazy val topBraidShacl = "org.topbraid" % "shacl" % topBraidVersion exclude ("com.apicatalog", "titanium-json-ld") | ||
lazy val testContainers = "org.testcontainers" % "testcontainers" % testContainersVersion | ||
lazy val testContainersScala = "com.dimafeng" %% "testcontainers-scala-munit" % testContainersScalaVersion | ||
lazy val testContainersScalaLocalStack = "com.dimafeng" %% "testcontainers-scala-localstack-v2" % testContainersScalaVersion | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,6 @@ | |
}, | ||
"value": "nxv:42" | ||
}, | ||
"targetedNodes": 417 | ||
"targetedNodes": 412 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is this changing? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not totally sure but we don't load the dash/tosh extensions provided by Topbraid anymore so my guess is there are fewer constraints and fewer nodes can get validated in the end. |
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package ch.epfl.bluebrain.nexus.delta.rdf.shacl | ||
|
||
import cats.effect.IO | ||
import ch.epfl.bluebrain.nexus.delta.kernel.utils.ClasspathResourceLoader | ||
import org.apache.jena.graph.GraphMemFactory.createDefaultGraph | ||
import org.apache.jena.rdf.model.{Model, ModelFactory} | ||
import org.apache.jena.util.FileUtils | ||
import org.topbraid.shacl.vocabulary.SH | ||
|
||
object ShaclFileLoader { | ||
|
||
private val loader = ClasspathResourceLoader() | ||
|
||
private def readFromTurtleFile(base: String, resourcePath: String) = | ||
loader | ||
.streamOf(resourcePath) | ||
.use { is => | ||
IO.blocking { | ||
ModelFactory | ||
.createModelForGraph(createDefaultGraph()) | ||
.read(is, base, FileUtils.langTurtle) | ||
} | ||
} | ||
|
||
def readShaclShapes: IO[Model] = readFromTurtleFile("http://www.w3.org/ns/shacl-shacl#", "shacl-shacl.ttl") | ||
|
||
def readShaclVocabulary: IO[Model] = readFromTurtleFile(SH.BASE_URI, "rdf/shacl.ttl") | ||
} |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you encounter any particular issues with validation for some schemas?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only when loading the extensions from topbraid where they added more constraints in 1.4.x and some were breaking.
As we don't rely on them, I made the change to only rely on those from shacl core.
There are still a few tests to be done though (via the validate endpoints) to make sure things are ok