From 59a6f8c5c52866fdaf51156774392cb006e9822c Mon Sep 17 00:00:00 2001 From: Jesse Wright <63333554+jeswr@users.noreply.github.com> Date: Fri, 22 Mar 2024 22:42:44 +0000 Subject: [PATCH 1/2] Update Shacl2ShEx.scala --- .../src/main/scala/es/weso/shacl/converter/Shacl2ShEx.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/converter/src/main/scala/es/weso/shacl/converter/Shacl2ShEx.scala b/modules/converter/src/main/scala/es/weso/shacl/converter/Shacl2ShEx.scala index 7fb237d3..660f214e 100644 --- a/modules/converter/src/main/scala/es/weso/shacl/converter/Shacl2ShEx.scala +++ b/modules/converter/src/main/scala/es/weso/shacl/converter/Shacl2ShEx.scala @@ -204,7 +204,7 @@ object Shacl2ShEx extends LazyLogging { case class PredicateInverse(pred: IRI, inverse: Option[Boolean]) private def getMinComponent(components: List[shacl.Component]): Result[Option[Int]] = { - ok(components.collect { case shacl.MinCount(m) => m }.headOption) + ok(option(components.collect { case shacl.MinCount(m) => m }.headOption.getOrElse(0))) } private def getMaxComponent(components: List[shacl.Component]): Result[Option[shex.Max]] = { From 53bbe7efaf2372dd16ee7036eaf782cd1d7fcb4d Mon Sep 17 00:00:00 2001 From: Jesse Wright <63333554+jeswr@users.noreply.github.com> Date: Tue, 26 Mar 2024 16:35:10 +0000 Subject: [PATCH 2/2] Update Shacl2ShEx.scala --- .../src/main/scala/es/weso/shacl/converter/Shacl2ShEx.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/converter/src/main/scala/es/weso/shacl/converter/Shacl2ShEx.scala b/modules/converter/src/main/scala/es/weso/shacl/converter/Shacl2ShEx.scala index 660f214e..044067f0 100644 --- a/modules/converter/src/main/scala/es/weso/shacl/converter/Shacl2ShEx.scala +++ b/modules/converter/src/main/scala/es/weso/shacl/converter/Shacl2ShEx.scala @@ -204,11 +204,11 @@ object Shacl2ShEx extends LazyLogging { case class PredicateInverse(pred: IRI, inverse: Option[Boolean]) private def getMinComponent(components: List[shacl.Component]): Result[Option[Int]] = { - ok(option(components.collect { case shacl.MinCount(m) => m }.headOption.getOrElse(0))) + ok(Some(components.collect { case shacl.MinCount(m) => m }.headOption.getOrElse(0))) } private def getMaxComponent(components: List[shacl.Component]): Result[Option[shex.Max]] = { - ok(components.collect { case shacl.MaxCount(m) => shex.IntMax(m) }.headOption) + ok(Some(components.collect { case shacl.MaxCount(m) => shex.IntMax(m) }.headOption.getOrElse(shex.Star))) } // TODO: Conversion of components like BlankNodeOrIRI is ignored by now