|
@@ -3,7 +3,7 @@
|
|
|
*/
|
|
|
ext.title = 'Car Example'
|
|
|
description = 'This is a car example'
|
|
|
-group = 'com.example'
|
|
|
+group = 'one.rys.ontology'
|
|
|
version = '1.0.0'
|
|
|
|
|
|
/*
|
|
@@ -20,23 +20,32 @@ buildscript {
|
|
|
mavenCentral()
|
|
|
}
|
|
|
dependencies {
|
|
|
- classpath 'io.opencaesar.owl:owl-fuseki-gradle:+'
|
|
|
+ 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:+'
|
|
|
+ classpath 'io.opencaesar.oml:oml-bikeshed-gradle:1.+'
|
|
|
+ classpath 'io.opencaesar.oml:oml-merge-gradle:1.+'
|
|
|
+ classpath 'io.opencaesar.adapters:oml2owl-gradle:1.+'
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+/*
|
|
|
+ * Bikeshed folder
|
|
|
+ */
|
|
|
+ext {
|
|
|
+ bikeshed = 'build/bikeshed'
|
|
|
+}
|
|
|
+
|
|
|
/*
|
|
|
* Dataset-specific variables
|
|
|
*/
|
|
|
ext.dataset = [
|
|
|
// Name of dataset (matches one used in .fuseki.ttl file)
|
|
|
- name: 'car_example',
|
|
|
+ name: 'car',
|
|
|
// Root ontology IRI of the dataset
|
|
|
- rootOntologyIri: 'http://example.com/project/bundle',
|
|
|
+ rootOntologyIri: 'http://ontology.rys.one/project/vocabulary/bundle',
|
|
|
]
|
|
|
|
|
|
/*
|
|
@@ -68,6 +77,14 @@ dependencies {
|
|
|
oml "io.opencaesar.ontologies:core-vocabularies:$coreVersion"
|
|
|
}
|
|
|
|
|
|
+/*
|
|
|
+ * A task to extract and merge the OML dependencies
|
|
|
+ */
|
|
|
+task downloadDependencies(type:io.opencaesar.oml.merge.OmlMergeTask) {
|
|
|
+ inputZipPaths = configurations.oml.files
|
|
|
+ outputCatalogFolder = file('build/oml')
|
|
|
+}
|
|
|
+
|
|
|
/*
|
|
|
* A task to extract and merge the OML dependencies
|
|
|
*/
|
|
@@ -76,6 +93,40 @@ task omlDependencies(type:io.opencaesar.oml.merge.OmlMergeTask, group:"oml") {
|
|
|
outputCatalogFolder = file('build/oml')
|
|
|
}
|
|
|
|
|
|
+/*
|
|
|
+ * A task to generate Bikeshed specification for the OML catalog
|
|
|
+ */
|
|
|
+task omlToBikeshed(type: io.opencaesar.oml.bikeshed.Oml2BikeshedTask, dependsOn: downloadDependencies) {
|
|
|
+ // OML catalog
|
|
|
+ inputCatalogPath = file('catalog.xml')
|
|
|
+ // OML catalog title
|
|
|
+ inputCatalogTitle = project.title
|
|
|
+ // OML catalog version
|
|
|
+ inputCatalogVersion = project.version
|
|
|
+ // Input Ontology Iri
|
|
|
+ rootOntologyIri = 'http://ontology.rys.one/project/vocabulary/bundle'
|
|
|
+ // OWL folder
|
|
|
+ outputFolderPath = file("$bikeshed")
|
|
|
+ // Publish URL
|
|
|
+ publishUrl = 'https://git.rys.one/dtdesign/car-example'
|
|
|
+}
|
|
|
+
|
|
|
+/*
|
|
|
+ * A task to generate the model documentation in HTML
|
|
|
+ */
|
|
|
+import org.gradle.internal.os.OperatingSystem
|
|
|
+task generateDocs(dependsOn: omlToBikeshed) {
|
|
|
+ inputs.files(fileTree("$bikeshed").include('**/*.bs'))
|
|
|
+ outputs.files(fileTree("$bikeshed").include('**/*.html'))
|
|
|
+ doLast {
|
|
|
+ if (OperatingSystem.current().isWindows()) {
|
|
|
+ exec { commandLine "$bikeshed/publish.bat" }
|
|
|
+ } else {
|
|
|
+ exec { commandLine "$bikeshed/publish.sh" }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
/*
|
|
|
* A task to convert the OML catalog to OWL catalog
|
|
|
*/
|
|
@@ -143,6 +194,15 @@ task owlQuery(type:io.opencaesar.owl.query.OwlQueryTask, group:"oml", dependsOn:
|
|
|
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/reports')
|
|
|
+}
|
|
|
+
|
|
|
/*
|
|
|
* A task to build the project, which executes several tasks together
|
|
|
*/
|
|
@@ -178,13 +238,13 @@ def pomConfig = {
|
|
|
}
|
|
|
developers {
|
|
|
developer {
|
|
|
- id "melaasar"
|
|
|
- name "Maged Elaasar"
|
|
|
- email "melaasar@gmail.com"
|
|
|
+ id "arrys"
|
|
|
+ name "Arkadiusz Michał Ryś"
|
|
|
+ email "Arkadiusz.Michal.Rys@gmail.com"
|
|
|
}
|
|
|
}
|
|
|
scm {
|
|
|
- url 'https://github.com/opencaesar/'+rootProject.name
|
|
|
+ url 'https://git.rys.one/dtdesign/car-example'
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -214,7 +274,7 @@ publishing {
|
|
|
}
|
|
|
root.appendNode('name', project.ext.title)
|
|
|
root.appendNode('description', project.description)
|
|
|
- root.appendNode('url', 'https://github.com/opencaesar/'+rootProject.name)
|
|
|
+ root.appendNode('url', 'https://git.rys.one/dtdesign/car-example')
|
|
|
root.children().last() + pomConfig
|
|
|
}
|
|
|
}
|