-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update main repo jobs for the category system
Dumps for now do not include categories, profiles, and tasks. This will be fixed in the next commit.
- Loading branch information
1 parent
bc19a96
commit 29f8815
Showing
7 changed files
with
56 additions
and
243 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
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package io.github.riverbench.ci_worker | ||
package util.collection | ||
|
||
import org.apache.jena.rdf.model.Model | ||
import org.apache.jena.riot.RDFDataMgr | ||
|
||
object CategoryCollection: | ||
def fromReleases(names: Iterable[String], version: String): CategoryCollection = | ||
val categories = names.map { name => | ||
if version == "latest" then | ||
(name, s"https://github.com/RiverBench/category-$name/releases/latest/download/metadata.ttl") | ||
else | ||
(name, s"https://github.com/RiverBench/category-$name/releases/download/$version/metadata.ttl") | ||
} | ||
CategoryCollection(categories) | ||
|
||
class CategoryCollection(namesToUris: Iterable[(String, String)]): | ||
val categories: Map[String, Model] = namesToUris | ||
.map((name, uri) => { | ||
try { | ||
(name, RDFDataMgr.loadModel(uri)) | ||
} | ||
catch { | ||
case e: Exception => | ||
println(f"Failed to load metadata for category $name from $uri") | ||
throw e | ||
} | ||
}) | ||
.toMap |
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
4 changes: 3 additions & 1 deletion
4
src/main/scala/util/ProfileCollection.scala → ...a/util/collection/ProfileCollection.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