Skip to content

Commit

Permalink
Oml v2 (#8)
Browse files Browse the repository at this point in the history
* convert to oml v2

* upgrade to oml v2

* migrate to oml 2

* upgrade to oml 2
  • Loading branch information
melaasar authored May 31, 2023
1 parent d8012ec commit c274bc4
Show file tree
Hide file tree
Showing 8 changed files with 154 additions and 196 deletions.
4 changes: 2 additions & 2 deletions .deploy/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ cd ..
# Clean out existing contents
rm -rf publish/**/* || exit 0

cd ${SCRIPT_PATH}/../build/bikeshed
find . -name '*.html' -exec cp --parents {} ${SCRIPT_PATH}/publish/ \;
cd ${SCRIPT_PATH}/../build/doc
find . -name '*' -exec cp --parents {} ${SCRIPT_PATH}/publish/ \;
cd ${SCRIPT_PATH}

# Now let's go have some fun with the cloned repo
Expand Down
6 changes: 0 additions & 6 deletions .gitpod.yml

This file was deleted.

22 changes: 5 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,13 @@
sudo: false

language: python

python:
- "3.7"

services:
- xvfb

before_install:
- sudo apt-get install graphviz

install:
- pip3 install bikeshed && bikeshed update
language: java

jdk:
- openjdk17

cache:
directories:
- $HOME/.gradle

script:
- ./gradlew buildEnvironment
- ./gradlew build generateDocs --refresh-dependencies

env:
Expand All @@ -32,7 +20,7 @@ deploy:
script: .deploy/deploy.sh
skip_cleanup: true
on:
tags: false
tags: true
branch: master
- provider: script
script: ./gradlew publish
Expand Down
87 changes: 34 additions & 53 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@
ext.title = "IMCE Vocabularies"
description='The set of IMCE vocabularies'
group = 'io.opencaesar.ontologies'
version = '3.2.1'

/*
* Properties
*/
ext.bikeshed = 'build/bikeshed'
version = '4.0.0'

apply from: "${rootDir}/gradle/maven-deployment.gradle"

Expand All @@ -22,13 +17,19 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'io.opencaesar.owl:owl-reason-gradle:1.+'
classpath 'io.opencaesar.adapters:oml2owl-gradle:1.+'
classpath 'io.opencaesar.oml:oml-bikeshed-gradle:1.+'
classpath 'io.opencaesar.oml:oml-merge-gradle:1.+'
classpath 'io.opencaesar.owl:owl-reason-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.+'
}
}

// Dataset-specific variables
ext {
// Root ontology IRI of the dataset
rootIri = 'http://imce.jpl.nasa.gov/foundation/bundle'
}

/*
* The repositories to look up OML dependencies in
*/
Expand All @@ -44,18 +45,11 @@ configurations {
oml
}

/*
* Dependency versions
*/
ext {
metrologyVersion = '5.+'
}

/*
* The OML dependencies
*/
dependencies {
oml "io.opencaesar.ontologies:metrology-vocabularies:$metrologyVersion"
oml "io.opencaesar.ontologies:metrology-vocabularies:6.+"
}

/*
Expand All @@ -66,37 +60,6 @@ task downloadDependencies(type:io.opencaesar.oml.merge.OmlMergeTask) {
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
// Root ontology IRI
rootOntologyIri='http://imce.jpl.nasa.gov/foundation/bundle'
// OWL folder
outputFolderPath = file("$bikeshed")
// Publish URL
publishUrl = 'https://opencaesar.github.io/imce-vocabularies/'
}

/*
* A task to render the Bikeshed specification to HTML
*/
task generateDocs(type: Exec, dependsOn: omlToBikeshed) {
inputs.files(fileTree("$bikeshed").include('**/*.bs'))
outputs.files(fileTree("$bikeshed").include('**/*.html'))
if (org.gradle.internal.os.OperatingSystem.current().isWindows()) {
commandLine "$bikeshed/publish.bat"
} else {
commandLine "$bikeshed/publish.sh"
}
}

/*
* A task to convert the OML catalog to OWL catalog
*/
Expand All @@ -114,17 +77,35 @@ task owlReason(type:io.opencaesar.owl.reason.OwlReasonTask, dependsOn: omlToOwl)
// OWL catalog
catalogPath = file('build/owl/catalog.xml')
// Input ontology IRI to reason on
inputOntologyIri = 'http://imce.jpl.nasa.gov/foundation/bundle'
inputOntologyIri = "$rootIri"
// Entailment statements to generate and the ontologies to persist them in
specs = [
'http://imce.jpl.nasa.gov/foundation/bundle/classes = ALL_SUBCLASS',
'http://imce.jpl.nasa.gov/foundation/bundle/properties = INVERSE_PROPERTY | ALL_SUBPROPERTY',
'http://imce.jpl.nasa.gov/foundation/bundle/individuals = ALL_INSTANCE | DATA_PROPERTY_VALUE | OBJECT_PROPERTY_VALUE | SAME_AS'
"$rootIri/classes = ALL_SUBCLASS",
"$rootIri/properties = INVERSE_PROPERTY | ALL_SUBPROPERTY",
"$rootIri/individuals = ALL_INSTANCE | DATA_PROPERTY_VALUE | OBJECT_PROPERTY_VALUE | SAME_AS"
]
// Junit error report
reportPath = file('build/reports/reasoning.xml')
}

/*
* A task to generate documentation for the OWL catalog
*/
task generateDocs (type: io.opencaesar.owl.doc.OwlDocTask, dependsOn: owlReason) {
// 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/doc')
// Output case sensitivie path
outputCaseSensitive = org.gradle.internal.os.OperatingSystem.current().isLinux()
}

/*
* A task to build the project, which executes several tasks together
*/
Expand Down
Loading

0 comments on commit c274bc4

Please sign in to comment.