123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252 |
- buildscript {
- repositories {
- mavenLocal()
- mavenCentral()
- }
- dependencies {
- classpath "io.opencaesar.owl:owl-fuseki-gradle:+"
- classpath "io.opencaesar.owl:owl-shacl-fuseki-gradle:+"
- classpath "io.opencaesar.owl:owl-query-gradle:+"
- classpath "io.opencaesar.owl:owl-load-gradle:+"
- classpath "io.opencaesar.owl:owl-reason-gradle:+"
- classpath "io.opencaesar.oml:oml-bikeshed-gradle:1.+"
- classpath "io.opencaesar.oml:oml-merge-gradle:1.+"
- classpath "io.opencaesar.adapters:oml2owl-gradle:1.+"
- }
- }
- plugins {
- id "java"
- id "maven-publish"
- id "eclipse"
- id "signing"
- }
- ext.title = "System Design Ontology - 2 Layers"
- description = "System design ontology considering only 2 layers (types and instances)."
- group = "be.ua"
- version = "1.0.0"
- ext {
- dataset = "SystemDesignOntology2Layers"
- rootIri = "http://ua.be/sdo2l/description/bundle"
- url = ""
- bikeshed = "build/bikeshed"
- }
- repositories {
- mavenLocal()
- mavenCentral()
- maven {
- //url "https://git.rys.one/api/v4/groups/dtdesign/-/packages/maven"
- url "https://git.rys.one/api/v4/projects/${System.getenv('CI_PROJECT_ID')}/packages/maven"
- name "Gitlab"
- credentials(HttpHeaderCredentials) {
- name = "Job-Token"
- value = System.getenv("CI_JOB_TOKEN")
- }
- authentication {
- header(HttpHeaderAuthentication)
- }
- }
- }
- configurations {
- oml
- }
- ext {
- //coreVersion = "3.+"
- metrologyVersion = "+"
- }
- dependencies {
- //oml "io.opencaesar.ontologies:core-vocabularies:$coreVersion"
- oml "io.opencaesar.ontologies:metrology-vocabularies:$metrologyVersion"
- }
- task downloadDependencies(type:io.opencaesar.oml.merge.OmlMergeTask, group:"oml") {
- inputZipPaths = configurations.oml.files
- outputCatalogFolder = file("build/oml")
- }
- task omlToBikeshed(type: io.opencaesar.oml.bikeshed.Oml2BikeshedTask, group:"oml", dependsOn: downloadDependencies) {
- inputCatalogPath = file("catalog.xml")
- inputCatalogTitle = project.title
- inputCatalogVersion = project.version
- rootOntologyIri = "$rootIri".toString()
- outputFolderPath = file("$bikeshed")
- publishUrl = "$url".toString()
- }
- task generateDocs(type: Exec, dependsOn: omlToBikeshed) {
- inputs.files(fileTree("$bikeshed").include("**/*.bs"))
- outputs.files(fileTree("$bikeshed").include("**/*.html"))
- if (org.gradle.internal.os.OperatingSystem.current().isWindows()) {
- commandLine "$bikeshed/publish.bat"
- } else {
- commandLine "$bikeshed/publish.sh"
- }
- }
- task omlToOwl(type:io.opencaesar.oml2owl.Oml2OwlTask, group:"oml", dependsOn: downloadDependencies) {
- // OML catalog
- inputCatalogPath = file("catalog.xml")
- // OWL catalog
- outputCatalogPath = file("build/owl/catalog.xml")
- }
- // A task to run the Openllet reasoner on the OWL catalog
- task owlReason(type:io.opencaesar.owl.reason.OwlReasonTask, group:"oml", dependsOn: omlToOwl) {
- // OWL catalog
- catalogPath = file("build/owl/catalog.xml")
- // Input ontology IRI to reason on
- inputOntologyIri = "$rootIri".toString()
- // Entailment statements to generate and the ontologies to persist them in
- specs = [
- "$rootIri/classes = ALL_SUBCLASS".toString(),
- "$rootIri/properties = INVERSE_PROPERTY | ALL_SUBPROPERTY".toString(),
- "$rootIri/individuals = ALL_INSTANCE | DATA_PROPERTY_VALUE | OBJECT_PROPERTY_VALUE | SAME_AS".toString()
- ]
- // Junit error report
- reportPath = file("build/reports/reasoning.xml")
- }
- task startFuseki(type: io.opencaesar.owl.fuseki.StartFusekiTask, group:"oml") {
- configurationPath = file(".fuseki.ttl")
- outputFolderPath = file(".fuseki")
- webUI = true
- }
- task stopFuseki(type: io.opencaesar.owl.fuseki.StopFusekiTask, group:"oml") {
- outputFolderPath = file(".fuseki")
- }
- task owlLoad(type:io.opencaesar.owl.load.OwlLoadTask, group:"oml", dependsOn: owlReason) {
- inputs.files(startFuseki.outputFolderPath) // rerun when fuseki restarts
- catalogPath = file("build/owl/catalog.xml")
- endpointURL = "https://fuseki.rys.app/$dataset".toString()
- fileExtensions = ["owl", "ttl"]
- iris = [
- "$rootIri/classes".toString(),
- "$rootIri/properties".toString(),
- "$rootIri/individuals".toString()
- ]
- }
- task owlQuery(type:io.opencaesar.owl.query.OwlQueryTask, group:"oml", dependsOn: owlLoad) {
- inputs.files(owlLoad.inputs.files) // rerun when the dataset changes
- endpointURL = "https://fuseki.rys.app/$dataset".toString()
- queryPath = file("src/sparql")
- resultPath = file("build/results")
- format = "json"
- }
- task owlShacl(type:io.opencaesar.owl.shacl.fuseki.OwlShaclFusekiTask, group:"oml", dependsOn: owlLoad) {
- inputs.files(owlLoad.inputs.files) // rerun when the dataset changes
- endpointURL = "https://fuseki.rys.app/$dataset".toString()
- queryPath = file("src/shacl")
- resultPath = file("build/reports")
- }
- build {
- group "oml"
- dependsOn owlReason
- }
- tasks.named("clean") {
- group "oml"
- }
- task omlZip(type: Zip, group:"oml") {
- from file("src/oml")
- include "**/*.oml"
- destinationDirectory = file("build/libs")
- archiveBaseName = project.name
- archiveVersion = project.version
- }
- def pomConfig = {
- licenses {
- license {
- name "The Apache Software License, Version 2.0"
- url "http://www.apache.org/licenses/LICENSE-2.0.txt"
- distribution "repo"
- }
- }
- developers {
- developer {
- id "uantwerp"
- name "University of Antwerp"
- email ""
- }
- }
- scm {
- url "https://msdl.uantwerpen.be/git/lucasalbertins/DTDesign/"
- }
- }
- publishing {
- publications {
- maven(MavenPublication) {
- groupId project.group
- artifactId project.name
- version project.version
- artifact omlZip
- pom {
- packaging = "zip"
- withXml {
- def root = asNode()
- if (configurations.find { it.name == "oml" }) {
- def dependencies = root.appendNode("dependencies")
- configurations.oml.resolvedConfiguration.resolvedArtifacts.each {
- def dependency = dependencies.appendNode("dependency")
- dependency.appendNode("groupId", it.moduleVersion.id.group)
- dependency.appendNode("artifactId", it.moduleVersion.id.name)
- dependency.appendNode("version", it.moduleVersion.id.version)
- if (it.classifier != null) {
- dependency.appendNode("classifier", it.classifier)
- dependency.appendNode("type", it.extension)
- }
- }
- }
- root.appendNode("name", project.ext.title)
- root.appendNode("description", project.description)
- root.appendNode("url", "https://msdl.uantwerpen.be/git/lucasalbertins/DTDesign/")
- root.children().last() + pomConfig
- }
- }
- }
- }
- repositories {
- maven {
- //url "https://git.rys.one/api/v4/groups/dtdesign/-/packages/maven"
- url "https://git.rys.one/api/v4/projects/${System.getenv('CI_PROJECT_ID')}/packages/maven"
- name "Gitlab"
- credentials(HttpHeaderCredentials) {
- name = "Job-Token"
- value = System.getenv("CI_JOB_TOKEN")
- }
- authentication {
- header(HttpHeaderAuthentication)
- }
- }
- }
- }
- //signing {
- // def pgpSigningKey = project.findProperty("pgpSigningKey")
- // if (pgpSigningKey != null) { pgpSigningKey = new String(pgpSigningKey.decodeBase64()) }
- // def pgpSigningPassword = project.findProperty("pgpSigningPassword")
- // useInMemoryPgpKeys(pgpSigningKey, pgpSigningPassword)
- // sign publishing.publications.maven
- //}
- //gradle.taskGraph.whenReady { taskGraph ->
- // signMavenPublication.onlyIf { taskGraph.allTasks.any{it.name == "publishMavenPublicationToGitlabRepository"} }
- //}
- eclipse {
- synchronizationTasks downloadDependencies
- }
|