Skip to content

Commit

Permalink
feat: Disable rdfs inferencing in shacl validator and deactivate vali…
Browse files Browse the repository at this point in the history
…dateShapes as default (DEV-4261) (#3396)
  • Loading branch information
seakayone authored Oct 21, 2024
1 parent 3b9a42e commit a281fd8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import java.io.InputStream

final case class ValidationOptions(validateShapes: Boolean, reportDetails: Boolean, addBlankNodes: Boolean)
object ValidationOptions {
val default: ValidationOptions = ValidationOptions(true, true, false)
val default: ValidationOptions = ValidationOptions(false, true, false)
}

final case class ShaclValidator() { self =>
Expand All @@ -35,7 +35,7 @@ final case class ShaclValidator() { self =>
} yield report

private def readModel(data: InputStream) = ZIO.attempt {
val model = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM_RDFS_INF)
val model = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM)
model.read(data, null, FileUtils.langTurtle)
model
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,5 @@ object ShaclValidatorSpec extends ZIOSpecDefault {
reportResource <- shaclValidator(_.validate(validData, shapes, ValidationOptions.default))
} yield assertTrue(reportResource.hasProperty(SH.conforms, JenaDatatypes.TRUE))
},
test("should do basic rdfs inferencing") {
val data = """
|@prefix ex: <http://example.org/ns#> .
|@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
|ex:myProperty
| a rdf:Property.
|""".stripMargin
for {
reportResource <- shaclValidator(_.validate(data, "", ValidationOptions.default))
} yield assertTrue(reportResource.hasProperty(SH.conforms, JenaDatatypes.TRUE))
},
).provide(ShaclValidator.layer)
}

0 comments on commit a281fd8

Please sign in to comment.