Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OML document templates #16

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
build
.DS_Store
.idea

# Fuseki output directory
.fuseki
src-gen
105 changes: 103 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'io.opencaesar.owl:owl-doc-gradle:+'
classpath 'io.opencaesar.owl:owl-fuseki-gradle:+'
classpath 'io.opencaesar.owl:owl-shacl-fuseki-gradle:+'
classpath 'io.opencaesar.owl:owl-query-gradle:+'
Expand All @@ -29,6 +30,9 @@ buildscript {
classpath 'io.opencaesar.oml:oml-merge-gradle:0.8.+'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:+'
// needed since gradle-bintray-plugin brings an old version of xerces
classpath 'io.opencaesar.docbook:docbook-generator-gradle:+'
classpath 'io.opencaesar.docbook:docbook-renderer-gradle:+'
// needed since gradle bintray brings an old version of xerces
configurations.classpath.exclude group: 'xerces', module: 'xercesImpl'
}
}
Expand All @@ -44,7 +48,8 @@ ext {
* The configuration of OML dependencies
*/
configurations {
oml
oml // Include the oml dependencies only
stylesheets // Include the docbook stylesheets
}

/*
Expand All @@ -61,6 +66,7 @@ repositories {
*/
dependencies {
oml "io.opencaesar.ontologies:imce-vocabularies:$imceVersion"
stylesheets "io.opencaesar.docbook:docbook-stylesheets:+"
}

/*
Expand Down Expand Up @@ -172,11 +178,106 @@ task owlShacl(type:io.opencaesar.owl.shacl.fuseki.OwlShaclFusekiTask, dependsOn:
resultPath = file('build/reports')
}

/*
* Zips stylesheets from docbook-stylesheets (local maven)
* Places them in build/stylesheets-gen
*/
task stylesheetUnzip(type: Copy) {
from configurations.stylesheets.files.collect { zipTree(it) }
into file("build/stylesheets-gen")
}
/*
* Gradle tasks to render the docbook physical_structure
*/
task physicalGenerate(type:io.opencaesar.owl.doc.OwlDocTask) {
endpointURL = 'http://localhost:3030/firesat'
documentIRI = 'http://opencaesar.io/examples/firesat/programs/earth-science/projects/firesat/documents/system-decomposition#PhysicalDecomposition'
outputPath = file('build/reports/physical_structure/physical_structure.json')
}

task physicalDocbook(type:io.opencaesar.docbook.generator.DocbookGeneratorTask, dependsOn: physicalGenerate) {
input = file('build/reports/physical_structure/physical_structure.json')
output = file('build/reports/physical_structure/physical_structure.xml')
}

task physicalPDF(type:io.opencaesar.docbook.renderer.DocbookRendererTask, dependsOn: stylesheetUnzip) {
input = file('build/reports/physical_structure/physical_structure.xml')
output = file('build/reports/physical_structure/physical_structure.pdf')
type = 'pdf'
xsl = file('build/stylesheets-gen/pdf/pdf.xsl')
}

task physicalHTML(type:io.opencaesar.docbook.renderer.DocbookRendererTask, dependsOn: stylesheetUnzip) {
input = file('build/reports/physical_structure/physical_structure.xml')
output = file('build/reports/physical_structure/physical_structure.html')
type = 'html'
xsl = file('build/stylesheets-gen/html/html.xsl')
css = file('build/stylesheets-gen/default.css')
}

physicalGenerate.mustRunAfter(owlLoad)
physicalDocbook.mustRunAfter(physicalGenerate)
physicalHTML.mustRunAfter(physicalDocbook)
physicalPDF.mustRunAfter(physicalDocbook)

task physicalRender() {
dependsOn owlLoad
dependsOn physicalGenerate
dependsOn physicalDocbook
dependsOn physicalPDF
dependsOn physicalHTML
}

/*
* Gradle tasks to render the docbook wbs document
*/
task wbsGenerate(type:io.opencaesar.owl.doc.OwlDocTask) {
endpointURL = 'http://localhost:3030/firesat'
documentIRI = 'http://opencaesar.io/examples/firesat/programs/earth-science/projects/firesat/documents/work-breakdown-structure#WorkBreakdownStructure'
outputPath = file('build/reports/wbs/wbs.json')
}

task wbsDocbook(type:io.opencaesar.docbook.generator.DocbookGeneratorTask, dependsOn: wbsGenerate) {
input = file('build/reports/wbs/wbs.json')
output = file('build/reports/wbs/wbs.xml')
}

task wbsPDF(type:io.opencaesar.docbook.renderer.DocbookRendererTask, dependsOn: stylesheetUnzip) {
input = file('build/reports/wbs/wbs.xml')
output = file('build/reports/wbs/wbs.pdf')
type = 'pdf'
xsl = file('build/stylesheets-gen/pdf/pdf.xsl')
}

task wbsHTML(type:io.opencaesar.docbook.renderer.DocbookRendererTask, dependsOn: stylesheetUnzip) {
input = file('build/reports/wbs/wbs.xml')
output = file('build/reports/wbs/wbs.html')
type = 'html'
xsl = file('build/stylesheets-gen/html/html.xsl')
css = file('build/stylesheets-gen/default.css')
}

wbsGenerate.mustRunAfter(owlLoad)
wbsDocbook.mustRunAfter(wbsGenerate)
wbsPDF.mustRunAfter(wbsDocbook)
wbsHTML.mustRunAfter(wbsDocbook)

task wbsRender() {
dependsOn owlLoad
dependsOn wbsGenerate
dependsOn wbsDocbook
dependsOn wbsPDF
dependsOn wbsHTML
}


/*
* A task to build the project, which executes several tasks together
*/
task build() {
dependsOn owlReason
// dependsOn bikeshed2html
dependsOn stylesheetUnzip
}

/*
Expand Down Expand Up @@ -260,4 +361,4 @@ apply plugin: 'eclipse'

eclipse {
synchronizationTasks downloadDependencies
}
}
2 changes: 1 addition & 1 deletion catalog.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version='1.0'?>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="public">
<rewriteURI uriStartString="http://imce.jpl.nasa.gov/discipline/" rewritePrefix="src/oml/imce.jpl.nasa.gov/discipline/"/>
<rewriteURI uriStartString="http://opencaesar.io/" rewritePrefix="src/oml/opencaesar.io/"/>
<rewriteURI uriStartString="http://opencaesar.io/examples/firesat/" rewritePrefix="src/oml/opencaesar.io/examples/firesat/"/>
<rewriteURI uriStartString="http://" rewritePrefix="build/oml/" />
</catalog>
2 changes: 2 additions & 0 deletions src/oml/imce.jpl.nasa.gov/discipline/fse/bundle.oml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ vocabulary bundle <http://imce.jpl.nasa.gov/discipline/fse/bundle> with # as fse
includes <http://imce.jpl.nasa.gov/discipline/fse/endcircuits>

includes <http://imce.jpl.nasa.gov/discipline/fse/functions>

includes <http://opencaesar.io/document>
}
4 changes: 4 additions & 0 deletions src/oml/opencaesar.io/examples/firesat/bundle.oml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ description bundle <http://opencaesar.io/examples/firesat/bundle> with # as fire
includes <http://opencaesar.io/examples/firesat/programs/earth-science/projects/firesat/systems/spc/requirements/performance>
includes <http://opencaesar.io/examples/firesat/programs/earth-science/projects/firesat/systems/spc/requirements/resource>
includes <http://opencaesar.io/examples/firesat/programs/earth-science/projects/firesat/systems/spc/requirements/system>

includes <http://opencaesar.io/examples/firesat/programs/earth-science/projects/firesat/documents/common>
includes <http://opencaesar.io/examples/firesat/programs/earth-science/projects/firesat/documents/system-decomposition>
includes <http://opencaesar.io/examples/firesat/programs/earth-science/projects/firesat/documents/work-breakdown-structure>

// WP 05
includes <http://opencaesar.io/examples/firesat/programs/earth-science/projects/firesat/workpackages/05/systems/pld/assemblies>
Expand Down
19 changes: 18 additions & 1 deletion src/oml/opencaesar.io/examples/firesat/organizations/jpl.oml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,22 @@ description <http://opencaesar.io/examples/firesat/organizations/jpl> with # as

@rdfs:label "JPL"
ci JPL : project:Organization


@rdfs:label "Intern"
ci Intern : project:Role

@rdfs:label "Software Systems Engineer"
ci SoftwareSystemsEngineer : project:Role

@rdfs:label "David Truong"
ci DavidTruong : project:Person [
project:belongsTo JPL
project:hasRole Intern
]

@rdfs:label "Paul Gaspardo"
ci PaulGaspardo : project:Person [
project:belongsTo JPL
project:hasRole SoftwareSystemsEngineer
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

description <http://opencaesar.io/examples/firesat/programs/earth-science/projects/firesat/documents/common> with # as common {
uses <http://opencaesar.io/document> as doc

@doc:hasRequiredBinding 'DOCUMENT'
@doc:hasSparqlMapping '''
SELECT (CONCAT(STR(YEAR(NOW())), '-', STR(MONTH(NOW())), '-', STR(DAY(NOW()))) AS ?hasDate) ?hasReleaseVersion WHERE {
$DOCUMENT <http://opencaesar.io/document#hasReleaseVersion> ?hasReleaseVersion
}
'''
ci TitlePage : doc:TitlePage [
doc:hasElement Preparers
]

@doc:hasRequiredBinding 'DOCUMENT'
@doc:hasSparqlExpansion '''
PREFIX doc: <http://opencaesar.io/document#>
PREFIX proj: <http://imce.jpl.nasa.gov/foundation/project#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT DISTINCT ?hasName ?hasRole ?hasOrganization WHERE {
$DOCUMENT doc:preparedBy ?preparer .
?preparer proj:belongsTo ?organization .
?preparer proj:hasRole ?role .
?preparer rdfs:label ?hasName .
?role rdfs:label ?hasRole .
?organization rdfs:label ?hasOrganization .
} ORDER BY ?hasName
'''
ci Preparers : doc:Preparer

}
Loading