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

Issue 7 document generation #7

Open
wants to merge 3 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: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.gradle
build
.DS_Store
.idea
.idea
src-gen
84 changes: 83 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ buildscript {
classpath 'io.opencaesar.oml:oml-bikeshed-gradle:+'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:+'
classpath 'com.wiredforcode:gradle-spawn-plugin:+'
classpath 'io.opencaesar.docbook:docbook-adapter-gradle:+'
// needed since gradle bintray brings an old version of xerces
configurations.classpath.exclude group: 'xerces', module: 'xercesImpl'
}
Expand All @@ -45,6 +46,7 @@ ext {
configurations {
oml // Include the oml dependencies only
fuseki //Include fuseki server
stylesheets // Include the docbook stylesheets
}

/*
Expand All @@ -62,6 +64,7 @@ repositories {
dependencies {
oml "io.opencaesar.ontologies:vocabularies:$vocabulariesVersion"
fuseki "org.apache.jena:jena-fuseki-server:$fusekiVersion"
stylesheets "io.opencaesar.docbook:docbook-stylesheets:+"
}

/*
Expand Down Expand Up @@ -106,7 +109,7 @@ task owlload(type:io.opencaesar.owl.load.OwlLoadTask, dependsOn: owlreason) {
fileExtensions = ['owl', 'ttl']
}

task owlquery(type:io.opencaesar.owl.query.OwlQueryTask, dependsOn: owlload) {
task owlquery(type:io.opencaesar.owl.query.OwlQueryTask) {
endpointURL = 'http://localhost:3030/firesat'
queryPath = file('src/sparql')
resultPath = file('build/frames')
Expand Down Expand Up @@ -146,6 +149,85 @@ task omlzip(type: Zip) {
archiveVersion = project.version
}

/*
* 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 physicalTag(type:io.opencaesar.docbook.adapter.DocbookAdapterTask, dependsOn: stylesheetUnzip) {
input = file('src/docbook/physical/src/physical_structure.xml')
type = 'tag'
xsl = file('build/stylesheets-gen/tag/all_transformations.xsl')
original = file('build/stylesheets-gen/docbook_xsl')
frame = file('build/frames')
}

task physicalPDF(type:io.opencaesar.docbook.adapter.DocbookAdapterTask) {
input = file('src/docbook/physical/src-gen/physical_structure.xml')
type = 'pdf'
xsl = file('src/docbook/physical/src-gen/pdf/pdf_ext.xsl')
}

task physicalHTML(type:io.opencaesar.docbook.adapter.DocbookAdapterTask) {
input = file('src/docbook/physical/src-gen/physical_structure.xml')
type = 'html'
xsl = file('src/docbook/physical/src-gen/html/html_ext.xsl')
css = file('../docbook-tools/docbook-tools/docbook-stylesheets/src/stylesheets/default.css')
}

physicalTag.mustRunAfter(owlquery)
physicalHTML.mustRunAfter(physicalTag)
physicalPDF.mustRunAfter(physicalTag)

task physicalRender() {
dependsOn owlquery
dependsOn physicalTag
dependsOn physicalPDF
dependsOn physicalHTML
}

/*
* Gradle tasks to render the docbook wbs document
*/
task wbsTag(type:io.opencaesar.docbook.adapter.DocbookAdapterTask, dependsOn: stylesheetUnzip) {
input = file('src/docbook/wbs/src/wbs.xml')
type = 'tag'
xsl = file('build/stylesheets-gen/tag/all_transformations.xsl')
original = file('build/stylesheets-gen/docbook_xsl')
frame = file('build/frames')
}

task wbsPDF(type:io.opencaesar.docbook.adapter.DocbookAdapterTask) {
input = file('src/docbook/wbs/src-gen/wbs.xml')
type = 'pdf'
xsl = file('src/docbook/wbs/src-gen/pdf/pdf_ext.xsl')
}

task wbsHTML(type:io.opencaesar.docbook.adapter.DocbookAdapterTask) {
input = file('src/docbook/wbs/src-gen/wbs.xml')
type = 'html'
xsl = file('src/docbook/wbs/src-gen/html/html_ext.xsl')
css = file('../docbook-tools/docbook-tools/docbook-stylesheets/src/stylesheets/default.css')
}

wbsTag.mustRunAfter(owlquery)
wbsPDF.mustRunAfter(wbsTag)
wbsHTML.mustRunAfter(wbsTag)

task wbsRender() {
dependsOn owlquery
dependsOn wbsTag
dependsOn wbsPDF
dependsOn wbsHTML
}


/*
* A task to build the project, which executes several tasks together
*/
Expand Down
45 changes: 45 additions & 0 deletions src/docbook/physical/src/assemblies.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="http://docbook.org/xml/5.1/rng/docbook.rng" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="http://docbook.org/xml/5.1/sch/docbook.sch" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<chapter xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:oc="https://opencaesar.github.io/" version="5.1">
<title>Subsystem and Assemblies</title>
<para>The FireSat system is composed of multiple subsystems. These subsystems have a mass
constraint, and are the aggregate of multiple assemblies. These assemblies also have a
mass constraint that must be met, and some assemblies contain multiple base
assemblies put together.</para>
<oc:table title="Subsystems" frame="subsystem.frame" bodyColor="#BFDFBF">
<oc:column name="Acronym" target="num"/>
<oc:column name="Subsystem" target="subsystem" link="_systemIri_"/>
<oc:column name="Mass" target="mass"/>
<oc:interleaveTable frame="sub_assembly.frame" filter="subsystem=_subsystem_"
bodyColor="white">
<oc:column name="acronym" target="assemNum"/>
<oc:column name="assembly" target="assembly" link="_assemblyIri_"/>
<oc:column name="mass" target="assemblyMass"/>
</oc:interleaveTable>
</oc:table>
<oc:section title="_subsystem_" frame="subsystem.frame" id="_systemIri_">
<oc:var name="subsystem" target="subsystem"/>
<oc:var name="systemDesc" target="desc"/>
<oc:var name="subMass" target="mass"/>
<oc:var name="systemIri" target="systemIri"/>
<oc:var name="subNum" target="num"/>
<para>_systemDesc_</para>
<para>The mass constraint of _subsystem_ (_subNum_) is _subMass_.</para>
<oc:section title="_assembly_" frame="sub_assembly.frame" id="_iri_" filter="s = _systemIri_">
<oc:var name="assembly" target="assembly"/>
<oc:var name="mass" target="assemblyMass"/>
<oc:var name="desc" target="assemDesc"/>
<oc:var name="iri" target="assemblyIri"/>
<para>_desc_</para>
<para>The mass of _assembly_ is _mass_.</para>
<oc:table title="_assembly_ Contained Assemblies" frame="base.frame"
filter="assembly=_assembly_">
<oc:column name="Assembly" target="sub" link="_subIri_"/>
<oc:column name="Mass" target="subMass"/>
</oc:table>
</oc:section>
</oc:section>
</chapter>
23 changes: 23 additions & 0 deletions src/docbook/physical/src/physical_structure.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="http://docbook.org/xml/5.1/rng/docbookxi.rng" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="http://docbook.org/xml/5.1/sch/docbook.sch" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<book xmlns="http://docbook.org/ns/docbook"
xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:oc="https://opencaesar.github.io/"
xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0-extension OpenCaesar-0.1">
<info>
<title>FireSat Physical Structure</title>
<oc:titlePage>
<oc:preparer name="David Truong" role="Intern" group="313"/>
<oc:date> 2020 </oc:date>
<oc:releaseVersion> Development </oc:releaseVersion>
</oc:titlePage>
</info>
<preface>
<title>Overview</title>
<para> This document details the physical decomposition of the systems involved in the
example fire detection satellite system described by the OML vocabulary. This includes
information about the assemblies used, what assemblies are used to create other assemblies,
and mass constraints for all the assemblies.</para>
</preface>
<xi:include href="assemblies.xml"/>
</book>
54 changes: 54 additions & 0 deletions src/docbook/wbs/src/firesat.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="http://docbook.org/xml/5.0/rng/docbook.rng" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="http://docbook.org/xml/5.0/rng/docbook.rng" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<chapter xmlns="http://docbook.org/ns/docbook" xmlns:oc="https://opencaesar.github.io/"
xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0">
<info>
<title>FireSat</title>
</info>
<section>
<title>FireSat Mission</title>
<para>The FireSat Mission pursues <oc:value of="pursues"
where="mission" equalsTo="FireSat Mission" frame="firesat_mission.frame"/>,
which has the objective: <oc:value of="objective"
where="mission" equalsTo="FireSat Mission" frame="firesat_mission.frame"/>.
The FireSat project operates in these environments:
<oc:table frame="env.frame" title="FireSat Enviroments">
<oc:column name="Environment" target="env"/>
</oc:table> </para>
<para>
The stakeholders of this mission are:
<oc:table frame="stakeholder.frame"
filter="mission = FireSat Mission">
<oc:column name="Stakeholder" target="holder"/>
</oc:table>
</para>
</section>
<section>
<title>FireSat Project</title>
<para>The FireSat project deploys multiple work packages in pursuit of the FireSat Mission.
These work packages contain data on the products needed for this project and describes how these
products should be built.</para>
<oc:table frame="workpackages.frame" title="Main Work Packages" filter="project = FireSat Project">
<oc:column name="Work Package" target="wp"/>
<oc:column name="Supplies" target="supplies"/>
<oc:column name="Providing Organization" target="org"/>
</oc:table>
<para>Some work packages authorize other work packages to further break down the work and
details needed to supply a certain part. These sub work packages often deal with subsystems
that make up the whole system that the main work package focsues on. The following sections
go over the main work packages and note any sub work packages.</para>
<oc:section title="_wp_" frame="workpackages.frame" filter="project = FireSat Project">
<oc:var name="wp" target="wp"/>
<oc:var name="mainSup" target="supplies"/>
<oc:var name="mainOrg" target="org"/>
<para>_wp_ focuses on the _mainSup_ and is the responsibility of _mainOrg_.</para>
<oc:table title="_wp_'s Sub Work Packages" frame="subpackage.frame" filter="wp = _wp_">
<oc:column name="Sub Work Package" target="subpackage"/>
<oc:column name="Supplies" target="subSupply"/>
<oc:column name="Providing Organization" target="subOrg"/>
</oc:table>

</oc:section>
</section>
</chapter>
22 changes: 22 additions & 0 deletions src/docbook/wbs/src/organization.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="http://docbook.org/xml/5.0/rng/docbook.rng" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="http://docbook.org/xml/5.0/rng/docbook.rng" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<chapter xmlns="http://docbook.org/ns/docbook" xmlns:oc="https://opencaesar.github.io/"
xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0">
<title> Organizations</title>
<para>In this system, there are various organizations providing support. Listed below are
those organizations along with their supporting employees.</para>
<oc:section frame="organization.frame" title="_org_">
<oc:var name="org" target="org"/>
<para>_org_ is one of the organizations involved in this satellite system.</para>
<oc:table title="_org_ Worker List" frame="workers.frame" filter="org = _org_">
<oc:column name="Name" target="person"/>
<oc:column name="Role" target="role"/>
</oc:table>
</oc:section>
<oc:table title="REFERENCE DESIGNATOR TOP-LEVEL VIEW" frame="fs.frame">
<oc:column target="year" name="Reference Number"/>
<oc:column target="fs" name="Subsystem/Assembly/Unit Acronym"/>
<oc:column target="flight" name="Subsystem/Assembly/Unit Name"/>
</oc:table>
</chapter>
18 changes: 18 additions & 0 deletions src/docbook/wbs/src/programs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="http://docbook.org/xml/5.0/rng/docbook.rng" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="http://docbook.org/xml/5.0/rng/docbook.rng" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<chapter xmlns="http://docbook.org/ns/docbook" xmlns:oc="https://opencaesar.github.io/"
xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0">
<info>
<title>Programs</title>
</info>
<para>Programs related to the fire satellite and their respective projects</para>
<oc:table title="Program List" frame="programs.frame">
<oc:column name="Program" target="pro"/>
</oc:table>
<oc:table title="Earth Science Program's Projects" frame="es_projects.frame">
<oc:column name="Project" target="proj"/>
<oc:column name="Organization" target="org"/>
<oc:column target="Mission"/>
</oc:table>
</chapter>
26 changes: 26 additions & 0 deletions src/docbook/wbs/src/wbs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="http://docbook.org/xml/5.1/rng/docbookxi.rng" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="http://docbook.org/xml/5.1/sch/docbook.sch" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<book xmlns="http://docbook.org/ns/docbook"
xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:oc="https://opencaesar.github.io/"
xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0-extension OpenCaesar-0.1">
<info>
<title>FireSat Work Breakdown Structure</title>
<oc:titlePage>
<oc:preparer name="David Truong" role="Intern" group="313"/>
<oc:date> 2020 </oc:date>
<oc:releaseVersion> Development </oc:releaseVersion>
</oc:titlePage>
</info>
<preface>
<title>Overview</title>
<para> A description of the work breakdwon structure of an
example forest fire detection satellite system. The system is described in OML and this document
aims to present the details held in vocabulary.</para>
</preface>
<!-- <changeLog frame="commit.frame"/> -->
<!-- <xi:include href="demo.xml"/> -->
<xi:include href="organization.xml"/>
<xi:include href="programs.xml"/>
<xi:include href="firesat.xml"/>
</book>
22 changes: 22 additions & 0 deletions src/sparql/assembly.sparql
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX project: <http://imce.jpl.nasa.gov/foundation/project#>
PREFIX mission: <http://imce.jpl.nasa.gov/foundation/mission#>
PREFIX org: <http://opencaesar.io/organizations/nasa#>
PREFIX pr: <http://purl.org/ontology/prv/core#>
PREFIX pro: <http://purl.org/hpi/patchr#>
PREFIX base: <http://imce.jpl.nasa.gov/foundation/base#>
PREFIX fse: <http://imce.jpl.nasa.gov/discipline/fse/fse#>
PREFIX analysis: <http://imce.jpl.nasa.gov/foundation/analysis#>
PREFIX dc: <http://purl.org/dc/elements/1.1/>

Select ?assembly ?mass ?description ?iri ?num
WHERE {
?iri a fse:Assembly.
?iri rdfs:label ?assembly.
?iri fse:hasAssemblyAcronym ?num.
?m analysis:characterizes ?iri.
?m fse:hasMassConstraintValue ?mass.
optional {?iri dc:description ?description}.
} ORDER BY ?assembly
23 changes: 23 additions & 0 deletions src/sparql/base.sparql
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX project: <http://imce.jpl.nasa.gov/foundation/project#>
PREFIX mission: <http://imce.jpl.nasa.gov/foundation/mission#>
PREFIX org: <http://opencaesar.io/organizations/nasa#>
PREFIX pr: <http://purl.org/ontology/prv/core#>
PREFIX pro: <http://purl.org/hpi/patchr#>
PREFIX base: <http://imce.jpl.nasa.gov/foundation/base#>
PREFIX fse: <http://imce.jpl.nasa.gov/discipline/fse/fse#>
PREFIX analysis: <http://imce.jpl.nasa.gov/foundation/analysis#>
PREFIX assemblies: <http://imce.jpl.nasa.gov/discipline/fse/assemblies#>

Select ?assembly ?sub ?subMass ?subIri
WHERE {
?a a fse:Assembly.
?a rdfs:label ?assembly.
?a base:contains ?subIri.
?subIri rdfs:label ?sub.
?subIri a assemblies:BaseAssembly.
?m analysis:characterizes ?subIri.
?m fse:hasMassConstraintValue ?subMass
} ORDER BY ?sub
12 changes: 12 additions & 0 deletions src/sparql/env.sparql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX project: <http://imce.jpl.nasa.gov/foundation/project#>
PREFIX mission: <http://imce.jpl.nasa.gov/foundation/mission#>
PREFIX org: <http://opencaesar.io/organizations/nasa#>

Select ?env
WHERE {
?e a mission:Environment.
?e rdfs:label ?env
}
Loading