123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250 |
- /*
- * The Maven coordinates for the project artifact
- */
- ext.title = 'System Design Ontology - 2 Layers'
- description = 'System design ontology considering only 2 layers (types and instances).'
- group = 'be.com.ua'
- version = '1.0.0'
- /*
- * The Gradle plugins
- */
- apply plugin: 'maven-publish'
- /*
- * The Gradle task dependencies
- */
- 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-merge-gradle:+'
- classpath 'io.opencaesar.adapters:oml2owl-gradle:+'
- }
- }
- /*
- * Dataset-specific variables
- */
- ext.dataset = [
- // Name of dataset (matches one used in .fuseki.ttl file)
- name: 'SystemDesignOntology2Layers',
- // Root ontology IRI of the dataset
- rootOntologyIri: 'http://ua.com.be/sdo2l/description/bundle',
- ]
- /*
- * The repositories to look up OML dependencies in
- */
- repositories {
- mavenLocal()
- mavenCentral()
- }
- /*
- * The configuration of OML dependencies
- */
- configurations {
- oml
- }
- /*
- * Dependency versions
- */
- ext {
- //coreVersion = '+'
- metrologyVersion = '+'
- }
- /*
- * The OML dependencies
- */
- dependencies {
- //oml "io.opencaesar.ontologies:core-vocabularies:$coreVersion"
- oml "io.opencaesar.ontologies:metrology-vocabularies:$metrologyVersion"
- }
- /*
- * A task to extract and merge the OML dependencies
- */
- task omlDependencies(type:io.opencaesar.oml.merge.OmlMergeTask, group:"oml") {
- inputZipPaths = configurations.oml.files
- outputCatalogFolder = file('build/oml')
- }
- /*
- * A task to convert the OML catalog to OWL catalog
- */
- task omlToOwl(type:io.opencaesar.oml2owl.Oml2OwlTask, group:"oml", dependsOn: omlDependencies) {
- // 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 = "$dataset.rootOntologyIri".toString()
- // Entailment statements to generate and the ontologies to persist them in
- specs = [
- "$dataset.rootOntologyIri/classes = ALL_SUBCLASS".toString(),
- "$dataset.rootOntologyIri/properties = INVERSE_PROPERTY | ALL_SUBPROPERTY".toString(),
- "$dataset.rootOntologyIri/individuals = ALL_INSTANCE | DATA_PROPERTY_VALUE | OBJECT_PROPERTY_VALUE | SAME_AS".toString()
- ]
- // Junit error report
- reportPath = file('build/reports/reasoning.xml')
- }
- /*
- * Start the headless Fuseki server
- */
- task startFuseki(type: io.opencaesar.owl.fuseki.StartFusekiTask, group:"oml") {
- configurationPath = file('.fuseki.ttl')
- outputFolderPath = file('.fuseki')
- }
- /*
- * Stop the headless Fuseki server
- */
- task stopFuseki(type: io.opencaesar.owl.fuseki.StopFusekiTask, group:"oml") {
- outputFolderPath = file('.fuseki')
- }
- /*
- * A task to load an OWL catalog to a Fuseki dataset endpoint
- */
- task owlLoad(type:io.opencaesar.owl.load.OwlLoadTask, group:"oml", dependsOn: owlReason) {
- catalogPath = file('build/owl/catalog.xml')
- endpointURL = "http://localhost:3030/$dataset.name".toString()
- fileExtensions = ['owl', 'ttl']
- iris = [
- "$dataset.rootOntologyIri/classes".toString(),
- "$dataset.rootOntologyIri/properties".toString(),
- "$dataset.rootOntologyIri/individuals".toString()
- ]
- }
- /*
- * A task to run a set of SPARQL queries on a Fuseki dataset endpoint
- */
- task owlQuery(type:io.opencaesar.owl.query.OwlQueryTask, group:"oml", dependsOn: owlLoad) {
- endpointURL = "http://localhost:3030/$dataset.name".toString()
- queryPath = file('src/sparql')
- resultPath = file('build/results')
- format = 'json'
- }
- /*
- * A task to run a set of SHACL validation rules on a Fuseki dataset endpoint
- */
- task owlShacl(type:io.opencaesar.owl.shacl.fuseki.OwlShaclFusekiTask, group:"oml", dependsOn: owlLoad) {
- endpointURL = "http://localhost:3030/$dataset.name".toString()
- queryPath = file('src/shacl')
- resultPath = file('build/results')
- }
- /*
- * A task to build the project, which executes several tasks together
- */
- task build(group: "oml") {
- dependsOn owlReason
- }
- /*
- * A task to delete the build artifacts
- */
- task clean(type: Delete, group: "oml") {
- delete 'build'
- }
- /*
- * Publish artifact to maven
- */
- 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 "melaasar"
- name "Maged Elaasar"
- email "melaasar@gmail.com"
- }
- }
- scm {
- url 'https://github.com/opencaesar/'+rootProject.name
- }
- }
- 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://github.com/opencaesar/'+rootProject.name)
- root.children().last() + pomConfig
- }
- }
- }
- }
- }
- tasks.named('wrapper') {
- gradleVersion = '6.5.1' //version required
- }
- /*
- * Integration with the Eclipse IDE
- */
- apply plugin: 'eclipse'
- eclipse {
- synchronizationTasks omlDependencies
- }
|