Skip to content

Commit

Permalink
Init Commit -Engineering Model Migration
Browse files Browse the repository at this point in the history
doc2vec model not added
  • Loading branch information
audreyberquand committed Oct 2, 2020
1 parent 35d6e26 commit 27740cb
Show file tree
Hide file tree
Showing 8 changed files with 6,879 additions and 0 deletions.
80 changes: 80 additions & 0 deletions EngineeringModelsMigration/EMRules.gql
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# This Source Code Form is subject to the terms of the Mozilla Public ---------------------
# License, v. 2.0. If a copy of the MPL was not distributed with this ---------------------
# file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -----------------------------
# ---------------- Copyright (C) 2020 University of Strathclyde and Author ----------------
# -------------------------------- Author: Audrey Berquand --------------------------------
# ------------------------- e-mail: [email protected] --------------------------

# Define a set of rules for extracting knowledge from Engineering Models extracted from
# OCDT or RHEA CDP4
# Includes: Two rules to generate a "isIncludedInMassBudget" relationship
# the entities "Option" and "ParameterValueSet" are also refedined to play roles in the inferred relationship.
# Code adapted to Grakn 1.8.0

define

Option sub DefinedThing,
plays contains_nestedElement,
plays iscontained_option,
plays refers_category,
plays isrefered_excludeOption,
plays isrefered_defaultOption,
plays isrefered_actualOption,
plays budgetHolder,
plays isrefered_NoactualOption;

ParameterValueSet sub ParameterValueSetBase,
plays iscontained_valueSet,
plays isrefered_parameterValueSet,
plays elementOfBudget,
plays refers_NoactualOption;

includedInMassBudget sub relation ,
relates budgetHolder,
relates elementOfBudget ;

MassBudget1 sub rule,
when {
## the condition
# there is a ParameterValueSet
$x isa ParameterValueSet;
# The ParameterValueSet refers to a Parameter, which is OptionDependent
$y isa Parameter, has isOptionDependent 'True';
(contains_valueSet: $y, iscontained_valueSet:$x) isa Containement_valueSet;
# Which itself refers to a SimpleQuantityKind of type mass
$z isa SimpleQuantityKind, has name "mass";
(refers_parameterType: $y, isrefered_parameterType:$z) isa Reference_parameterType;
# which refers to an actual Option
$w isa Option;
($x, $w) isa Reference_actualOption;
# we verify that this parameter is linked to a mass quantity:

}, then {
## the ParameterValueSet is included in the Mass Budget of this Option
(budgetHolder:$w, elementOfBudget: $x) isa includedInMassBudget;
};

MassBudgetRule2 sub rule,
when {
## the condition
# there is a ParameterValueSet
$x isa ParameterValueSet;
# The ParameterValueSet refers to a Parameter
$y isa Parameter,has isOptionDependent 'False';
(contains_valueSet: $y, iscontained_valueSet:$x) isa Containement_valueSet;
# Which itself refers to a SimpleQuantityKind of type mass
$z isa SimpleQuantityKind, has name "mass";
(refers_parameterType: $y, isrefered_parameterType:$z) isa Reference_parameterType;
# there is an ElementUsage
$e isa ElementUsage;
# which refers to an ElementDefinition,
$d isa ElementDefinition;
(refers_elementDefinition:$e, isrefered_elementDefinition: $d) isa Reference_elementDefinition;
# which contains our Parameter
(contains_parameter:$d, iscontained_parameter: $y) isa Containement_parameter;
$w isa Option;
not{(refers_excludeOption:$e, isrefered_excludeOption: $w) isa Reference_excludeOption;};
}, then {
## the ParameterValueSet is included in the Option Mass Budget
(budgetHolder:$w, elementOfBudget: $x) isa includedInMassBudget;
};
Loading

0 comments on commit 27740cb

Please sign in to comment.