-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
71 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
modules/schema/src/main/scala/es/weso/schema/RDFReport.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package es.weso.schema | ||
|
||
import es.weso.rdf.RDFBuilder | ||
import es.weso.shacl.report.ValidationReport | ||
import cats.effect._ | ||
import cats.implicits._ | ||
import es.weso.rdf.jena.RDFAsJenaModel | ||
import org.apache.jena.rdf.model.Model | ||
|
||
sealed abstract class RDFReport extends Product with Serializable { | ||
def toRDF(builder: RDFBuilder): IO[RDFBuilder] | ||
} | ||
|
||
case object EmptyReport extends RDFReport { | ||
override def toRDF(builder: RDFBuilder) = builder.pure[IO] | ||
} | ||
|
||
case class ShaclexReport(vr: ValidationReport) extends RDFReport { | ||
override def toRDF(builder: RDFBuilder) = vr.toRDF(builder) | ||
} | ||
|
||
case class JenaShaclReport(model: Model) extends RDFReport { | ||
override def toRDF(builder: RDFBuilder) = builder match { | ||
case rdfJena: RDFAsJenaModel => RDFAsJenaModel.fromModel(model).flatMap(m => rdfJena.merge(m)) | ||
case _ => IO.raiseError(new RuntimeException(s"Builder in JenaShaclReport.toRDF must be RDFAsJenaModel")) | ||
} | ||
} | ||
|
||
object RDFReport { | ||
def empty: RDFReport = EmptyReport | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
version in ThisBuild := "0.1.66" | ||
version in ThisBuild := "0.1.67" |