-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
211 lines (189 loc) · 6.47 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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
/*
* Dataset maven coordinates
*/
ext.title = 'Metrology Vocabularies'
description ='Metrology vocabularies from bipm.org, iso/iec iso-80000, and supporting ISO-704, ISO-1087 terminological analysis'
group = 'io.opencaesar.ontologies'
version = '7.1.0'
apply from: "${rootDir}/gradle/maven-deployment.gradle"
/*
* 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-doc-gradle:2.+'
classpath 'io.opencaesar.owl:owl-query-gradle:2.+'
classpath 'io.opencaesar.oml:oml-merge-gradle:2.+'
classpath 'io.opencaesar.adapters:oml2owl-gradle:2.+'
}
}
/*
* 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, group:"oml") {
inputZipPaths = configurations.oml.files
outputCatalogFolder = file('build/oml')
}
/*
* A task to convert the OML catalog to OWL catalog
* downloadDependencies is excluded because it does not behave incrementally.
*/
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')
outputFileExtension = 'owl'
}
task owlReasonIso80000(type:io.opencaesar.owl.reason.OwlReasonTask, dependsOn: omlToOwl) {
// OWL catalog
catalogPath = file('build/owl/catalog.xml')
// Input ontology IRI to reason on
inputOntologyIri = 'http://iso.org/iso-80000-bundle'
// Entailment statements to generate and the ontologies to persist them in
specs = [
'http://iso.org/iso-80000-bundle/classes = ALL_SUBCLASS',
'http://iso.org/iso-80000-bundle/properties = INVERSE_PROPERTY | ALL_SUBPROPERTY',
'http://iso.org/iso-80000-bundle/individuals = ALL_INSTANCE | DATA_PROPERTY_VALUE | OBJECT_PROPERTY_VALUE | SAME_AS'
]
// Junit error report
reportPath = file('build/reports/owl/iso-80000-bundle/reasoning.xml')
}
task owlReasonVIM4(type:io.opencaesar.owl.reason.OwlReasonTask, dependsOn: omlToOwl) {
// OWL catalog
catalogPath = file('build/owl/catalog.xml')
// Input ontology IRI to reason on
inputOntologyIri = 'http://bipm.org/jcgm/jcgm-bundle'
// Entailment statements to generate and the ontologies to persist them in
specs = [
'http://bipm.org/jcgm/jcgm-bundle/classes = ALL_SUBCLASS',
'http://bipm.org/jcgm/jcgm-bundle/properties = INVERSE_PROPERTY | ALL_SUBPROPERTY',
'http://bipm.org/jcgm/jcgm-bundle/individuals = ALL_INSTANCE | DATA_PROPERTY_VALUE | OBJECT_PROPERTY_VALUE | SAME_AS'
]
// Junit error report
reportPath = file('build/reports/owl/jcgm-bundle/reasoning.xml')
}
task owlReasonCompleteDescription(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/complete-description-bundle'
// Entailment statements to generate and the ontologies to persist them in
specs = [
'http://example.org/complete-description-bundle/classes = ALL_SUBCLASS',
'http://example.org/complete-description-bundle/properties = INVERSE_PROPERTY | ALL_SUBPROPERTY',
'http://example.org/complete-description-bundle/individuals = ALL_INSTANCE | DATA_PROPERTY_VALUE | OBJECT_PROPERTY_VALUE | SAME_AS'
]
// Junit error report
reportPath = file('build/reports/owl/complete-description-bundle/reasoning.xml')
}
/*
* A task to generate documentation for the OWL catalog
*/
task generateDocs (type: io.opencaesar.owl.doc.OwlDocTask, dependsOn: build) {
// OWL catalog
inputCatalogPath = file('build/owl/catalog.xml')
// OWL catalog title
inputCatalogTitle = project.title
// OWL catalog version
inputCatalogVersion = project.version
// Output folder
outputFolderPath = file('build/docs')
// Output case sensitivie path
outputCaseSensitive = org.gradle.internal.os.OperatingSystem.current().isLinux()
}
/*
* Start the headless Fuseki server
*/
task startFuseki(type: io.opencaesar.owl.fuseki.StartFusekiTask, group:"oml") {
configurationPath = file('.fuseki.ttl')
outputFolderPath = file('.fuseki')
webUI = true
}
/*
* Stop the headless Fuseki server
*/
task stopFuseki(type: io.opencaesar.owl.fuseki.StopFusekiTask, group:"oml") {
outputFolderPath = file('.fuseki')
}
/*
* A task to load the iso80000 dataset to a Fuseki dataset endpoint
*/
task owlLoadCompleteDescription(type:io.opencaesar.owl.load.OwlLoadTask, group:"oml", dependsOn: owlReasonCompleteDescription) {
inputs.files(startFuseki.outputFolderPath) // rerun when fuseki restarts
catalogPath = file('build/owl/catalog.xml')
endpointURL = "http://localhost:3030/metrology-vocabularies".toString()
fileExtensions = ['owl', 'ttl']
iris = [
'http://example.org/complete-description-bundle/classes',
'http://example.org/complete-description-bundle/properties',
'http://example.org/complete-description-bundle/individuals',
]
}
/*
* 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: owlLoadCompleteDescription) {
endpointURL = "http://localhost:3030/metrology-vocabularies".toString()
queryPath = file('src/sparql')
resultPath = file('build/frames')
}
/*
* A task to build the project, which executes several tasks together
*/
tasks.named('build') {
group "oml"
dependsOn owlReasonIso80000
dependsOn owlReasonVIM4
}
/*
* 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
}