source("../../osr_common.R")9 Mass Roll Up Analysis
9.1 Summary
9.2 Methodology
9.3 Business Questions
What is total mass of OSR system?
9.4 Vocabulary
9.5 Descriptions
9.5.1 Modeling Descriptions Mass Property
Define mass property target
library(omlhashiR)
# oml_repository <- "../open-source-rover/"
oml_repository <- omlrepo
omlhashiR::oml_refresh()[1] "kill success for pid=25084"
omlhashiR::oml_stop_Daemon(oml_repository)[1] "Stopping Daemon(s)" "1 Daemon stopped"
omlhashiR::oml_build(oml_repository) [1] "Starting a Gradle Daemon, 30 stopped Daemons could not be reused, use --status for details"
[2] "> Task :omlZip"
[3] "> Task :assemble"
[4] "> Task :downloadDependencies UP-TO-DATE"
[5] "> Task :omlToOwl"
[6] "> Task :owlReason"
[7] "> Task :check"
[8] "> Task :build"
[9] ""
[10] "BUILD SUCCESSFUL in 7s"
[11] "4 actionable tasks: 3 executed, 1 up-to-date"
omlhashiR::oml_owlLoad(oml_repository)[1] "> Task :downloadDependencies UP-TO-DATE"
[2] "> Task :omlToOwl UP-TO-DATE"
[3] "> Task :owlReason UP-TO-DATE"
[4] ""
[5] "> Task :owlLoad"
[6] "Loaded 22 owl file(s), unloaded 0 owl file(s)"
[7] ""
[8] "BUILD SUCCESSFUL in 1s"
[9] "4 actionable tasks: 1 executed, 3 up-to-date"
9.5.2 Set endpoint_url
endpoint_url <- "http://localhost:3030/open-source-rover/sparql"library(tansakusuR)
repo <- "../../../src/vision/sparql/"
file <- "component_filtered_withmass.sparql"
filepath <- paste0(repo,file)
show_query(filepath)PREFIX base: <http://imce.jpl.nasa.gov/foundation/base#>
PREFIX mission: <http://imce.jpl.nasa.gov/foundation/mission#>
PREFIX structure: <http://opencaesar.io/open-source-rover/vocabulary/structure#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX vim4: <http://bipm.org/jcgm/vim4#>
SELECT DISTINCT ?c1_localname ?c1_id ?c1_name ?c1_type ?c1_mass ?c2_localname ?c2_id ?c2_name
WHERE {
VALUES ?componentType { structure:System structure:Subsystem structure:Assembly }
?c1 a ?componentType ;
base:hasIdentifier ?c1_id ;
base:hasCanonicalName ?c1_name ;
OPTIONAL{
?c1 base:isContainedIn ?c2 ;
OPTIONAL{
?c2 base:hasIdentifier ?c2_id ;
base:hasCanonicalName ?c2_name .
}
}
OPTIONAL {
?c1_mass_mag vim4:characterizes ?c1 ;
vim4:hasDoubleNumber ?c1_mass .
}
# Extract the local name
BIND(STRAFTER(STR(?c1), "#") AS ?c1_localname) .
BIND(STRAFTER(STR(?c2), "#") AS ?c2_localname) .
OPTIONAL {
?c1 a structure:System ;
BIND("System" AS ?c1_type) .
}
OPTIONAL {
?c1 a structure:Subsystem ;
BIND("Subsystem" AS ?c1_type) .
}
OPTIONAL {
?c1 a structure:Assembly ;
BIND("Assembly" AS ?c1_type) .
}
}
ORDER BY ?c1_id
df <- send_query_from_file(endpoint_url, filepath)
datatable(df, options = list(pageLength = -1))