Skip to content

Commit

Permalink
Update SHACL publishing for more shape files
Browse files Browse the repository at this point in the history
  • Loading branch information
Ostrzyciel committed Dec 13, 2023
1 parent c61d49a commit f27f615
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main/scala/commands/PackageSchemaCommand.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ object PackageSchemaCommand extends Command:
val outDir = FileSystems.getDefault.getPath(args(3))
val docOutDir = FileSystems.getDefault.getPath(args(4))

val toProcessNames = Seq("metadata", "documentation", "dataset-shacl", "theme")
val toProcessNames = Seq("metadata", "documentation", "theme") ++
repoDir.resolve("src/shacl").toFile.listFiles()
.filter(f => f.isFile && f.getName.endsWith(".ttl"))
.map(f => "shacl/" + f.getName.replace(".ttl", ""))
val schemaBase = AppConfig.CiWorker.rbRootUrl + "schema/"

outDir.toFile.mkdirs()
Expand Down Expand Up @@ -65,7 +68,8 @@ object PackageSchemaCommand extends Command:
prepOntologyForDoc(model, name, docOutDir)

for (ext, format) <- Constants.outputFormats do
val outPath = outDir.resolve(s"$name.$ext")
val newName = if name.contains("shacl/") then name.replace("shacl/", "") + "-shacl" else name
val outPath = outDir.resolve(s"$newName.$ext")
RDFDataMgr.write(new FileOutputStream(outPath.toFile), model, format)
}

Expand Down

0 comments on commit f27f615

Please sign in to comment.