-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
166 lines (149 loc) · 4.51 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
/*
* Dataset maven coordinates
*/
ext.title = 'Provenance Vocabularies'
description = 'Provenance vocabularies from http://www.w3.org/ns/prov'
group ='io.opencaesar.ontologies'
version = '4.1.0'
/*
* The Gradle task dependencies
*/
buildscript {
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
classpath 'io.opencaesar.owl:owl-load-gradle:2.+'
classpath 'io.opencaesar.owl:owl-reason-gradle:2.+'
classpath 'io.opencaesar.owl:owl-fuseki:2.+'
classpath 'io.opencaesar.owl:owl-fuseki-gradle:2.+'
classpath 'io.opencaesar.owl:owl-query-gradle:2.+'
classpath 'io.opencaesar.owl:owl-doc-gradle:2.+'
classpath 'io.opencaesar.oml:oml-merge-gradle:2.+'
classpath 'io.opencaesar.adapters:oml2owl-gradle:2.+'
}
}
apply from: "${rootDir}/gradle/maven-deployment.gradle"
// Dataset-specific variables
ext {
// Name of dataset (matches one used in .fuseki.ttl file)
dataset = 'provenance-vocabularies'
// Root Ontology Iri
rootIri = 'http://www.w3.org/ns/prov-bundle'
}
/*
* The repositories to look up OML dependencies in
*/
repositories {
mavenLocal()
mavenCentral()
}
/*
* The configuration of OML dependencies
*/
configurations {
oml
}
/*
* The OML dependencies
*/
dependencies {
oml "io.opencaesar.ontologies:core-vocabularies:5.+"
}
/*
* 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 convert the OML catalog to OWL catalog
*/
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 owlReasonProvenance(type:io.opencaesar.owl.reason.OwlReasonTask, 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/provenance-bundle/reasoning.xml')
}
task owlReasonExamples(type:io.opencaesar.owl.reason.OwlReasonTask, dependsOn: omlToOwl) {
// OWL catalog
catalogPath = file('build/owl/catalog.xml')
// Input ontology IRI to reason on
inputOntologyIri = 'http://example.org/examples-bundle'
// Entailment statements to generate and the ontologies to persist them in
specs = [
'http://example.org/examples-bundle/classes = ALL_SUBCLASS',
'http://example.org/examples-bundle/properties = INVERSE_PROPERTY | ALL_SUBPROPERTY',
'http://example.org/examples-bundle/individuals = ALL_INSTANCE | DATA_PROPERTY_VALUE | OBJECT_PROPERTY_VALUE | SAME_AS'
]
// Junit error report
reportPath = file('build/reports/examples-bundle/reasoning.xml')
}
/*
* A task to generate documentation for the OWL catalog
*/
task generateDocs (type: io.opencaesar.owl.doc.OwlDocTask, dependsOn: owlReasonProvenance) {
// OWL catalog
inputCatalogPath = file('build/owl/catalog.xml')
// OWL catalog title
inputCatalogTitle = project.title
// OWL catalog version
inputCatalogVersion = project.version
// OWL Ontology Iris
inputOntologyIris = [ "$rootIri/classes", "$rootIri/properties", "$rootIri/individuals" ]
// Output folder
outputFolderPath = file('build/docs')
// Output case sensitivie path
outputCaseSensitive = org.gradle.internal.os.OperatingSystem.current().isLinux()
}
/*
* A task to build the project, which executes several tasks together
*/
tasks.named('build') {
group "oml"
dependsOn owlReasonProvenance
dependsOn owlReasonExamples
}
/*
* A task to delete the build artifacts
*/
tasks.named('clean') {
group "oml"
}
/*
* Publish artifact to maven
*/
task omlZip(type: Zip, group:"oml") {
from file('src/main/oml')
include "**/*.oml"
destinationDirectory = file('build/libs')
archiveBaseName = project.name
archiveVersion = project.version
}
publishing.publications.maven.artifact omlZip
/*
* Integration with the Eclipse IDE
*/
apply plugin: 'eclipse'
eclipse {
synchronizationTasks downloadDependencies
}