diff --git a/.gitignore b/.gitignore index ee4640c0..262cecf4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .gradle build .DS_Store -.idea \ No newline at end of file +.idea +src-gen \ No newline at end of file diff --git a/build.gradle b/build.gradle index 48c4a2e2..05760152 100644 --- a/build.gradle +++ b/build.gradle @@ -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' } @@ -45,6 +46,7 @@ ext { configurations { oml // Include the oml dependencies only fuseki //Include fuseki server + stylesheets // Include the docbook stylesheets } /* @@ -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:+" } /* @@ -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') @@ -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 */ diff --git a/src/docbook/physical/src/assemblies.xml b/src/docbook/physical/src/assemblies.xml new file mode 100644 index 00000000..acd888b5 --- /dev/null +++ b/src/docbook/physical/src/assemblies.xml @@ -0,0 +1,45 @@ + + + + + Subsystem and Assemblies + 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. + + + + + + + + + + + + + + + + + _systemDesc_ + The mass constraint of _subsystem_ (_subNum_) is _subMass_. + + + + + + _desc_ + The mass of _assembly_ is _mass_. + + + + + + + diff --git a/src/docbook/physical/src/physical_structure.xml b/src/docbook/physical/src/physical_structure.xml new file mode 100644 index 00000000..0af04c14 --- /dev/null +++ b/src/docbook/physical/src/physical_structure.xml @@ -0,0 +1,23 @@ + + + + + + FireSat Physical Structure + + + 2020 + Development + + + + Overview + 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. + + + diff --git a/src/docbook/wbs/src/firesat.xml b/src/docbook/wbs/src/firesat.xml new file mode 100644 index 00000000..16fe57d2 --- /dev/null +++ b/src/docbook/wbs/src/firesat.xml @@ -0,0 +1,54 @@ + + + + + + FireSat + +
+ FireSat Mission + The FireSat Mission pursues , + which has the objective: . + The FireSat project operates in these environments: + + + + + The stakeholders of this mission are: + + + + +
+
+ FireSat Project + 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. + + + + + + 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. + + + + + _wp_ focuses on the _mainSup_ and is the responsibility of _mainOrg_. + + + + + + + +
+
\ No newline at end of file diff --git a/src/docbook/wbs/src/organization.xml b/src/docbook/wbs/src/organization.xml new file mode 100644 index 00000000..d4d97706 --- /dev/null +++ b/src/docbook/wbs/src/organization.xml @@ -0,0 +1,22 @@ + + + + + Organizations + In this system, there are various organizations providing support. Listed below are + those organizations along with their supporting employees. + + + _org_ is one of the organizations involved in this satellite system. + + + + + + + + + + + diff --git a/src/docbook/wbs/src/programs.xml b/src/docbook/wbs/src/programs.xml new file mode 100644 index 00000000..6f07d8e8 --- /dev/null +++ b/src/docbook/wbs/src/programs.xml @@ -0,0 +1,18 @@ + + + + + + Programs + + Programs related to the fire satellite and their respective projects + + + + + + + + + \ No newline at end of file diff --git a/src/docbook/wbs/src/wbs.xml b/src/docbook/wbs/src/wbs.xml new file mode 100644 index 00000000..93d74b65 --- /dev/null +++ b/src/docbook/wbs/src/wbs.xml @@ -0,0 +1,26 @@ + + + + + + FireSat Work Breakdown Structure + + + 2020 + Development + + + + Overview + 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. + + + + + + + diff --git a/src/sparql/assembly.sparql b/src/sparql/assembly.sparql new file mode 100644 index 00000000..b9cf75c0 --- /dev/null +++ b/src/sparql/assembly.sparql @@ -0,0 +1,22 @@ +PREFIX rdf: +PREFIX owl: +PREFIX rdfs: +PREFIX project: +PREFIX mission: +PREFIX org: +PREFIX pr: +PREFIX pro: +PREFIX base: +PREFIX fse: +PREFIX analysis: +PREFIX dc: + +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 \ No newline at end of file diff --git a/src/sparql/base.sparql b/src/sparql/base.sparql new file mode 100644 index 00000000..0db137d4 --- /dev/null +++ b/src/sparql/base.sparql @@ -0,0 +1,23 @@ +PREFIX rdf: +PREFIX owl: +PREFIX rdfs: +PREFIX project: +PREFIX mission: +PREFIX org: +PREFIX pr: +PREFIX pro: +PREFIX base: +PREFIX fse: +PREFIX analysis: +PREFIX 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 \ No newline at end of file diff --git a/src/sparql/env.sparql b/src/sparql/env.sparql new file mode 100644 index 00000000..948097f8 --- /dev/null +++ b/src/sparql/env.sparql @@ -0,0 +1,12 @@ +PREFIX rdf: +PREFIX owl: +PREFIX rdfs: +PREFIX project: +PREFIX mission: +PREFIX org: + +Select ?env +WHERE { + ?e a mission:Environment. + ?e rdfs:label ?env +} diff --git a/src/sparql/es_projects.sparql b/src/sparql/es_projects.sparql new file mode 100644 index 00000000..8bddb222 --- /dev/null +++ b/src/sparql/es_projects.sparql @@ -0,0 +1,15 @@ +PREFIX rdf: +PREFIX owl: +PREFIX rdfs: +PREFIX proj: +PREFIX org: + +Select ?proj ?org ?Mission +WHERE { + ?s rdf:type proj:Project . + ?s rdfs:label ?proj . + ?s proj:isResponsibilityOf ?o . + ?o rdfs:label ?org . + ?s proj:supplies ?m . + ?m rdfs:label ?Mission +} ORDER BY ?proj \ No newline at end of file diff --git a/src/sparql/firesat_mission.sparql b/src/sparql/firesat_mission.sparql new file mode 100644 index 00000000..2d35aeec --- /dev/null +++ b/src/sparql/firesat_mission.sparql @@ -0,0 +1,15 @@ +PREFIX rdf: +PREFIX owl: +PREFIX rdfs: +PREFIX project: +PREFIX mission: +PREFIX org: + +Select ?mission ?pursues ?objective +WHERE { + ?m a mission:Mission . + ?m rdfs:label ?mission . + ?m mission:pursues ?p . + ?p rdfs:label ?pursues . + ?p rdfs:comment ?objective +} diff --git a/src/sparql/nasa_workers.sparql b/src/sparql/nasa_workers.sparql new file mode 100644 index 00000000..0f6e9367 --- /dev/null +++ b/src/sparql/nasa_workers.sparql @@ -0,0 +1,13 @@ +PREFIX rdf: +PREFIX owl: +PREFIX rdfs: +PREFIX proj: +PREFIX org: + +Select ?people ?role +WHERE { + ?p proj:belongsTo org:NASA . + ?p rdfs:label ?people . + ?p proj:hasRole ?r . + ?r rdfs:label ?role. +} ORDER BY ?people \ No newline at end of file diff --git a/src/sparql/organization.sparql b/src/sparql/organization.sparql new file mode 100644 index 00000000..595d59af --- /dev/null +++ b/src/sparql/organization.sparql @@ -0,0 +1,10 @@ +PREFIX rdf: +PREFIX owl: +PREFIX rdfs: +PREFIX proj: + +Select ?org +WHERE { + ?t rdf:type proj:Organization . + ?t rdfs:label ?org +} ORDER BY ?org \ No newline at end of file diff --git a/src/sparql/programs.sparql b/src/sparql/programs.sparql new file mode 100644 index 00000000..65690902 --- /dev/null +++ b/src/sparql/programs.sparql @@ -0,0 +1,11 @@ +PREFIX rdf: +PREFIX owl: +PREFIX rdfs: +PREFIX proj: +PREFIX org: + +Select ?pro +WHERE { + ?s rdf:type proj:Program . + ?s rdfs:label ?pro . +} ORDER BY ?pro \ No newline at end of file diff --git a/src/sparql/requirements.sparql b/src/sparql/requirements.sparql new file mode 100644 index 00000000..e2beef6a --- /dev/null +++ b/src/sparql/requirements.sparql @@ -0,0 +1,16 @@ +PREFIX rdf: +PREFIX owl: +PREFIX rdfs: +PREFIX project: +PREFIX mission: +PREFIX org: +PREFIX pr: +PREFIX pro: + +Select ?req ?refines +WHERE { + ?r a mission:Requirement. + ?r rdfs:label ?req. + optional {?r mission:refines ?r2. + ?r2 rdfs:label ?refines}. +} ORDER BY ?req \ No newline at end of file diff --git a/src/sparql/stakeholder.sparql b/src/sparql/stakeholder.sparql new file mode 100644 index 00000000..18223108 --- /dev/null +++ b/src/sparql/stakeholder.sparql @@ -0,0 +1,15 @@ +PREFIX rdf: +PREFIX owl: +PREFIX rdfs: +PREFIX project: +PREFIX mission: +PREFIX org: + +Select ?mission ?holder +WHERE { + ?m a mission:Mission . + ?m rdfs:label ?mission . + ?m mission:pursues ?p . + ?s project:represents ?p . + ?s rdfs:label ?holder +} \ No newline at end of file diff --git a/src/sparql/sub_assembly.sparql b/src/sparql/sub_assembly.sparql new file mode 100644 index 00000000..c43193de --- /dev/null +++ b/src/sparql/sub_assembly.sparql @@ -0,0 +1,31 @@ +PREFIX rdf: +PREFIX owl: +PREFIX rdfs: +PREFIX project: +PREFIX mission: +PREFIX org: +PREFIX pr: +PREFIX pro: +PREFIX base: +PREFIX fse: +PREFIX analysis: +PREFIX assemblies: +PREFIX dc: + +Select ?subsystem ?mass ?assembly ?assemblyMass ?s ?assemblyIri ?subNum +?assemNum ?systemDesc ?assemDesc +WHERE { + ?s a fse:Subsystem. + ?s rdfs:label ?subsystem. + optional {?s dc:description ?systemDesc}. + ?m analysis:characterizes ?s. + ?m fse:hasMassConstraintValue ?mass. + ?s fse:hasSubsystemNumber ?subNum. + ?s base:aggregates ?assemblyIri. + ?assemblyIri a fse:Assembly. + optional {?assemblyIri dc:description ?assemDesc}. + ?assemblyIri fse:hasAssemblyAcronym ?assemNum. + ?assemblyIri rdfs:label ?assembly. + ?m2 analysis:characterizes ?assemblyIri. + ?m2 fse:hasMassConstraintValue ?assemblyMass. +} ORDER BY ?subsystem \ No newline at end of file diff --git a/src/sparql/subpackage.sparql b/src/sparql/subpackage.sparql new file mode 100644 index 00000000..085fbdb8 --- /dev/null +++ b/src/sparql/subpackage.sparql @@ -0,0 +1,22 @@ +PREFIX rdf: +PREFIX owl: +PREFIX rdfs: +PREFIX project: +PREFIX mission: +PREFIX org: +PREFIX pr: +PREFIX pro: + +Select ?wp ?subpackage ?subSupply ?subOrg +WHERE { + ?p a project:Project. + ?p project:authorizes ?w. + ?w a project:WorkPackage . + ?w rdfs:label ?wp . + ?w project:authorizes ?sp . + ?sp rdfs:label ?subpackage . + ?sp project:supplies ?sps . + ?sps rdfs:label ?subSupply . + ?sp project:isResponsibilityOf ?spo. + ?spo rdfs:label ?subOrg +} ORDER BY ?subpackage \ No newline at end of file diff --git a/src/sparql/subsystem.sparql b/src/sparql/subsystem.sparql new file mode 100644 index 00000000..58d98f9c --- /dev/null +++ b/src/sparql/subsystem.sparql @@ -0,0 +1,23 @@ +PREFIX rdf: +PREFIX owl: +PREFIX rdfs: +PREFIX project: +PREFIX mission: +PREFIX org: +PREFIX pr: +PREFIX pro: +PREFIX base: +PREFIX fse: +PREFIX analysis: +PREFIX assemblies: +PREFIX dc: + +Select ?subsystem ?mass ?systemIri ?num ?desc +WHERE { + ?systemIri a fse:Subsystem. + ?systemIri rdfs:label ?subsystem. + optional {?systemIri dc:description ?desc}. + ?m analysis:characterizes ?systemIri. + ?m fse:hasMassConstraintValue ?mass. + ?systemIri fse:hasSubsystemNumber ?num +} ORDER BY ?subsystem \ No newline at end of file diff --git a/src/sparql/workers.sparql b/src/sparql/workers.sparql new file mode 100644 index 00000000..c035a85e --- /dev/null +++ b/src/sparql/workers.sparql @@ -0,0 +1,15 @@ +PREFIX rdf: +PREFIX owl: +PREFIX rdfs: +PREFIX proj: +PREFIX org: + +Select ?person ?role ?org +WHERE { + ?p rdf:type proj:Person . + ?p rdfs:label ?person . + ?p proj:hasRole ?r . + ?r rdfs:label ?role. + ?p proj:belongsTo ?o. + ?o rdfs:label ?org +} \ No newline at end of file diff --git a/src/sparql/workpackages.sparql b/src/sparql/workpackages.sparql new file mode 100644 index 00000000..e593b4a4 --- /dev/null +++ b/src/sparql/workpackages.sparql @@ -0,0 +1,21 @@ +PREFIX rdf: +PREFIX owl: +PREFIX rdfs: +PREFIX project: +PREFIX mission: +PREFIX org: +PREFIX pr: +PREFIX pro: + +Select ?wp ?org ?supplies ?project +WHERE { + ?p a project:Project. + ?p rdfs:label ?project. + ?p project:authorizes ?w. + ?w a project:WorkPackage . + ?w rdfs:label ?wp . + ?w project:isResponsibilityOf ?o . + ?o rdfs:label ?org . + ?w project:supplies ?s . + ?s rdfs:label ?supplies +} ORDER BY ?wp