Skip to content

Commit

Permalink
update gradle script
Browse files Browse the repository at this point in the history
  • Loading branch information
melaasar committed Nov 15, 2024
1 parent 8122139 commit f509313
Showing 1 changed file with 38 additions and 26 deletions.
64 changes: 38 additions & 26 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ buildscript {
classpath "org.yaml:snakeyaml:2.+"
classpath "io.opencaesar.owl:owl-fuseki-gradle:$owl"
classpath "io.opencaesar.owl:owl-query-gradle:$owl"
classpath "io.opencaesar.owl:owl-shacl-gradle:$owl"
classpath "io.opencaesar.owl:owl-load-gradle:$owl"
classpath "io.opencaesar.owl:owl-save-gradle:$owl"
classpath "io.opencaesar.owl:owl-reason-gradle:$owl"
classpath "io.opencaesar.owl:owl-doc-gradle:$owl"
classpath "io.opencaesar.oml:oml-merge-gradle:$oml"
classpath "io.opencaesar.adapters:oml2owl-gradle:$oml"
classpath "io.opencaesar.adapters:owl2oml-gradle:$oml"
Expand Down Expand Up @@ -75,6 +77,23 @@ task omlToOwl(type:io.opencaesar.oml2owl.Oml2OwlTask, group:"oml", dependsOn: do
generateRules = true
}

/*
* A task to generate documentation for the OWL catalog
* @seeAlso https://github.com/opencaesar/owl-tools/blob/master/owl-doc/README.md
*/
task generateDocs (type: io.opencaesar.owl.doc.OwlDocTask, dependsOn: omlToOwl) {
// OML catalog
inputCatalogPath = file('build/owl/catalog.xml')
// OML catalog title
inputCatalogTitle = oml.project.title
// OML catalog version
inputCatalogVersion = oml.project.version
// Output folder
outputFolderPath = file('build/docs')
// Output case sensitivie path
outputCaseSensitive = org.gradle.internal.os.OperatingSystem.current().isLinux()
}

/*
* A task to run the Openllet reasoner on the OWL catalog
* @seeAlso https://github.com/opencaesar/owl-tools/blob/master/owl-reason/README.md
Expand All @@ -87,7 +106,7 @@ task reason(type:io.opencaesar.owl.reason.OwlReasonTask, group:"oml", dependsOn:
"$oml.dataset.iri/properties = INVERSE_PROPERTY | ALL_SUBPROPERTY",
"$oml.dataset.iri/individuals = ALL_INSTANCE | DATA_PROPERTY_VALUE | OBJECT_PROPERTY_VALUE | SAME_AS"
]
reportPath = file('build/logs/reasoning.xml')
reportPath = file("build/logs/${oml.dataset.name}/reasoning.xml")
uniqueNames = true
}

Expand All @@ -113,51 +132,44 @@ task stopFuseki(type: io.opencaesar.owl.fuseki.StopFusekiTask, group:"oml") {
* A task to load the dataset to a SPARQL tdb endpoint
* @seeAlso https://github.com/opencaesar/owl-tools/blob/master/owl-load/README.md
*/
task loadTdb(type:io.opencaesar.owl.load.OwlLoadTask, group:"oml", dependsOn: startFuseki) {
inputs.files(startFuseki.outputFolderPath.toString()+"fuseki.pid") // rerun when fuseki restarts
task load(type:io.opencaesar.owl.load.OwlLoadTask, group:"oml", dependsOn: startFuseki) {
inputs.files(startFuseki.outputFolderPath) // rerun when fuseki restarts
catalogPath = file('build/owl/catalog.xml')
endpointURL = oml.dataset.url+".tdb"
endpointURL = oml.dataset.url
fileExtensions = ['owl', 'ttl']
iris = [ "$oml.dataset.iri" ]
iris = [ "$oml.dataset.iri/classes", "$oml.dataset.iri/properties", "$oml.dataset.iri/individuals" ]
loadToDefaultGraph = false
}

/*
* A task to load the dataset to a SPARQL inference endpoint
* @seeAlso https://github.com/opencaesar/owl-tools/blob/master/owl-load/README.md
*/
task loadInf(type:io.opencaesar.owl.load.OwlLoadTask, group:"oml", dependsOn: startFuseki) {
inputs.files(startFuseki.outputFolderPath.toString()+"fuseki.pid") // rerun when fuseki restarts
catalogPath = file('build/owl/catalog.xml')
endpointURL = oml.dataset.url+".inf"
fileExtensions = ['owl', 'ttl']
iris = [ "$oml.dataset.iri/classes", "$oml.dataset.iri/properties" ]
loadToDefaultGraph = true
}

/*
* A task to load the dataset to SPARQL endpoints
*/
task load(group:"oml", dependsOn: [loadInf, loadTdb])

/*
* A task to run a set of SPARQL queries on a Fuseki dataset endpoint
* @seeAlso https://github.com/opencaesar/owl-tools/blob/master/owl-query/README.md
*/
task query(type:io.opencaesar.owl.query.OwlQueryTask, group:"oml", dependsOn: load) {
inputs.files(load.inputs.files) // rerun when the dataset changes
endpointURL = oml.dataset.url+".inf"
endpointURL = oml.dataset.url
queryPath = file(oml.dataset.queries)
resultPath = file("build/results/${oml.dataset.name}")
format = 'json'
}

/*
* A task to run a set of SHACL validation rules on a dataset endpoint
* @seeAlso https://github.com/opencaesar/owl-tools/blob/master/owl-shacl/README.md
*/
task validate(type:io.opencaesar.owl.shacl.OwlShaclTask, group:"oml", dependsOn: load) {
inputs.files(load.inputs.files) // rerun when the dataset changes
endpointURL = oml.dataset.url
queryPath = file(oml.dataset.validations)
resultPath = file("build/logs/${oml.dataset.name}")
}

/*
* A task to save a Fuseki dataset to an OWL catalog
* @seeAlso https://github.com/opencaesar/owl-tools/blob/master/owl-save/README.md
*/
task saveTdb(type:io.opencaesar.owl.save.OwlSaveTask, group:"oml") {
inputs.files(startFuseki.outputFolderPath.toString()+"fuseki.pid") // rerun when fuseki restarts
inputs.files(startFuseki.outputFolderPath) // rerun when fuseki restarts
endpointURL = oml.dataset.url+".tdb"
catalogPath = file("build/save/${oml.dataset.name}/catalog.xml")
fileExtension = 'ttl'
Expand Down Expand Up @@ -280,4 +292,4 @@ apply plugin: 'eclipse'

eclipse {
synchronizationTasks downloadDependencies
}
}

0 comments on commit f509313

Please sign in to comment.