Skip to content

Commit

Permalink
rebase EntityResolution Branch to latest master (#809)
Browse files Browse the repository at this point in the history
* Added intValue to Signal

* Update Boeing.sadl

* Added intValue

* update to accomodate Boeing IDD and Tests

* corrected Test_Execution to Test_Procedure (not Test)

* obverses moved to IDD_Test

* SBVT_Test_Procedure only to SubDD_Req or SRS_Req

* RACK UI: display package description if available from manifest.  Remove unused imports.

* data export and count --model-graph should be optional

* using latest semtk and semtk-python3

* add manifest for static turnstile data

* Use latest semtk & python with SPARQLgraph URL param: reportId

* Update rack-box doc

rack-box/README.md: We resolved the issues blocking us from bumping
Fuseki to its latest version a while ago so stop mentioning 3.16.0.

* RACK UI: add capability to load Turnstile data, run ASSIST data verification (#777)

* Compile SADL files

Running "cli/setup-owl.sh -b" on RACK's SADL files produces the
following changes in addition to generating OWL files (which aren't
checked into git):

modified: GE-Ontology/OwlModels/ont-policy.rdf
new file: sadl-examples/OwlModels/TurnstileSecurity.rules
new file: sadl-examples/OwlModels/configuration.rdf
new file: sadl-examples/OwlModels/ont-policy.rdf

We might as well check these files into git so that anyone else
running setup-owl.sh in build mode doesn't end up with modified or
untracked files.

* Bump Ubuntu (ISO) and Fuseki (tar.gz)

Link to Ubuntu iso breaks after every point release, so update link
again.  Also make sure rack-box uses latest Fuseki version.

action.yml: Bump Fuseki tar.gz from 4.5.0 to 4.6.1.

rack-box-virtualbox.json: Bump Ubuntu iso from 20.04.4 to 20.04.5.

* Prepare for practice v10.9 release

* Made compatible with local Windows environment: remove Dash Pages, remove use of callback_context in @dash.callback

* Notify user that the 'Verify' feature is not yet supported on Windows

* Display ingestion warnings in RACK UI

* Set loading log level to ERROR and changed Verify on windows error message

* RACK UI provide nice error message if SemTK Services are not reachable

* Add example nodegroup

* Update README.md

* initial manifest documentation

* Fix ASSIST-DV to handle owl:allValuesFrom restriction.

Previously handled owl:someValuesFrom, but it did not identify a property_extra
value_from constraint for owl:allValuesFrom.

Also added some convenience functions to help/simplify the higher level check.

* sync cli/README with RACK CLI wiki

* Turnstile uses rack manifest only; also don't need ingest nodegroups

* Hopefully improve virtualbox build

rack-box/README.md: Update explanation of steps needed to create files
for packer builds.  Delete old instructions for using 'act' to run CI
locally since it's easier to run real GitHub CI and then examine the
logs closely.

rack-box/http/user-data: Add sleep 60 in case it helps.

rack-box/rack-box-hyperv.json: Update ISO url and checksum (use https
instead of http too).  Replace boot_command with same new boot_command
below.

rack-box/rack-box-virtualbox.json: Tweak ISO url (use https instead of
http).  Add disk_size variable and let it default to usual setting.
Replace boot_command with new command verified to work in bento's
package_templates/ubuntu.

* [ASSIST-DV] ensure property_range_type is exported from rack model.

* [ASSIST-DV] ensure blank nodes are not checked for valid target type.

* [ASSIST-DV] add check for property constraints with invalid domains.

* Fix domain of BDU_CONFIDENCE_ASSESSMENT properties.

* Change CONFIDENCE_ASSESSMENT from a THING to an ENTITY.

A confidence assessment is something which exists, and is therefore reasonable to
be an entity.

In addition, it has a wasGeneratedBy property that is not defined for THING but
which is defined for ENTITY.  This issue was detected by ASSIST-DV with the
enhancements in PR#782 with the following report:

> ERROR: Property http://arcos.rack/PROV-S#wasGeneratedBy was referenced on class http://arcos.rack/CONFIDENCE#CONFIDENCE_ASSESSMENT, but that property is only defined for the unrelated class http://arcos.rack/PROV-S#ENTITY

* [ASSIST-DV] extend invalid property domain checking to derived properties.

If a property is derived from a parent property, ensure that the class for the
property is valid for the domain of the parent property.

* [ASSIST-DV] Refine messaging for property domain reporting.

* [cli] Update README "how-to-use" section with new manifest command.

* [cli] additional rewording of manifest command preeminence.

* [ASSIST-DV] do not return blank nodes as direct properties.

* changed property name to avoid overloading

* updated changelog

* add last minute updates to changelog

* Update versions for next release

* [ASSIST-DV] no type checking of properties with literal targets.

* Use semtk oct-11 and latest semtk-python3

* Update data graphs in turnstile manifests

* semtk oct-12 Firefox fix

* Use semtk oct-14 with improved get_graph_names()

* suppress warnings on arcos setup (#796)

* Add SPARQLgraph report verification to RACK UI (#807)

* Build VM image with virtualbox-ovf instead of virtualbox-iso

The latest Ubuntu 20.04.05 LTS ISO hangs while trying to install
Ubuntu, so we are forced to build our VM image from an existing
vagrant box instead of building a new Ubuntu VM directly from the ISO.
Modify the Packer template and the release workflow accordingly.

.github/workflows/release.yml: Add a new step to download the vagrant
box in order to build the virtualbox image.

rack-box/.gitignore: Ignore the temporary focal64 directory where the
vagrant box is unpacked.

rack-box/files/GE_External_Root_CA_2_1.crt: Add GE's man-in-the-middle
proxy certificate so we can test the Packer template inside the
intranet.

rack-box/rack-box-docker.json: Reorder some lines alphabetically like
the other Packer templates.

rack-box/rack-box-hyperv.json: Reorder some lines alphabetically like
the other Packer templates.

rack-box/rack-box-virtualbox.json: Build the VM using virtualbox-ovf
instead of virtualbox-iso.  Delete or update some lines to specify the
necessary builder parameters.  Reorder some lines alphabetically like
the other Packer templates.

rack-box/scripts/install.sh: Always install some packages from now on
since we can't assume that an ISO installer will install them for us
anymore.

rack-box/vagrant: Add a private ssh key to allow Packer to connect to
the vagrant box's VM.

Co-authored-by: AbhaMoitra <moitraa@ge.com>
Co-authored-by: kityansiu <siu@ge.com>
Co-authored-by: Jenny Williams <weisenje@research.ge.com>
Co-authored-by: Eric Mertens <emertens@galois.com>
Co-authored-by: Paul Cuddihy <cuddihy@research.ge.com>
Co-authored-by: John Interrante <interran@research.ge.com>
Co-authored-by: Kevin Quick <kquick@galois.com>
Co-authored-by: Valentin Robert <val@galois.com>
Co-authored-by: Baoluo Meng <baoluo.meng@ge.com>
  • Loading branch information
10 people committed Oct 24, 2022
1 parent 624815b commit 90ef0c8
Show file tree
Hide file tree
Showing 54 changed files with 1,658 additions and 466 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/actions/download/action.yml
Expand Up @@ -27,12 +27,12 @@ runs:
- name: Download Fuseki release
shell: bash
run: |
curl -LSfs https://archive.apache.org/dist/jena/binaries/apache-jena-fuseki-4.5.0.tar.gz -o RACK/rack-box/files/fuseki.tar.gz
curl -LSfs https://archive.apache.org/dist/jena/binaries/apache-jena-fuseki-4.6.1.tar.gz -o RACK/rack-box/files/fuseki.tar.gz
- name: Download SemTK release
shell: bash
run: |
curl -LSfs https://github.com/ge-semtk/semtk/releases/download/v2.5.0-20220830/semtk-opensource-v2.5.0-20220830-dist.tar.gz -o RACK/rack-box/files/semtk.tar.gz
curl -LSfs https://github.com/ge-semtk/semtk/releases/download/v2.5.0-20221014/semtk-opensource-v2.5.0-20221014-dist.tar.gz -o RACK/rack-box/files/semtk.tar.gz
- name: Download CSS stylesheet
shell: bash
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/release.yml
Expand Up @@ -111,12 +111,20 @@ jobs:

# Won't work since windows-latest doesn't support nested virtualization
- name: Enable Hyper-V
if: matrix.builder == 'hyperv' && matrix.os == 'windows-latest'
if: matrix.builder == 'hyperv'
shell: powershell
run: |
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
Add-WindowsFeature RSAT-Hyper-V-Tools -IncludeAllSubFeature
# Download vagrant box in order to build virtualbox image
- name: Download Vagrant Box
if: matrix.builder == 'virtualbox'
run: |
mkdir -p RACK/rack-box/focal64
curl -LOSfs https://app.vagrantup.com/ubuntu/boxes/focal64/versions/20221021.0.0/providers/virtualbox.box
tar -xf virtualbox.box -C RACK/rack-box/focal64
- name: Build rack-box ${{ matrix.builder }} image
run: |
b=${{ matrix.builder }}
Expand Down Expand Up @@ -150,7 +158,7 @@ jobs:
b=${{ matrix.builder }}
v=${{ github.event.release.tag_name }}
cd RACK/rack-box
mv output-$b-iso rack-box-$b-$v
mv output-$b-* rack-box-$b-$v
zip -r rack-box-$b-$v.zip rack-box-$b-$v
split -b 1500m rack-box-$b-$v.zip rack-box-$b-$v.zip
ls -l rack-box-$b-$v.zip??
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -59,6 +59,7 @@ TODO.org
debug.log
*.swp
cli/env/
cli/.project
.settings/
/Turnstile-Example/Turnstile-IngestionPackage/CounterApplicationImplementation/*.d
/Turnstile-Example/Turnstile-IngestionPackage/CounterApplicationImplementation/*.rack
Expand Down
66 changes: 54 additions & 12 deletions Boeing-Ontology/ontology/Boeing.sadl
Expand Up @@ -68,20 +68,61 @@ SoftwareCoding is a type of CODE_DEVELOPMENT.
// Support for characterizing message types, valid signals, and tests
// that verify these correspondences

Message is a type of DATA_DICTIONARY_TERM.
Message is a type of INTERFACE.

Signal is a type of DATA_DICTIONARY_TERM.
enumValue describes Signal with values of type string.

MessageSignal is a type of DATA_DICTIONARY_TERM.
message describes MessageSignal with a single value of type Message.
signal describes MessageSignal with a single value of type Signal.

IDD is a type of INTERFACE.
messageSignal describes IDD with values of type MessageSignal.

IDD_Test is a type of TEST.
verifies of IDD_Test only has values of type MessageSignal.
message describes Signal with a single value of type Message.

// content of IDD_Doc can be Message and other things
IDD_Doc is a type of DOCUMENT.

// subclass from core ontology related to SBVT and IDD
SBVT_Test_Procedure is a type of TEST_PROCEDURE.
content of SBVT_Test only has values of type SBVT_Test_Step.
verifies of SBVT_Test_Procedure only has values of type {SubDD_Req or SRS_Req}.
verifies of SBVT_Test_Procedure has at least 1 value.

SBVT_Test_Step is a type of TEST_STEP.
stimulates of SBVT_Test_Step has values of type Signal. //<--how come "only has values" doesn't work here?
nextStep of SBVT_Test_Step only has values of type SBVT_Test_Step.

IDD_Test is a type of TEST. // note "verifies" corresponds to "observes"
// verifies of IDD_Test only has values of type Signal.
observes of IDD_Test has values of type Signal. //<--how come "only has values" doesn't work here?

//SBVT_Test_Step can contain HMI test etc.
SBVT_Test_Log is a type of TEST_LOG.
content of SBVT_Test_Log only has values of type SBVT_Test_Record.
SBVT_Test_Record is a type of TEST_RECORD.
logs of SBVT_Test_Record only has values of type SBVT_Test_Step.
IDD_Test_Result is a type of TEST_RESULT.
confirms of IDD_Test_Result only has values of type IDD_Test.

IDDCoverageAnalysis is a type of ANALYSIS. // move it to "ToolOntology"
analysisInput of IDDCoverageAnalysis only has values of type IDD_Test.
IDDCoverageAnalysisResult is a type of TEST_RESULT.
confirms of IDDCoverageAnalysisResult only has values of type IDD_Test.

Test_Station is a type of AGENT.

SBVT_Test_Execution is a type of TEST_EXECUTION.
testProcedure of SBVT_Test_Execution only has values of type SBVT_Test_Procedure.
systemUnderTest describes SBVT_Test_Execution with values of type SYSTEM.
systemUnderTestBuildVersion describes SBVT_Test_Execution with values of type BuildVersion. //added
databaseVersion describes SBVT_Test_Execution with values of type Database.
databaseVersion is a type of used.
// softwareBuild describes SBVT_Test_Execution with values of type Executable.
// softwareBuild is a type of used.
testStation of SBVT_Test_Execution has a single value of type Test_Station.
testStation is a type of wasAssociatedWith.
BuildVersion is a type of ENTITY.
system describes BuildVersion with a single value of type SYSTEM.
buildVersion describes BuildVersion with a single value of type Executable.
testExecution of SBVT_Test_Log has a single value of type SBVT_Test_Execution.
testExecution is a type of wasGeneratedBy.

Database is a type of SWCOMPONENT.
Executable is a type of SWCOMPONENT.

// COMMON FILE FORMATS

Expand All @@ -93,6 +134,7 @@ YamlFormat (note "Yet Another Markup Language file format") is a FORMAT ide
JsonFormat (note "JavaScript Object Notation file format") is a FORMAT identifier "json".
TomlFormat (note "Tom's Obvious Minimal Language file format") is a FORMAT identifier "toml".
IniFormat (note "Initialization configuration file format") is a FORMAT identifier "ini".
OutFormat (note "Text file output, e.g. output of test results") is a FORMAT with identifier "out".

// Image formats
SvgFormat (note "Scalable Vector Graphics image file format") is a FORMAT identifier "svg".
Expand Down
56 changes: 28 additions & 28 deletions GE-Ontology/OwlModels/ont-policy.rdf
Expand Up @@ -2,49 +2,49 @@
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:j.0="http://jena.hpl.hp.com/schemas/2003/03/ont-manager#">
<j.0:OntologySpec>
<j.0:sadlSourceURL>platform:/resource/GE-Ontology/ontology/CPS.sadl</j.0:sadlSourceURL>
<j.0:prefix>CPS</j.0:prefix>
<j.0:createdBy>SADL</j.0:createdBy>
<j.0:publicURI rdf:resource="http://arcos.turnstile/GE"/>
<j.0:altURL rdf:resource="file:/RACK/GE-Ontology/OwlModels/GE.owl"/>
<j.0:language rdf:resource="http://www.w3.org/2002/07/owl"/>
<j.0:altURL rdf:resource="file:/RACK/GE-Ontology/OwlModels/CPS.owl"/>
<j.0:publicURI rdf:resource="http://arcos.rack/CPS"/>
<j.0:createdBy>SADL</j.0:createdBy>
<j.0:prefix>turnstile</j.0:prefix>
<j.0:sadlSourceURL>platform:/resource/GE-Ontology/ontology/GE.sadl</j.0:sadlSourceURL>
</j.0:OntologySpec>
<j.0:OntologySpec>
<j.0:publicURI rdf:resource="http://sadl.org/sadlimplicitmodel"/>
<j.0:prefix>sadlimplicitmodel</j.0:prefix>
<j.0:createdBy>SADL</j.0:createdBy>
<j.0:language rdf:resource="http://www.w3.org/2002/07/owl"/>
<j.0:altURL rdf:resource="file:/RACK/GE-Ontology/OwlModels/SadlImplicitModel.owl"/>
<j.0:sadlSourceURL>platform:/resource/GE-Ontology/ImplicitModel/SadlImplicitModel.sadl</j.0:sadlSourceURL>
<j.0:altURL rdf:resource="file:/RACK/GE-Ontology/OwlModels/SadlImplicitModel.owl"/>
<j.0:language rdf:resource="http://www.w3.org/2002/07/owl"/>
<j.0:createdBy>SADL</j.0:createdBy>
<j.0:prefix>sadlimplicitmodel</j.0:prefix>
<j.0:publicURI rdf:resource="http://sadl.org/sadlimplicitmodel"/>
</j.0:OntologySpec>
<j.0:OntologySpec>
<j.0:prefix>sadllistmodel</j.0:prefix>
<j.0:createdBy>SADL</j.0:createdBy>
<j.0:sadlSourceURL>platform:/resource/GE-Ontology/ontology/CPS.sadl</j.0:sadlSourceURL>
<j.0:altURL rdf:resource="file:/RACK/GE-Ontology/OwlModels/CPS.owl"/>
<j.0:language rdf:resource="http://www.w3.org/2002/07/owl"/>
<j.0:altURL rdf:resource="file:/RACK/GE-Ontology/OwlModels/SadlListModel.owl"/>
<j.0:publicURI rdf:resource="http://sadl.org/sadllistmodel"/>
<j.0:createdBy>SADL</j.0:createdBy>
<j.0:prefix>CPS</j.0:prefix>
<j.0:publicURI rdf:resource="http://arcos.turnstile/CPS"/>
</j.0:OntologySpec>
<j.0:OntologySpec>
<j.0:publicURI rdf:resource="http://sadl.org/builtinfunctions"/>
<j.0:prefix>builtinfunctions</j.0:prefix>
<j.0:createdBy>SADL</j.0:createdBy>
<j.0:publicURI rdf:resource="http://sadl.org/sadlbasemodel"/>
<j.0:altURL rdf:resource="file:/RACK/GE-Ontology/OwlModels/SadlBaseModel.owl"/>
<j.0:language rdf:resource="http://www.w3.org/2002/07/owl"/>
<j.0:altURL rdf:resource="file:/RACK/GE-Ontology/OwlModels/SadlBuiltinFunctions.owl"/>
<j.0:sadlSourceURL>platform:/resource/GE-Ontology/ImplicitModel/SadlBuiltinFunctions.sadl</j.0:sadlSourceURL>
<j.0:createdBy>SADL</j.0:createdBy>
<j.0:prefix>sadlbasemodel</j.0:prefix>
</j.0:OntologySpec>
<j.0:OntologySpec>
<j.0:sadlSourceURL>platform:/resource/GE-Ontology/ontology/GE.sadl</j.0:sadlSourceURL>
<j.0:prefix>turnstile</j.0:prefix>
<j.0:createdBy>SADL</j.0:createdBy>
<j.0:publicURI rdf:resource="http://sadl.org/sadllistmodel"/>
<j.0:altURL rdf:resource="file:/RACK/GE-Ontology/OwlModels/SadlListModel.owl"/>
<j.0:language rdf:resource="http://www.w3.org/2002/07/owl"/>
<j.0:altURL rdf:resource="file:/RACK/GE-Ontology/OwlModels/GE.owl"/>
<j.0:publicURI rdf:resource="http://arcos.turnstile/GE"/>
<j.0:createdBy>SADL</j.0:createdBy>
<j.0:prefix>sadllistmodel</j.0:prefix>
</j.0:OntologySpec>
<j.0:OntologySpec>
<j.0:prefix>sadlbasemodel</j.0:prefix>
<j.0:createdBy>SADL</j.0:createdBy>
<j.0:sadlSourceURL>platform:/resource/GE-Ontology/ImplicitModel/SadlBuiltinFunctions.sadl</j.0:sadlSourceURL>
<j.0:altURL rdf:resource="file:/RACK/GE-Ontology/OwlModels/SadlBuiltinFunctions.owl"/>
<j.0:language rdf:resource="http://www.w3.org/2002/07/owl"/>
<j.0:altURL rdf:resource="file:/RACK/GE-Ontology/OwlModels/SadlBaseModel.owl"/>
<j.0:publicURI rdf:resource="http://sadl.org/sadlbasemodel"/>
<j.0:createdBy>SADL</j.0:createdBy>
<j.0:prefix>builtinfunctions</j.0:prefix>
<j.0:publicURI rdf:resource="http://sadl.org/builtinfunctions"/>
</j.0:OntologySpec>
</rdf:RDF>
2 changes: 1 addition & 1 deletion GE-Ontology/ontology/CPS.sadl
Expand Up @@ -75,7 +75,7 @@ Connection (note "An INTERFACE with specific input and output ports") is a type
described by infoFlowSeverity with a single value of type int

// properties that allow for mitigating of threats
described by implControl with values of type ImplControl.
described by implConnControl with values of type ImplControl.

ConnectionType is a type of THING.

Expand Down
8 changes: 4 additions & 4 deletions RACK-Ontology/ontology/CONFIDENCE.sadl
Expand Up @@ -22,7 +22,7 @@ uri "http://arcos.rack/CONFIDENCE" alias CONFIDENCE.
import "http://arcos.rack/PROV-S".


CONFIDENCE_ASSESSMENT (note "Superclass for confidence assessments over some other data in the ontology.") is a type of THING.
CONFIDENCE_ASSESSMENT (note "Superclass for confidence assessments over some other data in the ontology.") is a type of ENTITY.

assesses (note "ENTITY(s) whose confidence is assessed") describes CONFIDENCE_ASSESSMENT with values of type ENTITY.
assesses describes CONFIDENCE_ASSESSMENT with at most 1 value.
Expand All @@ -31,8 +31,8 @@ CONFIDENCE_ASSESSMENT (note "Superclass for confidence assessments over some oth
wasGeneratedBy of CONFIDENCE_ASSESSMENT only has values of type ASSESSING_CONFIDENCE.

BDU_CONFIDENCE_ASSESSMENT (note "A belief-disbelief-uncertainty confidence assessment, c.f. Subjective Logic. belief, disbelief, and uncertainty should sum to 1") is a type of CONFIDENCE_ASSESSMENT.
belief (note "belief that an assessment is true") describes CONFIDENCE_ASSESSMENT with a single value of type float. // [0,1].
disbelief (note "belief that an assessment is false") describes CONFIDENCE_ASSESSMENT with a single value of type float. // [0,1].
uncertainty (note "uncommitted belief") describes CONFIDENCE_ASSESSMENT with a single value of type float. // [0,1].
belief (note "belief that an assessment is true") describes BDU_CONFIDENCE_ASSESSMENT with a single value of type float. // [0,1].
disbelief (note "belief that an assessment is false") describes BDU_CONFIDENCE_ASSESSMENT with a single value of type float. // [0,1].
uncertainty (note "uncommitted belief") describes BDU_CONFIDENCE_ASSESSMENT with a single value of type float. // [0,1].

ASSESSING_CONFIDENCE (note "ACTIVITY that establishes a CONFIDENCE_ASSESSMENT") is a type of ACTIVITY.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -6,7 +6,7 @@ can be found [here](https://github.com/ge-high-assurance/RACK/wiki#log4j-securit

# Introducing RACK

RACK (Rapid Assurance Curation Kit) is a research-grade database that uses a structured semantic data model tuned to the domain of the DARPA ARCOS (Automated Rapid Certification Of Software) program.
RACK (Rapid Assurance Curation Kit) is a research-grade database that uses a structured semantic data model tuned to the domain of the DARPA ARCOS (Automated Rapid Certification Of Software) program. Additionally, we offer a suite of tools for data curation and assurance interpretation.

<img src="https://github.com/ge-high-assurance/RACK/wiki/images/RACK_cartoon.jpg" alt="RACK Overview Diagram" width="300" align="middle">

Expand All @@ -21,7 +21,7 @@ To make RACK easy for all ARCOS performers to use, we deploy RACK as a software
RACK is available as both a Linux container and a virtual machine, and is supported on Linux, Windows, and MacOS systems. To learn more and get detailed instructions on how to get started, see our [Installation Instructions](https://github.com/ge-high-assurance/RACK/wiki/Home#installation-instructions).

---
Copyright (c) 2021, General Electric Company, Galois, Inc.
Copyright (c) 2021-2022 General Electric Company, Galois, Inc.

All Rights Reserved

Expand Down
28 changes: 28 additions & 0 deletions Turnstile-Example/Turnstile-IngestionPackage/manifest.yaml
@@ -0,0 +1,28 @@
name: "Turnstile"

footprint:
model-graphs:
- http://rack001/model
data-graphs:
- http://rack001/turnstiledata
- http://rack001/do-178c

steps:
- manifest: ../../manifests/turnstile.yaml
- data: CounterApplicationUnitTesting/OwlModels/import.yaml
- data: TurnstileDevelopmentPlanData/import.yaml
- data: PlanningDocuments/import.yaml
- data: HazardAssessment/import.yaml
- data: TurnstileSystemDesign/import.yaml
- data: TurnstileSystemRequirements/import.yaml
- data: TurnstileHighLevelRequirements/import.yaml
- data: TurnstileLowLevelRequirements/import.yaml
- data: TurnstileRequirementModel/import.yaml
- data: CounterApplicationReviews/import.yaml
- data: CounterApplicationTesting/import.yaml
- data: TurnstileSystemSpec/import.yaml
- data: CounterApplicationRequirementSpec/import.yaml
- data: CounterApplicationSoftwareDes/import.yaml
- data: SystemVerificationReport/import.yaml
- data: Objectives/import.yaml
- data: TurnstileBaselines/import.yaml
54 changes: 46 additions & 8 deletions assist/bin/rack/check.pl
Expand Up @@ -117,17 +117,16 @@
print_message(error, maybe_restriction(T, I, IName, Property, VSLen))).

check_target_type(Property, I, T) :-
property_extra(T, Property, _Restr),
rdf(Property, rdfs:range, TTy),
rdf_reachable(Target, rdfs:subClassOf, TTy),
property(T, Property, _),
\+ rdf_is_bnode(T),
has_interesting_prefix(Property),
rdf(I, Property, Val),
\+ rdf_is_literal(Val), % TODO check these as well?
rdf(Val, rdf:type, DefTy),
DefTy \= Target,
\+ rdf_reachable(DefTy, rdfs:subClassOf, Target),
\+ rdf_is_literal(Val),
\+ rack_instance_target(I, Property, Val),
rack_instance_ident(I, IName),
print_message(error, property_value_wrong_type(T, I, IName, Property, DefTy, Val, Target)).
rdf(Val, rdf:type, ValTy),
property_range_type(T, Property, ModelTy),
print_message(error, property_value_wrong_type(T, I, IName, Property, ValTy, Val, ModelTy)).

check_target_type_restrictions(Property, I, T) :-
rdf(T, rdfs:subClassOf, R),
Expand Down Expand Up @@ -228,6 +227,39 @@
check_also_has_no_rel(_, _).


% Sometimes there will be things in SADL like:
%
% FOO is a type of X.
% p of FOO only has values of type Y.
%
% and the problem is that p is not defined for X, but for (unrelated) Z instead.
% SADL will not complain and will generate a property constraint, but that
% property cannot ever exist. This checks for that situation.
check_invalid_domain(Property) :-
check_invalid_domain_class(_SrcClass, Property, _DefinedClass).

check_invalid_domain_class(SrcClass, Property, DefinedClass) :-
rdf(SrcClass, _, B),
rack_ref(_, SrcClass),
rdf_is_bnode(B),
rdf(B, rdf:type, owl:'Restriction'),
rdf(B, owl:onProperty, Property),
rdf(Property, rdfs:domain, DefinedClass),
\+ rdf_reachable(SrcClass, rdfs:subClassOf, DefinedClass),
print_message(error, invalid_domain(SrcClass, Property, DefinedClass)).

check_invalid_domain_class(SrcClass, Property, DefinedClass) :-
property(SrcClass, Property, _Usage),
rdf_reachable(Property, rdfs:subPropertyOf, ParentProp),
property(DefinedClass, ParentProp, _ParentUsage),
\+ rdf_reachable(SrcClass, rdfs:subClassOf, DefinedClass),
( Property = ParentProp,
print_message(error, invalid_domain(SrcClass, Property, DefinedClass))
; Property \= ParentProp,
print_message(error, invalid_subclass_domain(SrcClass, Property, ParentProp, DefinedClass))
).


actual_val((V^^VT),VT,(V^^VT)). % normal
actual_val(V,VT,Val) :-
rdf_equal(V, VS^^(xsd:string)),
Expand Down Expand Up @@ -352,3 +384,9 @@
prolog:message(missing_tgt(SrcClass, SrcInst, SrcIdent, Rel, TgtClass)) -->
[ '~w ~w (~w) missing the ~w target of type ~w'-[
SrcClass, SrcInst, SrcIdent, Rel, TgtClass] ].
prolog:message(invalid_domain(SrcClass, Property, DefinedClass)) -->
[ 'Property ~w was referenced on class ~w, but that property is defined for the unrelated class ~w'-[
Property, SrcClass, DefinedClass] ].
prolog:message(invalid_subclass_domain(SrcClass, Property, ParentProperty, DefinedClass)) -->
[ 'Property ~w was referenced on class ~w, but that property is a sub-type of ~w, which is defined for the unrelated class ~w'-[
Property, SrcClass, ParentProperty, DefinedClass] ].
3 changes: 3 additions & 0 deletions assist/bin/rack/check_runner.pl
Expand Up @@ -55,6 +55,9 @@
check_each_with(check_instance_types, Num).
runnable_check("instance property issues", Num) :-
check_each_with(check_instance_property_violations, Num).
runnable_check("property domain issues", Num) :-
check_each_with(check_invalid_domain, Num).

runnable_check("INTERFACE issues", Num) :- check_each_with(check_INTERFACE, Num).
runnable_check("SBVT issues", Num) :- check_each_with(check_SBVT, Num).
runnable_check("SRS issues", Num) :- check_each_with(check_SRS, Num).
Expand Down

0 comments on commit 90ef0c8

Please sign in to comment.