OSDC.DotnetLibraries.Drilling.DrillingProperties
10.1.14
See the version list below for details.
dotnet add package OSDC.DotnetLibraries.Drilling.DrillingProperties --version 10.1.14
NuGet\Install-Package OSDC.DotnetLibraries.Drilling.DrillingProperties -Version 10.1.14
<PackageReference Include="OSDC.DotnetLibraries.Drilling.DrillingProperties" Version="10.1.14" />
paket add OSDC.DotnetLibraries.Drilling.DrillingProperties --version 10.1.14
#r "nuget: OSDC.DotnetLibraries.Drilling.DrillingProperties, 10.1.14"
// Install OSDC.DotnetLibraries.Drilling.DrillingProperties as a Cake Addin #addin nuget:?package=OSDC.DotnetLibraries.Drilling.DrillingProperties&version=10.1.14 // Install OSDC.DotnetLibraries.Drilling.DrillingProperties as a Cake Tool #tool nuget:?package=OSDC.DotnetLibraries.Drilling.DrillingProperties&version=10.1.14
Background
This package is developed as part of the Society of Petroleum (SPE) Open Source Drilling Community, a sub-committee of the Drilling System Automation Technical Section.
Purpose
The purpose of this package is to provide a way to describe drilling properties and their uncertainty. There are also Attributes that allow to decorate the properties. There is also a function to generate a dictionary of the decorations associated with the drilling properties that can therefore be serialized in json.
Principles
There are two groups of drilling properties:
- the continuous drilling properties
- the discrete drilling properties
A DrillingProperty
is an abstract class.
classDiagram
DrillingProperty <|-- ContinuousDrillingProperty
DrillingProperty <|-- DiscreteDrillingProperty
Continuous Drilling Properties
A ContinuousDrillingProperty
is an abstract class that defines one property: Value
. A Value
is a ContinuousDistribution
and therefore represents any continuous probability distrutions. ContinuousDistribution
and other probability distributions are defined
in OSDC.DotnetLibraries.General.Statistics
, which is available as a nuget on nuget.org
(see here). ContinuousDrillingProperty
has a method called Realize
that is used to draw a value (double?
) using the
probability distribution defined in Value
. It may return null
.
ContinuousDrillingProperty
has four direct sub-classes:
ScalarDrillingProperty
: used to represent a scalar value with no uncertainty. The value is maintained as aDiracDistribution
. There is a redefinition of theValue
property which is strongly typed toDiracDistribution
. It is calledDiracDistributionValue
. TheValue
property points to the value contained inDiracDistrutionValue
. TheRealize
method always returns the value of theDiracDistribution
ornull
if the value is not defined. So theScalarDrillingProperty
is equivalent to a fixed value. A convenience property is defined and is calledScalarValue
. It allows to directly access theValue
of theDiracDistribution
.GaussianDrillingProperty
: used to represent normal distributions defined by aMean
and aStandardDeviation
. The probability distribution is defined as aGaussianDistribution
. In order to benefits from strong typing, a property calledGaussianValue
is defined of the typeGaussianDistribution
. TheValue
property is redefined to point to the instance managed byGaussianValue
. TheRealize
method produces values between -∞ and +∞ with a mean value corresponding to theMean
of theGaussianValue
and with a standard deviation also defined in theGaussianValue
. For conveniance, there are two additional properties that are defined:Mean
andStandardDeviation
. They allow to access directly theMean
and theStandardDeviation
(respectively) of theGaussianValue
.SensorDrillingProperty
: used to represent normal distributions for a sensor. Often, the characteristics of the sensor are given with anAccuracy
and aPrecision
. The overall standard deviation is calculated as $\sqrt{\sigma^2{_a}+\sigma^2{_p}}$ where $\sigma_a$ is the accuracy and $\sigma_p$ is the precision. AMean
property is defined locally. It is a synonym of theMean
value of the underlying Gaussian probability distribution, which is still accessible through the propertyGaussianValue
.FullScaleDrillingProperty
: used to represent normal distributions for a sensor. Here, the characteristics of the sensor are given with a proportion of the full-scale range of the measurement. The propertyProportionError
contains a value between 0 and 1. The propertyFullScale
contains the max range for the measurement. The standard deviation of the Gaussian probability distribution is the product of theProportionError
by theFullScale
. AMean
property is defined locally. It is a synonym of theMean
value of the underlying Gaussian probability distribution, which is still accessible through the propertyGaussianValue
.
UniformDrillingProperty
: used to represent a uniform distritution between two values,Min
andMax
. The probability distribution is defined as aUniformDistribution
. A property of typeUniformDistribution
is defined:UniformValue
. The propertyValue
is redefined to point to the instance managed byUniformValue
. The realize method draws uniformely values in betweenMin
andMax
. There are two properties that are defined for convenience:Min
andMax
. They allow, respectively, to access theMin
and theMax
of theUniformDistribution
.GeneralDistributionDrillingProperty
: used to represent a general probability distribution managed as a histogram. The value is defined by aGeneralContinuousDistribution
and accessible using the propertyGeneralDistributionValue
. TheValue
property is redefined to point to the instance managed byGeneralDistributionValue
. TheGeneralContinuousDistribution
can be defined either by a data set stored inData
. In that case, an histogram is generated from the data set, which is stored inFunction
. Or directly as a given histogram stored inFunction
. An histogram is represented as an array ofTuple<double, double>
for whichItem1
is the value of the bin andItem2
is the probability of the bin. There is an additional property, defined for convinience, to access directly theFunction
of theGeneralContinuousDistribution
. It is calledHistogram
.
classDiagram
ContinuousDrillingProperty <|-- ScalarDrillingProperty
ContinuousDrillingProperty <|-- GaussianDrillingProperty
ContinuousDrillingProperty <|-- UniformDrillingProperty
ContinuousDrillingProperty <|-- GeneralDistributionDrillingProperty
ContinuousDrillingProperty : +ContinuousDistribution Value
ContinuousDrillingProperty : +double? Realize()
class ScalarDrillingProperty {
+DiracDistribution DiracDistributionValue
}
class GaussianDrillingProperty {
+GaussianDistribution GaussianValue
+double? Mean
+double? StandardDeviation
}
GaussianDrillingProperty <|-- SensorDrillingProperty
GaussianDrillingProperty <|-- FullScaleDrillingProperty
class SensorDrillingProperty {
+double? Accuracy
+double? Precision
}
class FullScaleDrillingProperty {
+double? FullScale
+double? ProportionError
}
class UniformDrillingProperty {
+UniformDistribution UniformValue
+double? Min
+double? Max
}
class GeneralDistributionDrillingProperty {
+GeneralContinuousDistribution GeneralDistributionValue
+Tuple<double, double>[]? Histogram
}
end
Example
Here is an example.
using OSDC.DotnetLibraries.Drilling.DrillingProperties;
using System.Globalization;
namespace DrillingProperties
{
class TestClass
{
public ScalarDrillingProperty Value1 { get; set; } = new ScalarDrillingProperty();
public UniformDrillingProperty Value2 { get; set; } = new UniformDrillingProperty();
public GaussianDrillingProperty Value3 { get; set; } = new GaussianDrillingProperty();
public GeneralDistributionDrillingProperty Value4 { get; set; } = new GeneralDistributionDrillingProperty();
public SensorDrillingProperty Value5 { get; set; } = new SensorDrillingProperty();
public FullScaleDrillingProperty Value6 { get; set; }= new FullScaleDrillingProperty();
}
class Example
{
static void Main()
{
TestClass testClass = new TestClass();
testClass.Value1.ScalarValue = 1.0;
testClass.Value2.Min = -1.0;
testClass.Value2.Max = 1.0;
testClass.Value3.Mean = 10.0;
testClass.Value3.StandardDeviation = 0.5;
testClass.Value4.Histogram = new Tuple<double, double>[] {
new Tuple<double, double>(0.0, 0.1),
new Tuple<double, double>(1.0, 0.2),
new Tuple<double, double>(2.0, 0.3),
new Tuple<double, double>(3.0, 0.4)
};
testClass.Value5.Accuracy = 0.1;
testClass.Value5.Precision = 0.01;
testClass.Value5.Mean = 1.0;
testClass.Value6.FullScale = 10.0;
testClass.Value6.ProportionError = 0.001;
testClass.Value6.Mean = 1.0;
for (int i = 0; i < 10; i++)
{
Realize(testClass);
}
}
static void Realize(TestClass testClass)
{
double? value1 = testClass.Value1.Realize();
double? value2 = testClass.Value2.Realize();
double? value3 = testClass.Value3.Realize();
double? value4 = testClass.Value4.Realize();
double? value5 = testClass.Value5.Realize();
double? value6 = testClass.Value6.Realize();
Console.WriteLine("Realized values:" +
" value1 = " + value1?.ToString("F", CultureInfo.InvariantCulture) +
" value2 = " + value2?.ToString("F", CultureInfo.InvariantCulture) +
" value3 = " + value3?.ToString("F", CultureInfo.InvariantCulture) +
" value4 = " + value4?.ToString("F", CultureInfo.InvariantCulture) +
" value5 = " + value5?.ToString("F", CultureInfo.InvariantCulture) +
" value6 = " + value6?.ToString("F", CultureInfo.InvariantCulture));
}
}
}
The execution of the program gives:
Realized values: value1 = 1.00 value2 = 0.58 value3 = 10.14 value4 = 2.98 value5 = 0.93 value6 = 1.01
Realized values: value1 = 1.00 value2 = 0.12 value3 = 10.75 value4 = 1.22 value5 = 0.85 value6 = 0.99
Realized values: value1 = 1.00 value2 = -0.98 value3 = 10.76 value4 = 2.40 value5 = 0.95 value6 = 0.99
Realized values: value1 = 1.00 value2 = -0.23 value3 = 9.05 value4 = 2.65 value5 = 1.01 value6 = 1.01
Realized values: value1 = 1.00 value2 = 0.51 value3 = 10.45 value4 = 0.74 value5 = 1.09 value6 = 0.99
Realized values: value1 = 1.00 value2 = -0.83 value3 = 10.35 value4 = 1.65 value5 = 0.98 value6 = 0.99
Realized values: value1 = 1.00 value2 = 0.06 value3 = 10.62 value4 = 1.48 value5 = 0.96 value6 = 1.01
Realized values: value1 = 1.00 value2 = 0.46 value3 = 10.11 value4 = 0.25 value5 = 0.77 value6 = 1.01
Realized values: value1 = 1.00 value2 = 0.38 value3 = 9.99 value4 = 0.96 value5 = 1.21 value6 = 1.00
Realized values: value1 = 1.00 value2 = 0.74 value3 = 9.61 value4 = 2.94 value5 = 0.95 value6 = 1.01
Discrete Drilling Properties
Similarly, there is an abstract class called DiscreteDrillingProperty
to describe booleans or enumerated values. It has also a property called Value
, which is a
DiscreteDistribution
. It has three direct sub-classes:
DeterministicBooleanDrillingProperty
: used to represent a boolean value with no uncertainty, i.e., deterministic. It defines a specific property calledDeterministicDiscreteProperty
that allows to access with the correct type the underlying statistical probability distribution. It has aProbability
property which returns the probability of the underlyingDeterministicDiscreteDistribution
for the target0
. It has also aBooleanValue
that defines the boolean state of the instance, which is deterministic for this class.CategoricalDrillingProperty
: used to represent a multinomial value with uncertainty. TheNumberOfStates
property defines how many state the drilling property can take. It should be at least 2. TheProbabilities
property defines the probability of each of the states. TheStateValue
tells which state has the largest probability. If assigned, then that state gets a probability of 1 and all the others a zero probability.BernoulliDrillingProperty
: used to represent a boolean value with an uncertainty. It is subclass ofCategoricalDrillingProperty
for which the number of states is 2. TheProbability
property is used to define the uncertainty. TheBooleanValue
property is true if theProbability
is greater than 0.5 and false otherwise.
classDiagram
DiscreteDrillingProperty <|-- DeterministicCategoricalDrillingProperty
DeterministicCategoricalDrillingProperty <|-- DeterministicBernoulliDrillingProperty
DiscreteDrillingProperty <|-- MultinomialDrillingProperty
MultinomialDrillingProperty <|-- CategoricalDrillingProperty
MultinomialDrillingProperty <|-- BinomialDrillingProperty
BinomialDrillingProperty <|-- BernoulliDrillingProperty
DiscreteDrillingProperty : +DiscreteDrillingDistribution Value
DiscreteDrillingProperty : +bool? Realize()
class DeterministicCategoricalDrillingProperty {
+DeterministicCategoricalDistribution DeterministicCategoricalValue
+uint? NumberOfStates
+uint? StateValue
}
class DeterministicBernoulliDrillingProperty {
+DeterministicBernoulliDistribution DeterministicBernoulliValue
+bool? BooleanValue
}
class MultinomialDrillingProperty {
+MultinomialDistribution MultinomialValue
+uint? NumberOfStates
+uint? NumberOfTrials
+double[]? Probabilities
+uint? StateValue
}
class BinomialDrillingProperty {
+BinomialDistribution BinomialValue
+double? Probability
+bool? BooleanValue
}
class CategoricalDrillingProperty {
+CategoricalDistribution CategoricalValue
}
class BernoulliDrillingProperty {
+BernoulliDistribution BernoulliValue
}
end
Providing Meta Information
There is the possibility to provide meta information with the declation of a DrillingProperty
or of a class
or a struct
.
In the case of a class
or a struct
, the meta information are associated with instances of these class
or struct
seen as if they were serialized, typically in json
. This is achieved using
specific attributes. The possible attributes are:
AccessToVariableAttribute
: It takes one argument of the typeCommonProperty.VariableAccessType
. This attribute is used to inform whether the property will be only fetched (CommonProperty.VariableAccessType.Readable
) or if it can be assigned (CommonProperty.VariableAccessType.Assignable
). In relation with the semantic definition of the property that is interpreted as the semantic will be turned into a sparql query (readable) or it will be used to inject the semantic in the DDHub (assignable).MandatoryAttribute
: It takes one argument of the typeCommonProperty.MandatoryType
. This attribute is used to inform whether the property is mandatory and in the affirmative in which context. The valueGeneral
means that it is always mandatory. The valueNone
means that it is always optional. Other values can be combined together using a logical "or", therefore allowing to state that the property can be mandatory in one or several context. Example contexts are:Mechanical
,Hydraulic
,Directional
, ... This attribute shall be defined only once for the property.SemanticFactAttribute
: It takes two, three or more arguments:Subject
,Verb
andObject
.Subject
andObject
belongs to either the enumerationNouns.Enum
or astring
, whileVerb
is a choice from the enumVerbs.Enum
. IfVerb
is ommitted then it is supposed to beBelongsToClass
and theObject
must be aNouns.Enum
. BothNouns.Enum
andVerbs.Enum
are defined in the libraryDWIS.Vocabulary.Schemas
which contains the vocabulary defined in the D-WIS project (see D-WIS.org). If there are more than three arguments, the additional one must come in pair and are strings. They correspond toattribute
andvalue
for theObject
. This attribute is used to defined a true assertion about that property. The use of astring
for theSubject
or theObject
is to refer to internal variables of the semantic definition. This attribute can be used multiple times therefore allowing to describe multiple facts about the property, i.e., a semantic network.OptionalFactAttribute
: It is a subclass ofSemanticFactAttribute
. When the property has an attributeAccessToVariableAttribute
that is set to readable, and therefore a sparql query will be generated to populate the value of the property, thenOptionalFactAttribute
may be dropped in the sparql query in case there are no matching data.OptionalFactAttribute
has an additional property calledGroupIndex
, abyte
. The purpose ofGroupIndex
is to state that a set ofOptionalFactAttribute
are bound together when they use the same value forGroupIndex
. This information is used to generate the multiple variant of Sparql queries that result from the combinatorial choices related to theOptionalFactAttribute
. It can also have both aParentGroupIndex
and aGroupIndex
. In that case, this is an option relative to theParentGroupIndex
option.ExcludeFact
andOptionalExcludeFact
are used to define facts that will exclude data in a SparQL query, meaning that if the fact is present then the query will not select this data. The difference betweenExcludeFact
andOptionalExcludeFact
is that anExcludeFact
is always tested while anOptionalExcludeFact
will be tested only for the optional group index.
SemanticDiracVariableAttribute
: It takes one argument that is the name used for aDrillingSignal
that will be used for theValue
of this property.SemanticGaussianVariableAttribute
: It takes 2 arguments or 3 arguments. The first one is the name of aDrillingSignal
used in the semantic facts that is used as theMean
value of this property. The second argument is the name of aDrillingSignal
used in the semantic facts and that is used as theStandardDeviation
value of this property. The third one is a default value for theStandardDeviation
.SemanticSensorVariableAttribute
: It takes 3 arguments. The three string arguments are respectively the variable names for theMean
,Precision
andAccuracy
.SemanticFullScaleAttribute
: It takes 3 arguments. The three string arguments are respectively the variable names for theMean
,FullScale
andProportionError
.SemanticUniformVariableAttribute
: It takes two arguments that are the names of aDrillingSignal
used in the semantic facts that are used as theMin
and theMax
value of this property.SemanticGeneralDistributionVariableAttribute
: It takes one argument that is the name of aDrillingSignal
used in the semantic facts to access theHistogram
value of this property.SemanticBernoulliVariableAttribute
: It takes one to three arguments. Thestring
arguments represent either the stochastic or the probabilistic variables that are used in the semantic facts. Adouble
argument is used to define a default deterministic uncertainty.SemanticCategoricalVariableAttribute
: It takes two arguments: the name of the variable, and the number of states.SemanticDeterministicCategoricalVariableAttribute
: It takes two arguments: the name of the variable and the number of states.SemanticDeterministicBernoulliVariableAttribute
: It takes one argument that is the name of aDrillingSignal
used in the semantic facts to describe the value aDeterministicBernoulliDrillingProperty
.SemanticExclusiveOrAttribute
: It takes at least 2 arguments. This attribute is used to defined a list of the optional semantic facts that are exclusive from each other's.
classDiagram
class AccessToVariableAttribute {
+CommonProperty.VariableAccessType AccessType
}
class MandatoryAttribute {
+CommonProperty.MandatoryType Mandatory
}
classDiagram
SemanticFactAttribute <|-- OptionalFactAttribute
SemanticFactAttribute : +Nouns.Enum? Subject
SemanticFactAttribute : +string? SubjectName
SemanticFactAttribute : +Verbs.Enum Verb
SemanticFactAttribute : +Nouns.Enum? Object
SemanticFactAttribute : +string? ObjectName
class OptionalFactAttribute {
+byte GroupIndex
}
SemanticFactAttribute <|-- ExcludeFactAttribute
class ExcludeFactAttribute {
}
OptionalFactAttribute <|-- OptionalExcludeFactAttribute
class OptionalExcludeFactAttribute {
}
class SemanticExclusiveOrAttribute {
+byte[]? ExclusiveOr
}
classDiagram
class SemanticDiracVariableAttribute {
+string? Value
}
class SemanticGaussianVariableAttribute {
+string? Mean
+string? StandardDeviation
+double? DefaultStandardDeviation
}
class SemanticUniformVariableAttribute {
+string? Min
+string? Max
}
class SemanticGeneralDistributionVariableAttribute {
+string? Histogram
}
class SemanticSensorVariableAttribute {
+string? MeanVariable
+string? PrecisionVariable
+string? AccuracyVariable
+double? DefaultPrecision
+double? DefaultAccuracy
}
class SemanticFullScaleVariableAttribute {
+string? MeanVariable
+string? FullScaleVariable
+string? PrecisionErrorVariable
+double? DefaultFullScale
+double? DefaultPrecisionError
}
classDiagram
class SemanticBernoulliVariableAttribute {
+string? ProbabilistVariable
+string? DeterministVariable
+double? DeterministDefaultUncertainty
}
class SemanticDeterministicCategoricalVariableAttribute {
+string? Variable
+uint? NumberOfStates
}
class SemanticDeterministicBernoulliVariableAttribute {
+string? Variable
}
class SemanticCategoricalVariableAttribute {
+sting? Variable
+uint? NumberOfStates
}
Example
Here is an example:
using OSDC.DotnetLibraries.Drilling.DrillingProperties;
using OSDC.UnitConversion.Conversion;
using OSDC.UnitConversion.Conversion.DrillingEngineering;
using DWIS.Vocabulary.Schemas;
namespace DrillingProperties
{
public class TestClass
{
[AccessToVariable(CommonProperty.VariableAccessType.Assignable)]
[Mandatory(CommonProperty.MandatoryType.General)]
[SemanticGaussianVariable("BitDepthValue#01", "BitDepthStandardDeviationValue#01")]
[SemanticFact("BitDepthValue#01", Nouns.Enum.DynamicDrillingSignal)]
[SemanticFact("BitDepth#01", Nouns.Enum.BitDepth)]
[SemanticFact("BitDepth#01", Verbs.Enum.IsOfMeasurableQuantity, DrillingPhysicalQuantity.QuantityEnum.Depth)]
[SemanticFact("BitDepth#01", Nouns.Enum.DerivedMeasurement)]
[SemanticFact("BitDepth#01", Verbs.Enum.HasDynamicValue, "BitDepthValue#01")]
[SemanticFact("BitDepth#01", Verbs.Enum.IsMechanicallyLocatedAt, "Bit#01")]
[SemanticFact("WGS84VerticalDatum", Nouns.Enum.WGS84VerticalLocation)]
[SemanticFact("VerticalDepthFrame", Nouns.Enum.VerticalDepthFrame)]
[SemanticFact("VerticalDepthFrame", Verbs.Enum.HasReferenceFrameOrigin, "WGS84VerticalDatum")]
[SemanticFact("BitDepth#01", Verbs.Enum.HasReferenceFrame, "VerticalDepthFrame")]
[SemanticFact("Bit#01", Nouns.Enum.DrillingBit)]
[SemanticFact("BitDepthStandardDeviation#01", Nouns.Enum.DrillingDataPoint)]
[SemanticFact("BitDepthStandardDeviationValue#01", Nouns.Enum.DynamicDrillingSignal)]
[SemanticFact("BitDepthStandardDeviation#01", Verbs.Enum.HasDynamicValue, "BitDepthStandardDeviationValue#01")]
[SemanticFact("GaussianUncertainty#01", Nouns.Enum.GaussianUncertainty)]
[SemanticFact("BitDepth#01", Verbs.Enum.HasUncertainty, "GaussianUncertainty")]
[SemanticFact("GaussianUncertainty#01", Verbs.Enum.HasUncertaintyStandardDeviation, "BitDepthStandardDeviation#01")]
public GaussianDrillingProperty MeasuredBitDepth { get; set; } = new GaussianDrillingProperty();
[AccessToVariable(CommonProperty.VariableAccessType.Readable)]
[Mandatory(CommonProperty.MandatoryType.PipeHandling| CommonProperty.MandatoryType.Mechanical | CommonProperty.MandatoryType.Hydraulic)]
[SemanticDiracVariable("BlockPositionSPValue#01")]
[SemanticFact("BlockPositionSPValue#01", Nouns.Enum.DynamicDrillingSignal)]
[SemanticFact("BlockPositionSPValue#01", Verbs.Enum.IsOfMeasurableQuantity, PhysicalQuantity.QuantityEnum.StandardLength)]
[SemanticFact("BlockPositionSP#01", Nouns.Enum.HookPosition)]
[SemanticFact("BlockPositionSP#01", Nouns.Enum.SetPoint)]
[SemanticFact("BlockPositionSP#01", Verbs.Enum.HasDynamicValue, "BlockPositionSPValue#01")]
[SemanticFact("DrillFloorDatum", Nouns.Enum.DerrickFloorVerticalLocation)]
[SemanticFact("VerticalDepthFrame", Nouns.Enum.VerticalDepthFrame)]
[SemanticFact("VerticalDepthFrame", Verbs.Enum.HasReferenceFrameOrigin, "DrillFloorDatum")]
[SemanticFact("BlockPositionSP#01", Verbs.Enum.HasReferenceFrame, "VerticalDepthFrame")]
[SemanticFact("BlockPositionSP#01", Verbs.Enum.IsMechanicallyLocatedAt, "Elevator#01")]
[SemanticFact("Elevator#01", Nouns.Enum.DrillPipeElevator)]
public ScalarDrillingProperty BlockPositionSetPoint { get; set;} = new ScalarDrillingProperty();
[AccessToVariable(CommonProperty.VariableAccessType.Assignable)]
[Mandatory(CommonProperty.MandatoryType.Mechanical | CommonProperty.MandatoryType.Hydraulic | CommonProperty.MandatoryType.MaterialTransport)]
[SemanticUniformVariable("TopOfStringVelocityUpwardMinValue#01", "TopOfStringVelocityUpwardMaxValue#01")]
[SemanticFact("TopOfStringVelocityUpward#01", Nouns.Enum.HookVelocity)]
[SemanticFact("TopOfStringVelocityUpward#01", Verbs.Enum.IsOfMeasurableQuantity, DrillingPhysicalQuantity.QuantityEnum.BlockVelocity)]
[SemanticFact("TopOfStringVelocityUpwardMin#01", Nouns.Enum.DrillingDataPoint)]
[SemanticFact("TopOfStringVelocityUpwardMax#01", Nouns.Enum.DrillingDataPoint)]
[SemanticFact("TopOfStringVelocityUpwardMinValue#01", Nouns.Enum.DynamicDrillingSignal)]
[SemanticFact("TopOfStringVelocityUpwardMaxValue#01", Nouns.Enum.DynamicDrillingSignal)]
[SemanticFact("TopOfStringVelocityUpwardMin#01", Verbs.Enum.HasDynamicValue, "TopOfStringVelocityUpwardMinValue#01")]
[SemanticFact("TopOfStringVelocityUpwardMax#01", Verbs.Enum.HasDynamicValue, "TopOfStringVelocityUpwardMaxValue#01")]
[SemanticFact("TopOfStringVelocityUpward#01", Nouns.Enum.Limit)]
[SemanticFact("TopOfStringVelocityUpward#01", Verbs.Enum.IsMechanicallyLocatedAt, Nouns.Enum.DrillString)]
[SemanticFact("TopOfStringVelocityUpward#01", Verbs.Enum.IsPhysicallyLocatedAt, Nouns.Enum.TopOfStringReferenceLocation)]
[SemanticFact("UniformUncertainty#01", Nouns.Enum.MinMaxUncertainty)]
[SemanticFact("TopOfStringVelocityUpward#01", Verbs.Enum.HasUncertainty, "UniformUncertainty#01")]
[SemanticFact("UniformUncertainty#01", Verbs.Enum.HasUncertaintyMin, "TopOfStringVelocityUpwardMin#01")]
[SemanticFact("UniformUncertainty#01", Verbs.Enum.HasUncertaintyMax, "TopOfStringVelocityUpwardMax#01")]
public UniformDrillingProperty TopOfStringSpeedUpwardLimit { get; set;} = new UniformDrillingProperty();
[AccessToVariable(CommonProperty.VariableAccessType.Readable)]
[Mandatory(CommonProperty.MandatoryType.None)]
[SemanticGeneralDistributionVariable("EstimatedBitDepthHistogramValue#01")]
[SemanticFact("EstimatedBitDepth#01", Nouns.Enum.BitDepth)]
[SemanticFact("EstimatedBitDepth#01", Nouns.Enum.ComputedData)]
[SemanticFact("EstimatedBitDepth#01", Verbs.Enum.IsOfMeasurableQuantity, DrillingPhysicalQuantity.QuantityEnum.Depth)]
[SemanticFact("WGS84VerticalDatum", Nouns.Enum.WGS84VerticalLocation)]
[SemanticFact("VerticalDepthFrame", Nouns.Enum.VerticalDepthFrame)]
[SemanticFact("VerticalDepthFrame", Verbs.Enum.HasReferenceFrameOrigin, "WGS84VerticalDatum")]
[SemanticFact("EstimatedBitDepth#01", Verbs.Enum.HasReferenceFrame, "VerticalDepthFrame")]
[SemanticFact("EstimatedBitDepth#01", Verbs.Enum.IsMechanicallyLocatedAt, "Bit#01")]
[SemanticFact("Bit#01", Nouns.Enum.DrillingBit)]
[SemanticFact("TransientT&D#01", Nouns.Enum.ComputationUnit)]
[OptionalFact(0, "TransientT&D#01", Nouns.Enum.ModelledDegreeOfFreedom, "DegreeOfFreedom", "4")]
[SemanticFact("EstimatedBitDepth#01", Verbs.Enum.IsTransformationOutput, "TransientT&D#01")]
[SemanticFact("EstimatedBitDepthHistogramValue#01", Nouns.Enum.DynamicDrillingSignal)]
[SemanticFact("EstimatedBitDepthHistogram#01", Nouns.Enum.GenericUncertainty)]
[SemanticFact("GeneralUncertaintyDistribution#01", Nouns.Enum.GenericUncertainty)]
[SemanticFact("EstimatedBitDepth#01", Verbs.Enum.HasUncertainty, "GeneralUncertaintyDistribution#01")]
[SemanticFact("GeneralUncertaintyDistribution#01", Verbs.Enum.HasUncertaintyHistogram, "EstimatedBitDepthHistogram#01")]
public GeneralDistributionDrillingProperty EstimatedBitDepth { get; set; } = new GeneralDistributionDrillingProperty();
}
class Example
{
static void Main()
{
TestClass testClass = new TestClass();
testClass.MeasuredBitDepth.Mean = 1000.0;
testClass.MeasuredBitDepth.StandardDeviation = 0.1;
testClass.BlockPositionSetPoint.ScalarValue = 10.0;
testClass.TopOfStringSpeedUpwardLimit.Min = 0.10;
testClass.TopOfStringSpeedUpwardLimit.Max = 0.11;
testClass.EstimatedBitDepth.Histogram = new Tuple<double, double>[]
{
new Tuple<double, double>(999.8, 0.05),
new Tuple<double, double>(999.9, 0.10),
new Tuple<double, double>(1000.0, 0.25),
new Tuple<double, double>(1000.1, 0.50),
new Tuple<double, double>(1000.2, 0.08),
new Tuple<double, double>(1000.3, 0.02)
};
}
}
}
Transfer of Meta Information via Json
Json schema does not support the possibility to define attributes (C#), annotations (Java), decoration (Python).
As most data exchanges utilize json formatting for the payload, another way to convey the meta information had to be found.
A static method GenerateDrillingPropertyMetaData.GetDrillingPropertyMetaData
is available to generate a dictionary of DrillingProperty
described in an Assembly
. The keys of the dictionary are the Tuple<string, string>
where the first item is the classname and the second item is the property name of the DrillingProperty
.
The values are instances of the class MetaDataDrillingProperty
. A MetaDataDrillingProperty
has the following properties:
Namespace
, a string that contains the namespace of the class where this property is definedClassName
, a string that contains the class name where this property is definedPropertyName
, a string that contains the name of the propertyMandatoryType
, which is of typeCommonProperty.MandatoryType?
SemanticFacts
, which is of typeList<SemanticFact>?
This method can be used to generate the meta information of all the properties defined in an Assembly
.
The dictionary can be serialized to json and stored on a file together with the json schema to supplement the data model with the attributes, annotations, decorations that could not be saved inside the json schema.
In the context of the generation of code from a json schema, the dictionary can be used to add attributes (C#), annotations (Java) or decoration (Python) to the generated properties in the classes.
In the context of a micro-service architecture, the generated dictionary can be made available through the Get
interface of a
specific end-point of the micro-service.
Example
Here is an example.
using OSDC.DotnetLibraries.Drilling.DrillingProperties;
using OSDC.UnitConversion.Conversion;
using OSDC.UnitConversion.Conversion.DrillingEngineering;
using DWIS.Vocabulary.Schemas;
using System.Reflection;
using System.Text.Json;
namespace DrillingProperties
{
public class TestClass
{
[AccessToVariable(CommonProperty.VariableAccessType.Assignable)]
[Mandatory(CommonProperty.MandatoryType.General)]
[SemanticGaussianVariable("BitDepthValue#01", "BitDepthStandardDeviationValue#01")]
[SemanticFact("BitDepthValue#01", Nouns.Enum.DynamicDrillingSignal)]
[SemanticFact("BitDepth#01", Nouns.Enum.BitDepth)]
[SemanticFact("BitDepth#01", Nouns.Enum.DerivedMeasurement)]
[SemanticFact("BitDepth#01", Verbs.Enum.IsOfMeasurableQuantity, DrillingPhysicalQuantity.QuantityEnum.Depth)]
[SemanticFact("BitDepth#01", Verbs.Enum.HasDynamicValue, "BitDepthValue#01")]
[SemanticFact("WGS84VerticalDatum", Nouns.Enum.WGS84VerticalLocation)]
[SemanticFact("VerticalDepthFrame", Nouns.Enum.VerticalDepthFrame)]
[SemanticFact("VerticalDepthFrame", Verbs.Enum.HasReferenceFrameOrigin, "WGS84VerticalDatum")]
[SemanticFact("BitDepth#01", Verbs.Enum.HasReferenceFrame, "VerticalDepthFrame")]
[SemanticFact("BitDepth#01", Verbs.Enum.IsMechanicallyLocatedAt, "Bit#01")]
[SemanticFact("Bit#01", Nouns.Enum.DrillingBit)]
[SemanticFact("BitDepthStandardDeviation#01", Nouns.Enum.DrillingDataPoint)]
[SemanticFact("BitDepthStandardDeviationValue#01", Nouns.Enum.DynamicDrillingSignal)]
[SemanticFact("BitDepthStandardDeviation#01", Verbs.Enum.HasDynamicValue, "BitDepthStandardDeviationValue#01")]
[SemanticFact("GaussianUncertainty#01", Nouns.Enum.GaussianUncertainty)]
[SemanticFact("BitDepth#01", Verbs.Enum.HasUncertainty, "GaussianUncertainty")]
[SemanticFact("GaussianUncertainty#01", Verbs.Enum.HasUncertaintyStandardDeviation, "BitDepthStandardDeviation#01")]
public GaussianDrillingProperty MeasuredBitDepth { get; set; } = new GaussianDrillingProperty();
[AccessToVariable(CommonProperty.VariableAccessType.Readable)]
[Mandatory(CommonProperty.MandatoryType.PipeHandling | CommonProperty.MandatoryType.Mechanical | CommonProperty.MandatoryType.Hydraulic)]
[SemanticDiracVariable("BlockPositionSPValue#01")]
[SemanticFact("BlockPositionSPValue#01", Nouns.Enum.DynamicDrillingSignal)]
[SemanticFact("BlockPositionSP#01", Nouns.Enum.HookPosition)]
[SemanticFact("BlockPositionSP#01", Nouns.Enum.SetPoint)]
[SemanticFact("BlockPositionSP#01", Verbs.Enum.IsOfMeasurableQuantity, PhysicalQuantity.QuantityEnum.StandardLength)]
[SemanticFact("BlockPositionSP#01", Verbs.Enum.HasDynamicValue, "BlockPositionSPValue#01")]
[SemanticFact("DrillFloorDatum", Nouns.Enum.DerrickFloorVerticalLocation)]
[SemanticFact("VerticalDepthFrame", Nouns.Enum.VerticalDepthFrame)]
[SemanticFact("VerticalDepthFrame", Verbs.Enum.HasReferenceFrameOrigin, "DrillFloorDatum")]
[SemanticFact("BlockPositionSP#01", Verbs.Enum.HasReferenceFrame, "VerticalDepthFrame")]
[SemanticFact("BlockPositionSP#01", Verbs.Enum.IsMechanicallyLocatedAt, "Elevator#01")]
[SemanticFact("Elevator#01", Nouns.Enum.DrillPipeElevator)]
public ScalarDrillingProperty BlockPositionSetPoint { get; set; } = new ScalarDrillingProperty();
[AccessToVariable(CommonProperty.VariableAccessType.Assignable)]
[Mandatory(CommonProperty.MandatoryType.Mechanical | CommonProperty.MandatoryType.Hydraulic | CommonProperty.MandatoryType.MaterialTransport)]
[SemanticUniformVariable("TopOfStringVelocityUpwardMinValue#01", "TopOfStringVelocityUpwardMaxValue#01")]
[SemanticFact("TopOfStringVelocityUpward#01", Nouns.Enum.HookVelocity)]
[SemanticFact("TopOfStringVelocityUpward#01", Verbs.Enum.IsOfMeasurableQuantity, DrillingPhysicalQuantity.QuantityEnum.BlockVelocity)]
[SemanticFact("TopOfStringVelocityUpwardMin#01", Nouns.Enum.DrillingDataPoint)]
[SemanticFact("TopOfStringVelocityUpwardMax#01", Nouns.Enum.DrillingDataPoint)]
[SemanticFact("TopOfStringVelocityUpwardMinValue#01", Nouns.Enum.DynamicDrillingSignal)]
[SemanticFact("TopOfStringVelocityUpwardMaxValue#01", Nouns.Enum.DynamicDrillingSignal)]
[SemanticFact("TopOfStringVelocityUpwardMin#01", Verbs.Enum.HasDynamicValue, "TopOfStringVelocityUpwardMinValue#01")]
[SemanticFact("TopOfStringVelocityUpwardMax#01", Verbs.Enum.HasDynamicValue, "TopOfStringVelocityUpwardMaxValue#01")]
[SemanticFact("TopOfStringVelocityUpward#01", Nouns.Enum.Limit)]
[SemanticFact("TopOfStringVelocityUpward#01", Verbs.Enum.IsMechanicallyLocatedAt, Nouns.Enum.DrillString)]
[SemanticFact("TopOfStringVelocityUpward#01", Verbs.Enum.IsPhysicallyLocatedAt, Nouns.Enum.TopOfStringReferenceLocation)]
[SemanticFact("UniformUncertainty#01", Nouns.Enum.MinMaxUncertainty)]
[SemanticFact("TopOfStringVelocityUpward#01", Verbs.Enum.HasUncertainty, "UniformUncertainty#01")]
[SemanticFact("UniformUncertainty#01", Verbs.Enum.HasUncertaintyMin, "TopOfStringVelocityUpwardMin#01")]
[SemanticFact("UniformUncertainty#01", Verbs.Enum.HasUncertaintyMax, "TopOfStringVelocityUpwardMax#01")]
public UniformDrillingProperty TopOfStringSpeedUpwardLimit { get; set; } = new UniformDrillingProperty();
[AccessToVariable(CommonProperty.VariableAccessType.Readable)]
[Mandatory(CommonProperty.MandatoryType.None)]
[SemanticGeneralDistributionVariable("EstimatedBitDepthHistogramValue#01")]
[SemanticFact("EstimatedBitDepth#01", Nouns.Enum.BitDepth)]
[SemanticFact("EstimatedBitDepth#01", Nouns.Enum.ComputedData)]
[SemanticFact("EstimatedBitDepth#01", Verbs.Enum.IsOfMeasurableQuantity, DrillingPhysicalQuantity.QuantityEnum.Depth)]
[SemanticFact("WGS84VerticalDatum", Nouns.Enum.WGS84VerticalLocation)]
[SemanticFact("VerticalDepthFrame", Nouns.Enum.VerticalDepthFrame)]
[SemanticFact("VerticalDepthFrame", Verbs.Enum.HasReferenceFrameOrigin, "WGS84VerticalDatum")]
[SemanticFact("EstimatedBitDepth#01", Verbs.Enum.HasReferenceFrame, "VerticalDepthFrame")]
[SemanticFact("EstimatedBitDepth#01", Verbs.Enum.IsMechanicallyLocatedAt, "Bit#01")]
[SemanticFact("Bit#01", Nouns.Enum.DrillingBit)]
[SemanticFact("TransientT&D#01", Nouns.Enum.ComputationUnit)]
[OptionalFact(0, "TransientT&D#01", Nouns.Enum.ModelledDegreeOfFreedom, "DegreeOfFreedom", "4")]
[SemanticFact("EstimatedBitDepth#01", Verbs.Enum.IsTransformationOutput, "TransientT&D#01")]
[SemanticFact("EstimatedBitDepthHistogramValue#01", Nouns.Enum.DynamicDrillingSignal)]
[SemanticFact("EstimatedBitDepthHistogram#01", Nouns.Enum.GenericUncertainty)]
[SemanticFact("GeneralUncertaintyDistribution#01", Nouns.Enum.GenericUncertainty)]
[SemanticFact("EstimatedBitDepth#01", Verbs.Enum.HasUncertainty, "GeneralUncertaintyDistribution#01")]
[SemanticFact("GeneralUncertaintyDistribution#01", Verbs.Enum.HasUncertaintyHistogram, "EstimatedBitDepthHistogram#01")]
public GeneralDistributionDrillingProperty EstimatedBitDepth { get; set; } = new GeneralDistributionDrillingProperty();
}
class Example
{
static void Main()
{
var dict = MetaDataDrillingProperty.GetDrillingPropertyMetaData(Assembly.GetExecutingAssembly());
if (dict != null)
{
foreach (var keyValue in dict)
{
Console.WriteLine("(" + keyValue.Key.Item1 + ", " + keyValue.Key.Item2 + ") " + "=" + JsonSerializer.Serialize(keyValue.Value));
}
}
}
}
}
The output is the following:
(TestClass, MeasuredBitDepth) ={"Namespace":"DrillingProperties","ClassName":"TestClass","PropertyName":"MeasuredBitDepth","AccessType":2,"SemanticGaussianMeanVariable":"BitDepthValue#01","SemanticGaussianStandardDeviationVariable":"BitDepthStandardDeviationValue#01","SemanticProportionErrorVariable":null,"SemanticExclusiveOrs":[],"MandatoryType":65535,"SemanticFacts":[{"SubjectName":"BitDepthValue#01","Verb":69,"Object":116,"ObjectAttributes":[]},{"SubjectName":"BitDepth#01","Verb":69,"Object":897,"ObjectAttributes":[]},{"SubjectName":"BitDepth#01","Verb":69,"Object":112,"ObjectAttributes":[]},{"SubjectName":"BitDepth#01","Verb":119,"ObjectDrillingQuantity":3,"ObjectAttributes":[]},{"SubjectName":"BitDepth#01","Verb":55,"ObjectName":"BitDepthValue#01","ObjectAttributes":[]},{"SubjectName":"WGS84VerticalDatum","Verb":69,"Object":755,"ObjectAttributes":[]},{"SubjectName":"VerticalDepthFrame","Verb":69,"Object":812,"ObjectAttributes":[]},{"SubjectName":"VerticalDepthFrame","Verb":112,"ObjectName":"WGS84VerticalDatum","ObjectAttributes":[]},{"SubjectName":"BitDepth#01","Verb":111,"ObjectName":"VerticalDepthFrame","ObjectAttributes":[]},{"SubjectName":"BitDepth#01","Verb":107,"ObjectName":"Bit#01","ObjectAttributes":[]},{"SubjectName":"Bit#01","Verb":69,"Object":411,"ObjectAttributes":[]},{"SubjectName":"BitDepthStandardDeviation#01","Verb":69,"Object":94,"ObjectAttributes":[]},{"SubjectName":"BitDepthStandardDeviationValue#01","Verb":69,"Object":116,"ObjectAttributes":[]},{"SubjectName":"BitDepthStandardDeviation#01","Verb":55,"ObjectName":"BitDepthStandardDeviationValue#01","ObjectAttributes":[]},{"SubjectName":"GaussianUncertainty#01","Verb":69,"Object":953,"ObjectAttributes":[]},{"SubjectName":"BitDepth#01","Verb":130,"ObjectName":"GaussianUncertainty","ObjectAttributes":[]},{"SubjectName":"GaussianUncertainty#01","Verb":136,"ObjectName":"BitDepthStandardDeviation#01","ObjectAttributes":[]}],"OptionalFacts":null}
(TestClass, BlockPositionSetPoint) ={"Namespace":"DrillingProperties","ClassName":"TestClass","PropertyName":"BlockPositionSetPoint","AccessType":1,"SemanticDiracVariable":"BlockPositionSPValue#01","SemanticProportionErrorVariable":null,"SemanticExclusiveOrs":[],"MandatoryType":19,"SemanticFacts":[{"SubjectName":"BlockPositionSPValue#01","Verb":69,"Object":116,"ObjectAttributes":[]},{"SubjectName":"BlockPositionSP#01","Verb":69,"Object":909,"ObjectAttributes":[]},{"SubjectName":"BlockPositionSP#01","Verb":69,"Object":97,"ObjectAttributes":[]},{"SubjectName":"BlockPositionSP#01","Verb":119,"ObjectPhysicalQuantity":65,"ObjectAttributes":[]},{"SubjectName":"BlockPositionSP#01","Verb":55,"ObjectName":"BlockPositionSPValue#01","ObjectAttributes":[]},{"SubjectName":"DrillFloorDatum","Verb":69,"Object":758,"ObjectAttributes":[]},{"SubjectName":"VerticalDepthFrame","Verb":69,"Object":812,"ObjectAttributes":[]},{"SubjectName":"VerticalDepthFrame","Verb":112,"ObjectName":"DrillFloorDatum","ObjectAttributes":[]},{"SubjectName":"BlockPositionSP#01","Verb":111,"ObjectName":"VerticalDepthFrame","ObjectAttributes":[]},{"SubjectName":"BlockPositionSP#01","Verb":107,"ObjectName":"Elevator#01","ObjectAttributes":[]},{"SubjectName":"Elevator#01","Verb":69,"Object":290,"ObjectAttributes":[]}],"OptionalFacts":null}
(TestClass, TopOfStringSpeedUpwardLimit) ={"Namespace":"DrillingProperties","ClassName":"TestClass","PropertyName":"TopOfStringSpeedUpwardLimit","AccessType":2,"SemanticProportionErrorVariable":null,"SemanticUniformMinVariable":"TopOfStringVelocityUpwardMinValue#01","SemanticUniformMaxVariable":"TopOfStringVelocityUpwardMaxValue#01","SemanticExclusiveOrs":[],"MandatoryType":11,"SemanticFacts":[{"SubjectName":"TopOfStringVelocityUpward#01","Verb":69,"Object":910,"ObjectAttributes":[]},{"SubjectName":"TopOfStringVelocityUpward#01","Verb":119,"ObjectDrillingQuantity":0,"ObjectAttributes":[]},{"SubjectName":"TopOfStringVelocityUpwardMin#01","Verb":69,"Object":94,"ObjectAttributes":[]},{"SubjectName":"TopOfStringVelocityUpwardMax#01","Verb":69,"Object":94,"ObjectAttributes":[]},{"SubjectName":"TopOfStringVelocityUpwardMinValue#01","Verb":69,"Object":116,"ObjectAttributes":[]},{"SubjectName":"TopOfStringVelocityUpwardMaxValue#01","Verb":69,"Object":116,"ObjectAttributes":[]},{"SubjectName":"TopOfStringVelocityUpwardMin#01","Verb":55,"ObjectName":"TopOfStringVelocityUpwardMinValue#01","ObjectAttributes":[]},{"SubjectName":"TopOfStringVelocityUpwardMax#01","Verb":55,"ObjectName":"TopOfStringVelocityUpwardMaxValue#01","ObjectAttributes":[]},{"SubjectName":"TopOfStringVelocityUpward#01","Verb":69,"Object":107,"ObjectAttributes":[]},{"SubjectName":"TopOfStringVelocityUpward#01","Verb":107,"Object":333,"ObjectAttributes":[]},{"SubjectName":"TopOfStringVelocityUpward#01","Verb":113,"Object":784,"ObjectAttributes":[]},{"SubjectName":"UniformUncertainty#01","Verb":69,"Object":955,"ObjectAttributes":[]},{"SubjectName":"TopOfStringVelocityUpward#01","Verb":130,"ObjectName":"UniformUncertainty#01","ObjectAttributes":[]},{"SubjectName":"UniformUncertainty#01","Verb":133,"ObjectName":"TopOfStringVelocityUpwardMin#01","ObjectAttributes":[]},{"SubjectName":"UniformUncertainty#01","Verb":134,"ObjectName":"TopOfStringVelocityUpwardMax#01","ObjectAttributes":[]}],"OptionalFacts":null}
(TestClass, EstimatedBitDepth) ={"Namespace":"DrillingProperties","ClassName":"TestClass","PropertyName":"EstimatedBitDepth","AccessType":1,"SemanticProportionErrorVariable":null,"SemanticGeneralDistributionHistogramVariable":"EstimatedBitDepthHistogramValue#01","SemanticExclusiveOrs":[],"MandatoryType":0,"SemanticFacts":[{"SubjectName":"EstimatedBitDepth#01","Verb":69,"Object":897,"ObjectAttributes":[]},{"SubjectName":"EstimatedBitDepth#01","Verb":69,"Object":114,"ObjectAttributes":[]},{"SubjectName":"EstimatedBitDepth#01","Verb":119,"ObjectDrillingQuantity":3,"ObjectAttributes":[]},{"SubjectName":"WGS84VerticalDatum","Verb":69,"Object":755,"ObjectAttributes":[]},{"SubjectName":"VerticalDepthFrame","Verb":69,"Object":812,"ObjectAttributes":[]},{"SubjectName":"VerticalDepthFrame","Verb":112,"ObjectName":"WGS84VerticalDatum","ObjectAttributes":[]},{"SubjectName":"EstimatedBitDepth#01","Verb":111,"ObjectName":"VerticalDepthFrame","ObjectAttributes":[]},{"SubjectName":"EstimatedBitDepth#01","Verb":107,"ObjectName":"Bit#01","ObjectAttributes":[]},{"SubjectName":"Bit#01","Verb":69,"Object":411,"ObjectAttributes":[]},{"SubjectName":"TransientT\u0026D#01","Verb":69,"Object":16,"ObjectAttributes":[]},{"SubjectName":"TransientT\u0026D#01","Verb":69,"Object":736,"ObjectAttributes":[{"Item1":"DegreeOfFreedom","Item2":"4"}]},{"SubjectName":"EstimatedBitDepth#01","Verb":37,"ObjectName":"TransientT\u0026D#01","ObjectAttributes":[]},{"SubjectName":"EstimatedBitDepthHistogramValue#01","Verb":69,"Object":116,"ObjectAttributes":[]},{"SubjectName":"EstimatedBitDepthHistogram#01","Verb":69,"Object":954,"ObjectAttributes":[]},{"SubjectName":"GeneralUncertaintyDistribution#01","Verb":69,"Object":954,"ObjectAttributes":[]},{"SubjectName":"EstimatedBitDepth#01","Verb":130,"ObjectName":"GeneralUncertaintyDistribution#01","ObjectAttributes":[]},{"SubjectName":"GeneralUncertaintyDistribution#01","Verb":139,"ObjectName":"EstimatedBitDepthHistogram#01","ObjectAttributes":[]}],"OptionalFacts":[{"ParentGroupIndex":0,"GroupIndex":0,"SubjectName":"TransientT\u0026D#01","Verb":69,"Object":736,"ObjectAttributes":[{"Item1":"DegreeOfFreedom","Item2":"4"}]}]}
Generation of SparQL Queries
It is possible to generate a list of SparQL
queries for a DrillingProperty
by calling the static method GetSparQLQueries
of GeneratorSparQLManifestFile
. The method takes three arguments: the assembly in which
the class or struct that define the property belongs to, the full name of the class or struct, and the
name of the property.
Here is an example:
using OSDC.DotnetLibraries.Drilling.DrillingProperties;
using OSDC.UnitConversion.Conversion.DrillingEngineering;
using DWIS.Vocabulary.Schemas;
using System.Reflection;
namespace DrillingProperties
{
public class TestClass
{
[AccessToVariable(CommonProperty.VariableAccessType.Assignable)]
[SemanticDiracVariable("FluidDensitySetPoint")]
[SemanticFact("FluidDensitySetPoint", Nouns.Enum.DynamicDrillingSignal)]
[SemanticFact("FluidDensitySetPoint#01", Nouns.Enum.SetPoint)]
[SemanticFact("FluidDensitySetPoint#01", Verbs.Enum.HasDynamicValue, "FluidDensitySetPoint")]
[SemanticFact("FluidDensitySetPoint#01", Verbs.Enum.IsOfMeasurableQuantity, DrillingPhysicalQuantity.QuantityEnum.DrillingDensity)]
public ScalarDrillingProperty FluidDensitySetPoint { get; set; } = new ScalarDrillingProperty();
[AccessToVariable(CommonProperty.VariableAccessType.Assignable)]
[SemanticUniformVariable("FluidDensityMin", "FluidDensityMax")]
[SemanticFact("FluidDensityMin", Nouns.Enum.DynamicDrillingSignal)]
[SemanticFact("FluidDensityMax", Nouns.Enum.DynamicDrillingSignal)]
[SemanticFact("FluidDensityUniform#01", Nouns.Enum.ComputedData)]
[SemanticFact("FluidDensityUniform#01", Verbs.Enum.IsOfMeasurableQuantity, DrillingPhysicalQuantity.QuantityEnum.DrillingDensity)]
[SemanticFact("FDEUncertainty#01", Nouns.Enum.MinMaxUncertainty)]
[SemanticFact("FluidDensityUniform#01", Verbs.Enum.HasUncertainty, "FDEUncertainty#01")]
[SemanticFact("FluidDensityMin#01", Nouns.Enum.DrillingDataPoint)]
[SemanticFact("FluidDensityMax#01", Nouns.Enum.DrillingDataPoint)]
[SemanticFact("FluidDensityMin#01", Verbs.Enum.HasDynamicValue, "FluidDensityMin")]
[SemanticFact("FluidDensityMax#01", Verbs.Enum.HasDynamicValue, "FluidDensityMax")]
[SemanticFact("FDEUncertainty#01", Verbs.Enum.HasUncertaintyMin, "FluidDensityMin#01")]
[SemanticFact("FDEUncertainty#01", Verbs.Enum.HasUncertaintyMax, "FluidDensityMax#01")]
public UniformDrillingProperty FluidDensityMargin { get; set; } = new UniformDrillingProperty();
[AccessToVariable(CommonProperty.VariableAccessType.Assignable)]
[SemanticGaussianVariable("FluidDensityEstimated", "FluidDensityEstimatedStdDev")]
[SemanticFact("FluidDensityEstimated", Nouns.Enum.DynamicDrillingSignal)]
[SemanticFact("FluidDensityEstimated#01", Nouns.Enum.ComputedData)]
[SemanticFact("FluidDensityEstimated#01", Verbs.Enum.HasDynamicValue, "FluidDensityEstimated")]
[SemanticFact("FluidDensityEstimated#01", Verbs.Enum.IsOfMeasurableQuantity, DrillingPhysicalQuantity.QuantityEnum.DrillingDensity)]
[SemanticFact("FDEUncertainty#01", Nouns.Enum.GaussianUncertainty)]
[SemanticFact("FluidDensityEstimated#01", Verbs.Enum.HasUncertainty, "FDEUncertainty#01")]
[SemanticFact("FluidDensityEstimatedStdDev", Nouns.Enum.DynamicDrillingSignal)]
[SemanticFact("FluidDensityEstimatedStdDev#01", Nouns.Enum.DrillingDataPoint)]
[SemanticFact("FluidDensityEstimatedStdDev#01", Verbs.Enum.HasStaticValue, "FluidDensityEstimatedStdDev")]
[SemanticFact("FDEUncertainty#01", Verbs.Enum.HasUncertaintyStandardDeviation, "FluidDensityEstimatedStdDev#01")]
[OptionalFact(1, "FDEUncertainty#01", Verbs.Enum.HasUncertaintyMean, "FluidDensityEstimated#01")]
public GaussianDrillingProperty FluidDensityEstimated { get; set; } = new GaussianDrillingProperty();
[AccessToVariable(CommonProperty.VariableAccessType.Assignable)]
[SemanticGaussianVariable("FluidDensityMeasured", "sigma_FluidDensityMeasured")]
[SemanticSensorVariable("FluidDensityMeasured", "FluidDensityMeasured_prec", "FluidDensityMeasured_acc")]
[SemanticFullScaleVariable("FluidDensityMeasured", "FluidDensityMeasured_fs", "FluidDensityMeasured_prop")]
[SemanticExclusiveOr(1, 2, 3)]
[SemanticFact("FluidDensityMeasured", Nouns.Enum.DynamicDrillingSignal)]
[SemanticFact("FluidDensityMeasured#01", Nouns.Enum.PhysicalData)]
[SemanticFact("FluidDensityMeasured#01", Verbs.Enum.HasDynamicValue, "FluidDensityMeasured")]
[SemanticFact("FluidDensityMeasured#01", Verbs.Enum.IsOfMeasurableQuantity, DrillingPhysicalQuantity.QuantityEnum.DrillingDensity)]
[SemanticFact("tos#01", Nouns.Enum.TopOfStringReferenceLocation)]
[SemanticFact("FluidDensityMeasured#01", Verbs.Enum.IsPhysicallyLocatedAt, "tos#01")]
[SemanticFact("MovingAverage", Nouns.Enum.MovingAverage)]
[SemanticFact("FluidDensityMeasured#01", Verbs.Enum.IsTransformationOutput, "MovingAverage")]
[OptionalFact(1, "sigma_FluidDensityMeasured", Nouns.Enum.DrillingSignal)]
[OptionalFact(1, "sigma_FluidDensityMeasured#01", Nouns.Enum.DrillingDataPoint)]
[OptionalFact(1, "sigma_FluidDensityMeasured#01", Verbs.Enum.HasValue, "sigma_FluidDensityMeasured")]
[OptionalFact(1, "GaussianUncertainty#01", Nouns.Enum.GaussianUncertainty)]
[OptionalFact(1, "FluidDensityMeasured#01", Verbs.Enum.HasUncertainty, "GaussianUncertainty#01")]
[OptionalFact(1, "GaussianUncertainty#01", Verbs.Enum.HasUncertaintyStandardDeviation, "sigma_FluidDensityMeasured#01")]
[OptionalFact(1, 11, "GaussianUncertainty#01", Verbs.Enum.HasUncertaintyMean, "FluidDensityMeasured#01")]
[OptionalFact(2, "FluidDensityMeasured_prec", Nouns.Enum.DrillingSignal)]
[OptionalFact(2, "FluidDensityMeasured_prec#01", Nouns.Enum.DrillingDataPoint)]
[OptionalFact(2, "FluidDensityMeasured_prec#01", Verbs.Enum.HasValue, "FluidDensityMeasured_prec")]
[OptionalFact(2, "FluidDensityMeasured_acc", Nouns.Enum.DrillingSignal)]
[OptionalFact(2, "FluidDensityMeasured_acc#01", Nouns.Enum.DrillingDataPoint)]
[OptionalFact(2, "FluidDensityMeasured_acc#01", Verbs.Enum.HasValue, "FluidDensityMeasured_acc")]
[OptionalFact(2, "SensorUncertainty#01", Nouns.Enum.SensorUncertainty)]
[OptionalFact(2, "SensorUncertainty#01", Verbs.Enum.HasUncertaintyPrecision, "FluidDensityMeasured_prec#01")]
[OptionalFact(2, "SensorUncertainty#01", Verbs.Enum.HasUncertaintyAccuracy, "FluidDensityMeasured_acc#01")]
[OptionalFact(2, "FluidDensityMeasured#01", Verbs.Enum.HasUncertainty, "SensorUncertainty#01")]
[OptionalFact(2, 21, "SensorUncertainty#01", Verbs.Enum.HasUncertaintyMean, "FluidDensityMeasured#01")]
[OptionalFact(3, "FluidDensityMeasured_fs", Nouns.Enum.DrillingSignal)]
[OptionalFact(3, "FluidDensityMeasured_fs#01", Nouns.Enum.DrillingDataPoint)]
[OptionalFact(3, "FluidDensityMeasured_fs#01", Verbs.Enum.HasValue, "FluidDensityMeasured_fs")]
[OptionalFact(3, "FluidDensityMeasured_prop", Nouns.Enum.DrillingSignal)]
[OptionalFact(3, "FluidDensityMeasured_prop#01", Nouns.Enum.DrillingDataPoint)]
[OptionalFact(3, "FluidDensityMeasured_prop#01", Verbs.Enum.HasValue, "FluidDensityMeasured_prop")]
[OptionalFact(3, "FullScaleUncertainty#01", Nouns.Enum.FullScaleUncertainty)]
[OptionalFact(3, "FullScaleUncertainty#01", Verbs.Enum.HasFullScale, "FluidDensityMeasured_fs#01")]
[OptionalFact(3, "FullScaleUncertainty#01", Verbs.Enum.HasProportionError, "FluidDensityMeasured_prop#01")]
[OptionalFact(3, "FluidDensityMeasured#01", Verbs.Enum.HasUncertainty, "FullScaleUncertainty#01")]
[OptionalFact(3, 31, "FullScaleUncertainty#01", Verbs.Enum.HasUncertaintyMean, "FluidDensityMeasured#01")]
public SensorDrillingProperty FluidDensityMeasured { get; set; } = new SensorDrillingProperty();
[AccessToVariable(CommonProperty.VariableAccessType.Assignable)]
[SemanticGaussianVariable("CuttingsDensityMeasured", "sigma_CuttingsDensityMeasured")]
[SemanticSensorVariable("CuttingsDensityMeasured", "CuttingsDensityMeasured_prec", "CuttingsDensityMeasured_acc")]
[SemanticFullScaleVariable("CuttingsDensityMeasured", "CuttingsDensityMeasured_fs", "CuttingsDensityMeasured_prop")]
[SemanticExclusiveOr(1, 2, 3)]
[SemanticFact("CuttingsDensityMeasured", Nouns.Enum.DynamicDrillingSignal)]
[SemanticFact("CuttingsDensityMeasured#01", Nouns.Enum.PhysicalData)]
[SemanticFact("CuttingsDensityMeasured#01", Verbs.Enum.HasDynamicValue, "CuttingsDensityMeasured")]
[SemanticFact("CuttingsDensityMeasured#01", Verbs.Enum.IsOfMeasurableQuantity, DrillingPhysicalQuantity.QuantityEnum.DrillingDensity)]
[SemanticFact("tos#01", Nouns.Enum.TopOfStringReferenceLocation)]
[SemanticFact("CuttingsDensityMeasured#01", Verbs.Enum.IsPhysicallyLocatedAt, "tos#01")]
[SemanticFact("MovingAverage", Nouns.Enum.MovingAverage)]
[SemanticFact("CuttingsDensityMeasured#01", Verbs.Enum.IsTransformationOutput, "MovingAverage")]
[SemanticFact("LiquidComponent#01", Nouns.Enum.LiquidComponent)]
[SemanticFact("CuttingsComponent#01", Nouns.Enum.CuttingsComponent)]
[SemanticFact("GasComponent#01", Nouns.Enum.GasComponent)]
[SemanticFact("CuttingsDensityMeasured#01", Verbs.Enum.ConcernsAFluidComponent, "CuttingsComponent#01")]
[ExcludeFact("CuttingsDensityMeasured#01", Verbs.Enum.ConcernsAFluidComponent, "LiquidComponent#01")]
[ExcludeFact("CuttingsDensityMeasured#01", Verbs.Enum.ConcernsAFluidComponent, "GasComponent#01")]
[OptionalFact(1, "sigma_CuttingsDensityMeasured", Nouns.Enum.DrillingSignal)]
[OptionalFact(1, "sigma_CuttingsDensityMeasured#01", Nouns.Enum.DrillingDataPoint)]
[OptionalFact(1, "sigma_CuttingsDensityMeasured#01", Verbs.Enum.HasValue, "sigma_CuttingsDensityMeasured")]
[OptionalFact(1, "GaussianUncertainty#01", Nouns.Enum.GaussianUncertainty)]
[OptionalFact(1, "CuttingsDensityMeasured#01", Verbs.Enum.HasUncertainty, "GaussianUncertainty#01")]
[OptionalFact(1, "GaussianUncertainty#01", Verbs.Enum.HasUncertaintyStandardDeviation, "sigma_CuttingsDensityMeasured#01")]
[OptionalFact(1, 11, "GaussianUncertainty#01", Verbs.Enum.HasUncertaintyMean, "CuttingsDensityMeasured#01")]
[OptionalFact(2, "CuttingsDensityMeasured_prec", Nouns.Enum.DrillingSignal)]
[OptionalFact(2, "CuttingsDensityMeasured_prec#01", Nouns.Enum.DrillingDataPoint)]
[OptionalFact(2, "CuttingsDensityMeasured_prec#01", Verbs.Enum.HasValue, "CuttingsDensityMeasured_prec")]
[OptionalFact(2, "CuttingsDensityMeasured_acc", Nouns.Enum.DrillingSignal)]
[OptionalFact(2, "CuttingsDensityMeasured_acc#01", Nouns.Enum.DrillingDataPoint)]
[OptionalFact(2, "CuttingsDensityMeasured_acc#01", Verbs.Enum.HasValue, "CuttingsDensityMeasured_acc")]
[OptionalFact(2, "SensorUncertainty#01", Nouns.Enum.SensorUncertainty)]
[OptionalFact(2, "SensorUncertainty#01", Verbs.Enum.HasUncertaintyPrecision, "CuttingsDensityMeasured_prec#01")]
[OptionalFact(2, "SensorUncertainty#01", Verbs.Enum.HasUncertaintyAccuracy, "CuttingsDensityMeasured_acc#01")]
[OptionalFact(2, "CuttingsDensityMeasured#01", Verbs.Enum.HasUncertainty, "SensorUncertainty#01")]
[OptionalFact(2, 21, "SensorUncertainty#01", Verbs.Enum.HasUncertaintyMean, "CuttingsDensityMeasured#01")]
[OptionalFact(3, "CuttingsDensityMeasured_fs", Nouns.Enum.DrillingSignal)]
[OptionalFact(3, "CuttingsDensityMeasured_fs#01", Nouns.Enum.DrillingDataPoint)]
[OptionalFact(3, "CuttingsDensityMeasured_fs#01", Verbs.Enum.HasValue, "CuttingsDensityMeasured_fs")]
[OptionalFact(3, "CuttingsDensityMeasured_prop", Nouns.Enum.DrillingSignal)]
[OptionalFact(3, "CuttingsDensityMeasured_prop#01", Nouns.Enum.DrillingDataPoint)]
[OptionalFact(3, "CuttingsDensityMeasured_prop#01", Verbs.Enum.HasValue, "CuttingsDensityMeasured_prop")]
[OptionalFact(3, "FullScaleUncertainty#01", Nouns.Enum.FullScaleUncertainty)]
[OptionalFact(3, "FullScaleUncertainty#01", Verbs.Enum.HasFullScale, "CuttingsDensityMeasured_fs#01")]
[OptionalFact(3, "FullScaleUncertainty#01", Verbs.Enum.HasProportionError, "CuttingsDensityMeasured_prop#01")]
[OptionalFact(3, "CuttingsDensityMeasured#01", Verbs.Enum.HasUncertainty, "FullScaleUncertainty#01")]
[OptionalFact(3, 31, "FullScaleUncertainty#01", Verbs.Enum.HasUncertaintyMean, "CuttingsDensityMeasured#01")]
public SensorDrillingProperty CuttingsDensityMeasured { get; set; } = new SensorDrillingProperty();
}
class Example
{
static void GenerateSparQLForMD(StreamWriter writer, string propertyName, Dictionary<string, QuerySpecification>? queries)
{
if (writer != null && !string.IsNullOrEmpty(propertyName) && queries != null)
{
writer.WriteLine("# Semantic Queries for `" + propertyName + "`");
foreach (var query in queries)
{
if (query.Value != null)
{
writer.WriteLine("## " + query.Key);
writer.WriteLine("```sparql");
writer.WriteLine(query.Value.SparQL);
writer.WriteLine("```");
}
}
}
}
static void Main()
{
TestClass testClass = new TestClass();
Assembly? assembly = Assembly.GetAssembly(typeof(TestClass));
if (assembly != null)
{
string tempPath = Directory.GetCurrentDirectory();
DirectoryInfo? dir = new DirectoryInfo(tempPath);
dir = dir?.Parent?.Parent?.Parent;
if (dir != null)
{
string tempFile = Path.Combine(dir.FullName, "Example05.md");
using (StreamWriter writer = new StreamWriter(tempFile))
{
var queries1 = GeneratorSparQLManifestFile.GetSparQLQueries(assembly, typeof(TestClass).FullName, "FluidDensitySetPoint");
GenerateSparQLForMD(writer, "FluidDensitySetPoint", queries1);
var queries2 = GeneratorSparQLManifestFile.GetSparQLQueries(assembly, typeof(TestClass).FullName, "FluidDensityMargin");
GenerateSparQLForMD(writer, "FluidDensityMargin", queries2);
var queries3 = GeneratorSparQLManifestFile.GetSparQLQueries(assembly, typeof(TestClass).FullName, "FluidDensityEstimated");
GenerateSparQLForMD(writer, "FluidDensityEstimated", queries3);
var queries4 = GeneratorSparQLManifestFile.GetSparQLQueries(assembly, typeof(TestClass).FullName, "FluidDensityMeasured");
GenerateSparQLForMD(writer, "FluidDensityMeasured", queries4);
var queries5 = GeneratorSparQLManifestFile.GetSparQLQueries(assembly, typeof(TestClass).FullName, "CuttingsDensityMeasured");
GenerateSparQLForMD(writer, "CuttingsDensityMeasured", queries5);
}
}
}
}
}
}
The result from generating this program is:
Semantic Queries for FluidDensitySetPoint
Semantic Queries for FluidDensitySetPoint
Query-DrillingProperties.TestClass-FluidDensitySetPoint-000
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX ddhub: <http://ddhub.no/>
PREFIX quantity: <http://ddhub.no/UnitAndQuantity>
SELECT ?FluidDensitySetPoint
WHERE {
?FluidDensitySetPoint rdf:type ddhub:DynamicDrillingSignal .
?FluidDensitySetPoint#01 rdf:type ddhub:SetPoint .
?FluidDensitySetPoint#01 ddhub:HasDynamicValue ?FluidDensitySetPoint .
?FluidDensitySetPoint#01 ddhub:IsOfMeasurableQuantity quantity:DrillingDensity .
}
Semantic Queries for FluidDensityMargin
Query-DrillingProperties.TestClass-FluidDensityMargin-000
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX ddhub: <http://ddhub.no/>
PREFIX quantity: <http://ddhub.no/UnitAndQuantity>
SELECT ?FluidDensityMin, ?FluidDensityMax
WHERE {
?FluidDensityMin rdf:type ddhub:DynamicDrillingSignal .
?FluidDensityMax rdf:type ddhub:DynamicDrillingSignal .
?FluidDensityUniform#01 rdf:type ddhub:ComputedData .
?FluidDensityUniform#01 ddhub:IsOfMeasurableQuantity quantity:DrillingDensity .
?FDEUncertainty#01 rdf:type ddhub:MinMaxUncertainty .
?FluidDensityUniform#01 ddhub:HasUncertainty ?FDEUncertainty#01 .
?FluidDensityMin#01 rdf:type ddhub:DrillingDataPoint .
?FluidDensityMax#01 rdf:type ddhub:DrillingDataPoint .
?FluidDensityMin#01 ddhub:HasDynamicValue ?FluidDensityMin .
?FluidDensityMax#01 ddhub:HasDynamicValue ?FluidDensityMax .
?FDEUncertainty#01 ddhub:HasUncertaintyMin ?FluidDensityMin#01 .
?FDEUncertainty#01 ddhub:HasUncertaintyMax ?FluidDensityMax#01 .
}
Semantic Queries for FluidDensityEstimated
Query-DrillingProperties.TestClass-FluidDensityEstimated-000
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX ddhub: <http://ddhub.no/>
PREFIX quantity: <http://ddhub.no/UnitAndQuantity>
SELECT ?FluidDensityEstimated, ?FluidDensityEstimatedStdDev
WHERE {
?FluidDensityEstimated rdf:type ddhub:DynamicDrillingSignal .
?FluidDensityEstimated#01 rdf:type ddhub:ComputedData .
?FluidDensityEstimated#01 ddhub:HasDynamicValue ?FluidDensityEstimated .
?FluidDensityEstimated#01 ddhub:IsOfMeasurableQuantity quantity:DrillingDensity .
?FDEUncertainty#01 rdf:type ddhub:GaussianUncertainty .
?FluidDensityEstimated#01 ddhub:HasUncertainty ?FDEUncertainty#01 .
?FluidDensityEstimatedStdDev rdf:type ddhub:DynamicDrillingSignal .
?FluidDensityEstimatedStdDev#01 rdf:type ddhub:DrillingDataPoint .
?FluidDensityEstimatedStdDev#01 ddhub:HasStaticValue ?FluidDensityEstimatedStdDev .
?FDEUncertainty#01 ddhub:HasUncertaintyStandardDeviation ?FluidDensityEstimatedStdDev#01 .
}
Query-DrillingProperties.TestClass-FluidDensityEstimated-001
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX ddhub: <http://ddhub.no/>
PREFIX quantity: <http://ddhub.no/UnitAndQuantity>
SELECT ?FluidDensityEstimated, ?FluidDensityEstimatedStdDev, ?factOptionSet
WHERE {
?FluidDensityEstimated rdf:type ddhub:DynamicDrillingSignal .
?FluidDensityEstimated#01 rdf:type ddhub:ComputedData .
?FluidDensityEstimated#01 ddhub:HasDynamicValue ?FluidDensityEstimated .
?FluidDensityEstimated#01 ddhub:IsOfMeasurableQuantity quantity:DrillingDensity .
?FDEUncertainty#01 rdf:type ddhub:GaussianUncertainty .
?FluidDensityEstimated#01 ddhub:HasUncertainty ?FDEUncertainty#01 .
?FluidDensityEstimatedStdDev rdf:type ddhub:DynamicDrillingSignal .
?FluidDensityEstimatedStdDev#01 rdf:type ddhub:DrillingDataPoint .
?FluidDensityEstimatedStdDev#01 ddhub:HasStaticValue ?FluidDensityEstimatedStdDev .
?FDEUncertainty#01 ddhub:HasUncertaintyStandardDeviation ?FluidDensityEstimatedStdDev#01 .
?FDEUncertainty#01 ddhub:HasUncertaintyMean ?FluidDensityEstimated#01 .
BIND ("1" as ?factOptionSet)
}
Semantic Queries for FluidDensityMeasured
Query-DrillingProperties.TestClass-FluidDensityMeasured-000
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX ddhub: <http://ddhub.no/>
PREFIX quantity: <http://ddhub.no/UnitAndQuantity>
SELECT ?FluidDensityMeasured
WHERE {
?FluidDensityMeasured rdf:type ddhub:DynamicDrillingSignal .
?FluidDensityMeasured#01 rdf:type ddhub:PhysicalData .
?FluidDensityMeasured#01 ddhub:HasDynamicValue ?FluidDensityMeasured .
?FluidDensityMeasured#01 ddhub:IsOfMeasurableQuantity quantity:DrillingDensity .
?tos#01 rdf:type ddhub:TopOfStringReferenceLocation .
?FluidDensityMeasured#01 ddhub:IsPhysicallyLocatedAt ?tos#01 .
?MovingAverage rdf:type ddhub:MovingAverage .
?FluidDensityMeasured#01 ddhub:IsTransformationOutput ?MovingAverage .
}
Query-DrillingProperties.TestClass-FluidDensityMeasured-001
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX ddhub: <http://ddhub.no/>
PREFIX quantity: <http://ddhub.no/UnitAndQuantity>
SELECT ?FluidDensityMeasured, ?sigma_FluidDensityMeasured, ?factOptionSet
WHERE {
?FluidDensityMeasured rdf:type ddhub:DynamicDrillingSignal .
?FluidDensityMeasured#01 rdf:type ddhub:PhysicalData .
?FluidDensityMeasured#01 ddhub:HasDynamicValue ?FluidDensityMeasured .
?FluidDensityMeasured#01 ddhub:IsOfMeasurableQuantity quantity:DrillingDensity .
?tos#01 rdf:type ddhub:TopOfStringReferenceLocation .
?FluidDensityMeasured#01 ddhub:IsPhysicallyLocatedAt ?tos#01 .
?MovingAverage rdf:type ddhub:MovingAverage .
?FluidDensityMeasured#01 ddhub:IsTransformationOutput ?MovingAverage .
?sigma_FluidDensityMeasured rdf:type ddhub:DrillingSignal .
?sigma_FluidDensityMeasured#01 rdf:type ddhub:DrillingDataPoint .
?sigma_FluidDensityMeasured#01 ddhub:HasValue ?sigma_FluidDensityMeasured .
?GaussianUncertainty#01 rdf:type ddhub:GaussianUncertainty .
?FluidDensityMeasured#01 ddhub:HasUncertainty ?GaussianUncertainty#01 .
?GaussianUncertainty#01 ddhub:HasUncertaintyStandardDeviation ?sigma_FluidDensityMeasured#01 .
BIND ("1" as ?factOptionSet)
}
Query-DrillingProperties.TestClass-FluidDensityMeasured-002
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX ddhub: <http://ddhub.no/>
PREFIX quantity: <http://ddhub.no/UnitAndQuantity>
SELECT ?FluidDensityMeasured, ?sigma_FluidDensityMeasured, ?factOptionSet
WHERE {
?FluidDensityMeasured rdf:type ddhub:DynamicDrillingSignal .
?FluidDensityMeasured#01 rdf:type ddhub:PhysicalData .
?FluidDensityMeasured#01 ddhub:HasDynamicValue ?FluidDensityMeasured .
?FluidDensityMeasured#01 ddhub:IsOfMeasurableQuantity quantity:DrillingDensity .
?tos#01 rdf:type ddhub:TopOfStringReferenceLocation .
?FluidDensityMeasured#01 ddhub:IsPhysicallyLocatedAt ?tos#01 .
?MovingAverage rdf:type ddhub:MovingAverage .
?FluidDensityMeasured#01 ddhub:IsTransformationOutput ?MovingAverage .
?sigma_FluidDensityMeasured rdf:type ddhub:DrillingSignal .
?sigma_FluidDensityMeasured#01 rdf:type ddhub:DrillingDataPoint .
?sigma_FluidDensityMeasured#01 ddhub:HasValue ?sigma_FluidDensityMeasured .
?GaussianUncertainty#01 rdf:type ddhub:GaussianUncertainty .
?FluidDensityMeasured#01 ddhub:HasUncertainty ?GaussianUncertainty#01 .
?GaussianUncertainty#01 ddhub:HasUncertaintyStandardDeviation ?sigma_FluidDensityMeasured#01 .
?GaussianUncertainty#01 ddhub:HasUncertaintyMean ?FluidDensityMeasured#01 .
BIND ("1,11" as ?factOptionSet)
}
Query-DrillingProperties.TestClass-FluidDensityMeasured-003
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX ddhub: <http://ddhub.no/>
PREFIX quantity: <http://ddhub.no/UnitAndQuantity>
SELECT ?FluidDensityMeasured, ?FluidDensityMeasured_prec, ?FluidDensityMeasured_acc, ?factOptionSet
WHERE {
?FluidDensityMeasured rdf:type ddhub:DynamicDrillingSignal .
?FluidDensityMeasured#01 rdf:type ddhub:PhysicalData .
?FluidDensityMeasured#01 ddhub:HasDynamicValue ?FluidDensityMeasured .
?FluidDensityMeasured#01 ddhub:IsOfMeasurableQuantity quantity:DrillingDensity .
?tos#01 rdf:type ddhub:TopOfStringReferenceLocation .
?FluidDensityMeasured#01 ddhub:IsPhysicallyLocatedAt ?tos#01 .
?MovingAverage rdf:type ddhub:MovingAverage .
?FluidDensityMeasured#01 ddhub:IsTransformationOutput ?MovingAverage .
?FluidDensityMeasured_prec rdf:type ddhub:DrillingSignal .
?FluidDensityMeasured_prec#01 rdf:type ddhub:DrillingDataPoint .
?FluidDensityMeasured_prec#01 ddhub:HasValue ?FluidDensityMeasured_prec .
?FluidDensityMeasured_acc rdf:type ddhub:DrillingSignal .
?FluidDensityMeasured_acc#01 rdf:type ddhub:DrillingDataPoint .
?FluidDensityMeasured_acc#01 ddhub:HasValue ?FluidDensityMeasured_acc .
?SensorUncertainty#01 rdf:type ddhub:SensorUncertainty .
?SensorUncertainty#01 ddhub:HasUncertaintyPrecision ?FluidDensityMeasured_prec#01 .
?SensorUncertainty#01 ddhub:HasUncertaintyAccuracy ?FluidDensityMeasured_acc#01 .
?FluidDensityMeasured#01 ddhub:HasUncertainty ?SensorUncertainty#01 .
BIND ("2" as ?factOptionSet)
}
Query-DrillingProperties.TestClass-FluidDensityMeasured-004
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX ddhub: <http://ddhub.no/>
PREFIX quantity: <http://ddhub.no/UnitAndQuantity>
SELECT ?FluidDensityMeasured, ?FluidDensityMeasured_prec, ?FluidDensityMeasured_acc, ?factOptionSet
WHERE {
?FluidDensityMeasured rdf:type ddhub:DynamicDrillingSignal .
?FluidDensityMeasured#01 rdf:type ddhub:PhysicalData .
?FluidDensityMeasured#01 ddhub:HasDynamicValue ?FluidDensityMeasured .
?FluidDensityMeasured#01 ddhub:IsOfMeasurableQuantity quantity:DrillingDensity .
?tos#01 rdf:type ddhub:TopOfStringReferenceLocation .
?FluidDensityMeasured#01 ddhub:IsPhysicallyLocatedAt ?tos#01 .
?MovingAverage rdf:type ddhub:MovingAverage .
?FluidDensityMeasured#01 ddhub:IsTransformationOutput ?MovingAverage .
?FluidDensityMeasured_prec rdf:type ddhub:DrillingSignal .
?FluidDensityMeasured_prec#01 rdf:type ddhub:DrillingDataPoint .
?FluidDensityMeasured_prec#01 ddhub:HasValue ?FluidDensityMeasured_prec .
?FluidDensityMeasured_acc rdf:type ddhub:DrillingSignal .
?FluidDensityMeasured_acc#01 rdf:type ddhub:DrillingDataPoint .
?FluidDensityMeasured_acc#01 ddhub:HasValue ?FluidDensityMeasured_acc .
?SensorUncertainty#01 rdf:type ddhub:SensorUncertainty .
?SensorUncertainty#01 ddhub:HasUncertaintyPrecision ?FluidDensityMeasured_prec#01 .
?SensorUncertainty#01 ddhub:HasUncertaintyAccuracy ?FluidDensityMeasured_acc#01 .
?FluidDensityMeasured#01 ddhub:HasUncertainty ?SensorUncertainty#01 .
?SensorUncertainty#01 ddhub:HasUncertaintyMean ?FluidDensityMeasured#01 .
BIND ("2,21" as ?factOptionSet)
}
Query-DrillingProperties.TestClass-FluidDensityMeasured-005
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX ddhub: <http://ddhub.no/>
PREFIX quantity: <http://ddhub.no/UnitAndQuantity>
SELECT ?FluidDensityMeasured, ?FluidDensityMeasured_fs, ?FluidDensityMeasured_prop, ?factOptionSet
WHERE {
?FluidDensityMeasured rdf:type ddhub:DynamicDrillingSignal .
?FluidDensityMeasured#01 rdf:type ddhub:PhysicalData .
?FluidDensityMeasured#01 ddhub:HasDynamicValue ?FluidDensityMeasured .
?FluidDensityMeasured#01 ddhub:IsOfMeasurableQuantity quantity:DrillingDensity .
?tos#01 rdf:type ddhub:TopOfStringReferenceLocation .
?FluidDensityMeasured#01 ddhub:IsPhysicallyLocatedAt ?tos#01 .
?MovingAverage rdf:type ddhub:MovingAverage .
?FluidDensityMeasured#01 ddhub:IsTransformationOutput ?MovingAverage .
?FluidDensityMeasured_fs rdf:type ddhub:DrillingSignal .
?FluidDensityMeasured_fs#01 rdf:type ddhub:DrillingDataPoint .
?FluidDensityMeasured_fs#01 ddhub:HasValue ?FluidDensityMeasured_fs .
?FluidDensityMeasured_prop rdf:type ddhub:DrillingSignal .
?FluidDensityMeasured_prop#01 rdf:type ddhub:DrillingDataPoint .
?FluidDensityMeasured_prop#01 ddhub:HasValue ?FluidDensityMeasured_prop .
?FullScaleUncertainty#01 rdf:type ddhub:FullScaleUncertainty .
?FullScaleUncertainty#01 ddhub:HasFullScale ?FluidDensityMeasured_fs#01 .
?FullScaleUncertainty#01 ddhub:HasProportionError ?FluidDensityMeasured_prop#01 .
?FluidDensityMeasured#01 ddhub:HasUncertainty ?FullScaleUncertainty#01 .
BIND ("3" as ?factOptionSet)
}
Query-DrillingProperties.TestClass-FluidDensityMeasured-006
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX ddhub: <http://ddhub.no/>
PREFIX quantity: <http://ddhub.no/UnitAndQuantity>
SELECT ?FluidDensityMeasured, ?FluidDensityMeasured_fs, ?FluidDensityMeasured_prop, ?factOptionSet
WHERE {
?FluidDensityMeasured rdf:type ddhub:DynamicDrillingSignal .
?FluidDensityMeasured#01 rdf:type ddhub:PhysicalData .
?FluidDensityMeasured#01 ddhub:HasDynamicValue ?FluidDensityMeasured .
?FluidDensityMeasured#01 ddhub:IsOfMeasurableQuantity quantity:DrillingDensity .
?tos#01 rdf:type ddhub:TopOfStringReferenceLocation .
?FluidDensityMeasured#01 ddhub:IsPhysicallyLocatedAt ?tos#01 .
?MovingAverage rdf:type ddhub:MovingAverage .
?FluidDensityMeasured#01 ddhub:IsTransformationOutput ?MovingAverage .
?FluidDensityMeasured_fs rdf:type ddhub:DrillingSignal .
?FluidDensityMeasured_fs#01 rdf:type ddhub:DrillingDataPoint .
?FluidDensityMeasured_fs#01 ddhub:HasValue ?FluidDensityMeasured_fs .
?FluidDensityMeasured_prop rdf:type ddhub:DrillingSignal .
?FluidDensityMeasured_prop#01 rdf:type ddhub:DrillingDataPoint .
?FluidDensityMeasured_prop#01 ddhub:HasValue ?FluidDensityMeasured_prop .
?FullScaleUncertainty#01 rdf:type ddhub:FullScaleUncertainty .
?FullScaleUncertainty#01 ddhub:HasFullScale ?FluidDensityMeasured_fs#01 .
?FullScaleUncertainty#01 ddhub:HasProportionError ?FluidDensityMeasured_prop#01 .
?FluidDensityMeasured#01 ddhub:HasUncertainty ?FullScaleUncertainty#01 .
?FullScaleUncertainty#01 ddhub:HasUncertaintyMean ?FluidDensityMeasured#01 .
BIND ("3,31" as ?factOptionSet)
}
Semantic Queries for CuttingsDensityMeasured
Query-DrillingProperties.TestClass-CuttingsDensityMeasured-000
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX ddhub: <http://ddhub.no/>
PREFIX quantity: <http://ddhub.no/UnitAndQuantity>
SELECT ?CuttingsDensityMeasured
WHERE {
?CuttingsDensityMeasured rdf:type ddhub:DynamicDrillingSignal .
?CuttingsDensityMeasured#01 rdf:type ddhub:PhysicalData .
?CuttingsDensityMeasured#01 ddhub:HasDynamicValue ?CuttingsDensityMeasured .
?CuttingsDensityMeasured#01 ddhub:IsOfMeasurableQuantity quantity:DrillingDensity .
?tos#01 rdf:type ddhub:TopOfStringReferenceLocation .
?CuttingsDensityMeasured#01 ddhub:IsPhysicallyLocatedAt ?tos#01 .
?MovingAverage rdf:type ddhub:MovingAverage .
?CuttingsDensityMeasured#01 ddhub:IsTransformationOutput ?MovingAverage .
?LiquidComponent#01 rdf:type ddhub:LiquidComponent .
?CuttingsComponent#01 rdf:type ddhub:CuttingsComponent .
?GasComponent#01 rdf:type ddhub:GasComponent .
?CuttingsDensityMeasured#01 ddhub:ConcernsAFluidComponent ?CuttingsComponent#01 .
?CuttingsDensityMeasured#01 ddhub:ConcernsAFluidComponent ?LiquidComponent#01 .
?CuttingsDensityMeasured#01 ddhub:ConcernsAFluidComponent ?GasComponent#01 .
FILTER NOT EXISTS {
?CuttingsDensityMeasured#01 ddhub:ConcernsAFluidComponent ?LiquidComponent#01 .
?CuttingsDensityMeasured#01 ddhub:ConcernsAFluidComponent ?GasComponent#01 .
}
}
Query-DrillingProperties.TestClass-CuttingsDensityMeasured-001
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX ddhub: <http://ddhub.no/>
PREFIX quantity: <http://ddhub.no/UnitAndQuantity>
SELECT ?CuttingsDensityMeasured, ?sigma_CuttingsDensityMeasured, ?factOptionSet
WHERE {
?CuttingsDensityMeasured rdf:type ddhub:DynamicDrillingSignal .
?CuttingsDensityMeasured#01 rdf:type ddhub:PhysicalData .
?CuttingsDensityMeasured#01 ddhub:HasDynamicValue ?CuttingsDensityMeasured .
?CuttingsDensityMeasured#01 ddhub:IsOfMeasurableQuantity quantity:DrillingDensity .
?tos#01 rdf:type ddhub:TopOfStringReferenceLocation .
?CuttingsDensityMeasured#01 ddhub:IsPhysicallyLocatedAt ?tos#01 .
?MovingAverage rdf:type ddhub:MovingAverage .
?CuttingsDensityMeasured#01 ddhub:IsTransformationOutput ?MovingAverage .
?LiquidComponent#01 rdf:type ddhub:LiquidComponent .
?CuttingsComponent#01 rdf:type ddhub:CuttingsComponent .
?GasComponent#01 rdf:type ddhub:GasComponent .
?CuttingsDensityMeasured#01 ddhub:ConcernsAFluidComponent ?CuttingsComponent#01 .
?CuttingsDensityMeasured#01 ddhub:ConcernsAFluidComponent ?LiquidComponent#01 .
?CuttingsDensityMeasured#01 ddhub:ConcernsAFluidComponent ?GasComponent#01 .
?sigma_CuttingsDensityMeasured rdf:type ddhub:DrillingSignal .
?sigma_CuttingsDensityMeasured#01 rdf:type ddhub:DrillingDataPoint .
?sigma_CuttingsDensityMeasured#01 ddhub:HasValue ?sigma_CuttingsDensityMeasured .
?GaussianUncertainty#01 rdf:type ddhub:GaussianUncertainty .
?CuttingsDensityMeasured#01 ddhub:HasUncertainty ?GaussianUncertainty#01 .
?GaussianUncertainty#01 ddhub:HasUncertaintyStandardDeviation ?sigma_CuttingsDensityMeasured#01 .
FILTER NOT EXISTS {
?CuttingsDensityMeasured#01 ddhub:ConcernsAFluidComponent ?LiquidComponent#01 .
?CuttingsDensityMeasured#01 ddhub:ConcernsAFluidComponent ?GasComponent#01 .
}
BIND ("1" as ?factOptionSet)
}
Query-DrillingProperties.TestClass-CuttingsDensityMeasured-002
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX ddhub: <http://ddhub.no/>
PREFIX quantity: <http://ddhub.no/UnitAndQuantity>
SELECT ?CuttingsDensityMeasured, ?sigma_CuttingsDensityMeasured, ?factOptionSet
WHERE {
?CuttingsDensityMeasured rdf:type ddhub:DynamicDrillingSignal .
?CuttingsDensityMeasured#01 rdf:type ddhub:PhysicalData .
?CuttingsDensityMeasured#01 ddhub:HasDynamicValue ?CuttingsDensityMeasured .
?CuttingsDensityMeasured#01 ddhub:IsOfMeasurableQuantity quantity:DrillingDensity .
?tos#01 rdf:type ddhub:TopOfStringReferenceLocation .
?CuttingsDensityMeasured#01 ddhub:IsPhysicallyLocatedAt ?tos#01 .
?MovingAverage rdf:type ddhub:MovingAverage .
?CuttingsDensityMeasured#01 ddhub:IsTransformationOutput ?MovingAverage .
?LiquidComponent#01 rdf:type ddhub:LiquidComponent .
?CuttingsComponent#01 rdf:type ddhub:CuttingsComponent .
?GasComponent#01 rdf:type ddhub:GasComponent .
?CuttingsDensityMeasured#01 ddhub:ConcernsAFluidComponent ?CuttingsComponent#01 .
?CuttingsDensityMeasured#01 ddhub:ConcernsAFluidComponent ?LiquidComponent#01 .
?CuttingsDensityMeasured#01 ddhub:ConcernsAFluidComponent ?GasComponent#01 .
?sigma_CuttingsDensityMeasured rdf:type ddhub:DrillingSignal .
?sigma_CuttingsDensityMeasured#01 rdf:type ddhub:DrillingDataPoint .
?sigma_CuttingsDensityMeasured#01 ddhub:HasValue ?sigma_CuttingsDensityMeasured .
?GaussianUncertainty#01 rdf:type ddhub:GaussianUncertainty .
?CuttingsDensityMeasured#01 ddhub:HasUncertainty ?GaussianUncertainty#01 .
?GaussianUncertainty#01 ddhub:HasUncertaintyStandardDeviation ?sigma_CuttingsDensityMeasured#01 .
?GaussianUncertainty#01 ddhub:HasUncertaintyMean ?CuttingsDensityMeasured#01 .
FILTER NOT EXISTS {
?CuttingsDensityMeasured#01 ddhub:ConcernsAFluidComponent ?LiquidComponent#01 .
?CuttingsDensityMeasured#01 ddhub:ConcernsAFluidComponent ?GasComponent#01 .
}
BIND ("1,11" as ?factOptionSet)
}
Query-DrillingProperties.TestClass-CuttingsDensityMeasured-003
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX ddhub: <http://ddhub.no/>
PREFIX quantity: <http://ddhub.no/UnitAndQuantity>
SELECT ?CuttingsDensityMeasured, ?CuttingsDensityMeasured_prec, ?CuttingsDensityMeasured_acc, ?factOptionSet
WHERE {
?CuttingsDensityMeasured rdf:type ddhub:DynamicDrillingSignal .
?CuttingsDensityMeasured#01 rdf:type ddhub:PhysicalData .
?CuttingsDensityMeasured#01 ddhub:HasDynamicValue ?CuttingsDensityMeasured .
?CuttingsDensityMeasured#01 ddhub:IsOfMeasurableQuantity quantity:DrillingDensity .
?tos#01 rdf:type ddhub:TopOfStringReferenceLocation .
?CuttingsDensityMeasured#01 ddhub:IsPhysicallyLocatedAt ?tos#01 .
?MovingAverage rdf:type ddhub:MovingAverage .
?CuttingsDensityMeasured#01 ddhub:IsTransformationOutput ?MovingAverage .
?LiquidComponent#01 rdf:type ddhub:LiquidComponent .
?CuttingsComponent#01 rdf:type ddhub:CuttingsComponent .
?GasComponent#01 rdf:type ddhub:GasComponent .
?CuttingsDensityMeasured#01 ddhub:ConcernsAFluidComponent ?CuttingsComponent#01 .
?CuttingsDensityMeasured#01 ddhub:ConcernsAFluidComponent ?LiquidComponent#01 .
?CuttingsDensityMeasured#01 ddhub:ConcernsAFluidComponent ?GasComponent#01 .
?CuttingsDensityMeasured_prec rdf:type ddhub:DrillingSignal .
?CuttingsDensityMeasured_prec#01 rdf:type ddhub:DrillingDataPoint .
?CuttingsDensityMeasured_prec#01 ddhub:HasValue ?CuttingsDensityMeasured_prec .
?CuttingsDensityMeasured_acc rdf:type ddhub:DrillingSignal .
?CuttingsDensityMeasured_acc#01 rdf:type ddhub:DrillingDataPoint .
?CuttingsDensityMeasured_acc#01 ddhub:HasValue ?CuttingsDensityMeasured_acc .
?SensorUncertainty#01 rdf:type ddhub:SensorUncertainty .
?SensorUncertainty#01 ddhub:HasUncertaintyPrecision ?CuttingsDensityMeasured_prec#01 .
?SensorUncertainty#01 ddhub:HasUncertaintyAccuracy ?CuttingsDensityMeasured_acc#01 .
?CuttingsDensityMeasured#01 ddhub:HasUncertainty ?SensorUncertainty#01 .
FILTER NOT EXISTS {
?CuttingsDensityMeasured#01 ddhub:ConcernsAFluidComponent ?LiquidComponent#01 .
?CuttingsDensityMeasured#01 ddhub:ConcernsAFluidComponent ?GasComponent#01 .
}
BIND ("2" as ?factOptionSet)
}
Query-DrillingProperties.TestClass-CuttingsDensityMeasured-004
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX ddhub: <http://ddhub.no/>
PREFIX quantity: <http://ddhub.no/UnitAndQuantity>
SELECT ?CuttingsDensityMeasured, ?CuttingsDensityMeasured_prec, ?CuttingsDensityMeasured_acc, ?factOptionSet
WHERE {
?CuttingsDensityMeasured rdf:type ddhub:DynamicDrillingSignal .
?CuttingsDensityMeasured#01 rdf:type ddhub:PhysicalData .
?CuttingsDensityMeasured#01 ddhub:HasDynamicValue ?CuttingsDensityMeasured .
?CuttingsDensityMeasured#01 ddhub:IsOfMeasurableQuantity quantity:DrillingDensity .
?tos#01 rdf:type ddhub:TopOfStringReferenceLocation .
?CuttingsDensityMeasured#01 ddhub:IsPhysicallyLocatedAt ?tos#01 .
?MovingAverage rdf:type ddhub:MovingAverage .
?CuttingsDensityMeasured#01 ddhub:IsTransformationOutput ?MovingAverage .
?LiquidComponent#01 rdf:type ddhub:LiquidComponent .
?CuttingsComponent#01 rdf:type ddhub:CuttingsComponent .
?GasComponent#01 rdf:type ddhub:GasComponent .
?CuttingsDensityMeasured#01 ddhub:ConcernsAFluidComponent ?CuttingsComponent#01 .
?CuttingsDensityMeasured#01 ddhub:ConcernsAFluidComponent ?LiquidComponent#01 .
?CuttingsDensityMeasured#01 ddhub:ConcernsAFluidComponent ?GasComponent#01 .
?CuttingsDensityMeasured_prec rdf:type ddhub:DrillingSignal .
?CuttingsDensityMeasured_prec#01 rdf:type ddhub:DrillingDataPoint .
?CuttingsDensityMeasured_prec#01 ddhub:HasValue ?CuttingsDensityMeasured_prec .
?CuttingsDensityMeasured_acc rdf:type ddhub:DrillingSignal .
?CuttingsDensityMeasured_acc#01 rdf:type ddhub:DrillingDataPoint .
?CuttingsDensityMeasured_acc#01 ddhub:HasValue ?CuttingsDensityMeasured_acc .
?SensorUncertainty#01 rdf:type ddhub:SensorUncertainty .
?SensorUncertainty#01 ddhub:HasUncertaintyPrecision ?CuttingsDensityMeasured_prec#01 .
?SensorUncertainty#01 ddhub:HasUncertaintyAccuracy ?CuttingsDensityMeasured_acc#01 .
?CuttingsDensityMeasured#01 ddhub:HasUncertainty ?SensorUncertainty#01 .
?SensorUncertainty#01 ddhub:HasUncertaintyMean ?CuttingsDensityMeasured#01 .
FILTER NOT EXISTS {
?CuttingsDensityMeasured#01 ddhub:ConcernsAFluidComponent ?LiquidComponent#01 .
?CuttingsDensityMeasured#01 ddhub:ConcernsAFluidComponent ?GasComponent#01 .
}
BIND ("2,21" as ?factOptionSet)
}
Query-DrillingProperties.TestClass-CuttingsDensityMeasured-005
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX ddhub: <http://ddhub.no/>
PREFIX quantity: <http://ddhub.no/UnitAndQuantity>
SELECT ?CuttingsDensityMeasured, ?CuttingsDensityMeasured_fs, ?CuttingsDensityMeasured_prop, ?factOptionSet
WHERE {
?CuttingsDensityMeasured rdf:type ddhub:DynamicDrillingSignal .
?CuttingsDensityMeasured#01 rdf:type ddhub:PhysicalData .
?CuttingsDensityMeasured#01 ddhub:HasDynamicValue ?CuttingsDensityMeasured .
?CuttingsDensityMeasured#01 ddhub:IsOfMeasurableQuantity quantity:DrillingDensity .
?tos#01 rdf:type ddhub:TopOfStringReferenceLocation .
?CuttingsDensityMeasured#01 ddhub:IsPhysicallyLocatedAt ?tos#01 .
?MovingAverage rdf:type ddhub:MovingAverage .
?CuttingsDensityMeasured#01 ddhub:IsTransformationOutput ?MovingAverage .
?LiquidComponent#01 rdf:type ddhub:LiquidComponent .
?CuttingsComponent#01 rdf:type ddhub:CuttingsComponent .
?GasComponent#01 rdf:type ddhub:GasComponent .
?CuttingsDensityMeasured#01 ddhub:ConcernsAFluidComponent ?CuttingsComponent#01 .
?CuttingsDensityMeasured#01 ddhub:ConcernsAFluidComponent ?LiquidComponent#01 .
?CuttingsDensityMeasured#01 ddhub:ConcernsAFluidComponent ?GasComponent#01 .
?CuttingsDensityMeasured_fs rdf:type ddhub:DrillingSignal .
?CuttingsDensityMeasured_fs#01 rdf:type ddhub:DrillingDataPoint .
?CuttingsDensityMeasured_fs#01 ddhub:HasValue ?CuttingsDensityMeasured_fs .
?CuttingsDensityMeasured_prop rdf:type ddhub:DrillingSignal .
?CuttingsDensityMeasured_prop#01 rdf:type ddhub:DrillingDataPoint .
?CuttingsDensityMeasured_prop#01 ddhub:HasValue ?CuttingsDensityMeasured_prop .
?FullScaleUncertainty#01 rdf:type ddhub:FullScaleUncertainty .
?FullScaleUncertainty#01 ddhub:HasFullScale ?CuttingsDensityMeasured_fs#01 .
?FullScaleUncertainty#01 ddhub:HasProportionError ?CuttingsDensityMeasured_prop#01 .
?CuttingsDensityMeasured#01 ddhub:HasUncertainty ?FullScaleUncertainty#01 .
FILTER NOT EXISTS {
?CuttingsDensityMeasured#01 ddhub:ConcernsAFluidComponent ?LiquidComponent#01 .
?CuttingsDensityMeasured#01 ddhub:ConcernsAFluidComponent ?GasComponent#01 .
}
BIND ("3" as ?factOptionSet)
}
Query-DrillingProperties.TestClass-CuttingsDensityMeasured-006
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX ddhub: <http://ddhub.no/>
PREFIX quantity: <http://ddhub.no/UnitAndQuantity>
SELECT ?CuttingsDensityMeasured, ?CuttingsDensityMeasured_fs, ?CuttingsDensityMeasured_prop, ?factOptionSet
WHERE {
?CuttingsDensityMeasured rdf:type ddhub:DynamicDrillingSignal .
?CuttingsDensityMeasured#01 rdf:type ddhub:PhysicalData .
?CuttingsDensityMeasured#01 ddhub:HasDynamicValue ?CuttingsDensityMeasured .
?CuttingsDensityMeasured#01 ddhub:IsOfMeasurableQuantity quantity:DrillingDensity .
?tos#01 rdf:type ddhub:TopOfStringReferenceLocation .
?CuttingsDensityMeasured#01 ddhub:IsPhysicallyLocatedAt ?tos#01 .
?MovingAverage rdf:type ddhub:MovingAverage .
?CuttingsDensityMeasured#01 ddhub:IsTransformationOutput ?MovingAverage .
?LiquidComponent#01 rdf:type ddhub:LiquidComponent .
?CuttingsComponent#01 rdf:type ddhub:CuttingsComponent .
?GasComponent#01 rdf:type ddhub:GasComponent .
?CuttingsDensityMeasured#01 ddhub:ConcernsAFluidComponent ?CuttingsComponent#01 .
?CuttingsDensityMeasured#01 ddhub:ConcernsAFluidComponent ?LiquidComponent#01 .
?CuttingsDensityMeasured#01 ddhub:ConcernsAFluidComponent ?GasComponent#01 .
?CuttingsDensityMeasured_fs rdf:type ddhub:DrillingSignal .
?CuttingsDensityMeasured_fs#01 rdf:type ddhub:DrillingDataPoint .
?CuttingsDensityMeasured_fs#01 ddhub:HasValue ?CuttingsDensityMeasured_fs .
?CuttingsDensityMeasured_prop rdf:type ddhub:DrillingSignal .
?CuttingsDensityMeasured_prop#01 rdf:type ddhub:DrillingDataPoint .
?CuttingsDensityMeasured_prop#01 ddhub:HasValue ?CuttingsDensityMeasured_prop .
?FullScaleUncertainty#01 rdf:type ddhub:FullScaleUncertainty .
?FullScaleUncertainty#01 ddhub:HasFullScale ?CuttingsDensityMeasured_fs#01 .
?FullScaleUncertainty#01 ddhub:HasProportionError ?CuttingsDensityMeasured_prop#01 .
?CuttingsDensityMeasured#01 ddhub:HasUncertainty ?FullScaleUncertainty#01 .
?FullScaleUncertainty#01 ddhub:HasUncertaintyMean ?CuttingsDensityMeasured#01 .
FILTER NOT EXISTS {
?CuttingsDensityMeasured#01 ddhub:ConcernsAFluidComponent ?LiquidComponent#01 .
?CuttingsDensityMeasured#01 ddhub:ConcernsAFluidComponent ?GasComponent#01 .
}
BIND ("3,31" as ?factOptionSet)
}
Generation of Manifest Files
A DrillingProperty
may also be a source of information on the DDHub
server. In that case, it is necessary to define
the semantic of the associated signals and to inject the semantic on the server. The injection is based on using a
ManifestFile
. There is static method defined in GeneratorSparQLManifestFile
that can generate the ManifestFile
. This method uses
the SemanticFact
that are described as attributes of the property. It also utilizes the definition of the variables
as described by SemanticDiracVariableAttribute
and similar. An additional attribute is introduced: SemanticManifestOptionAttribute
.
Its role is to list the group of optional facts that shall be included in the semantic description. If there are several
semantic variable attributes that are declared for the DrillingProperty
, only those for which the variables are described
in the chosen optional facts will be used during the generation of the semantic description.
using OSDC.DotnetLibraries.Drilling.DrillingProperties;
using OSDC.UnitConversion.Conversion.DrillingEngineering;
using DWIS.Vocabulary.Schemas;
using System.Reflection;
using DWIS.API.DTO;
namespace DrillingProperties
{
public class TestClass
{
[AccessToVariable(CommonProperty.VariableAccessType.Assignable)]
[SemanticGaussianVariable("FluidDensityEstimated", "FluidDensityEstimatedStdDev")]
[SemanticFact("FluidDensityEstimated", Nouns.Enum.DynamicDrillingSignal)]
[SemanticFact("FluidDensityEstimated#01", Nouns.Enum.ComputedData)]
[SemanticFact("FluidDensityEstimated#01", Verbs.Enum.HasDynamicValue, "FluidDensityEstimated")]
[SemanticFact("FluidDensityEstimated#01", Verbs.Enum.IsOfMeasurableQuantity, DrillingPhysicalQuantity.QuantityEnum.DrillingDensity)]
[SemanticFact("FDEUncertainty#01", Nouns.Enum.GaussianUncertainty)]
[SemanticFact("FluidDensityEstimated#01", Verbs.Enum.HasUncertainty, "FDEUncertainty#01")]
[SemanticFact("FluidDensityEstimatedStdDev", Nouns.Enum.DynamicDrillingSignal)]
[SemanticFact("FluidDensityEstimatedStdDev#01", Nouns.Enum.DrillingDataPoint)]
[SemanticFact("FluidDensityEstimatedStdDev#01", Verbs.Enum.HasStaticValue, "FluidDensityEstimatedStdDev")]
[SemanticFact("FDEUncertainty#01", Verbs.Enum.HasUncertaintyStandardDeviation, "FluidDensityEstimatedStdDev#01")]
[OptionalFact(1, "FDEUncertainty#01", Verbs.Enum.HasUncertaintyMean, "FluidDensityEstimated#01")]
public GaussianDrillingProperty FluidDensityEstimated { get; set; } = new GaussianDrillingProperty();
[AccessToVariable(CommonProperty.VariableAccessType.Assignable)]
[SemanticGaussianVariable("FluidDensityMeasured", "sigma_FluidDensityMeasured")]
[SemanticSensorVariable("FluidDensityMeasured", "FluidDensityMeasured_prec", "FluidDensityMeasured_acc")]
[SemanticFullScaleVariable("FluidDensityMeasured", "FluidDensityMeasured_fs", "FluidDensityMeasured_prop")]
[SemanticExclusiveOr(1, 2, 3)]
[SemanticManifestOptions(2, 21)]
[SemanticFact("FluidDensityMeasured", Nouns.Enum.DynamicDrillingSignal)]
[SemanticFact("FluidDensityMeasured#01", Nouns.Enum.PhysicalData)]
[SemanticFact("FluidDensityMeasured#01", Verbs.Enum.HasDynamicValue, "FluidDensityMeasured")]
[SemanticFact("FluidDensityMeasured#01", Verbs.Enum.IsOfMeasurableQuantity, DrillingPhysicalQuantity.QuantityEnum.DrillingDensity)]
[SemanticFact("tos#01", Nouns.Enum.TopOfStringReferenceLocation)]
[SemanticFact("FluidDensityMeasured#01", Verbs.Enum.IsPhysicallyLocatedAt, "tos#01")]
[SemanticFact("MovingAverage", Nouns.Enum.MovingAverage)]
[SemanticFact("FluidDensityMeasured#01", Verbs.Enum.IsTransformationOutput, "MovingAverage")]
[OptionalFact(1, "sigma_FluidDensityMeasured", Nouns.Enum.DrillingSignal)]
[OptionalFact(1, "sigma_FluidDensityMeasured#01", Nouns.Enum.DrillingDataPoint)]
[OptionalFact(1, "sigma_FluidDensityMeasured#01", Verbs.Enum.HasValue, "sigma_FluidDensityMeasured")]
[OptionalFact(1, "GaussianUncertainty#01", Nouns.Enum.GaussianUncertainty)]
[OptionalFact(1, "FluidDensityMeasured#01", Verbs.Enum.HasUncertainty, "GaussianUncertainty#01")]
[OptionalFact(1, "GaussianUncertainty#01", Verbs.Enum.HasUncertaintyStandardDeviation, "sigma_FluidDensityMeasured#01")]
[OptionalFact(1, 11, "GaussianUncertainty#01", Verbs.Enum.HasUncertaintyMean, "FluidDensityMeasured#01")]
[OptionalFact(2, "FluidDensityMeasured_prec", Nouns.Enum.DrillingSignal)]
[OptionalFact(2, "FluidDensityMeasured_prec#01", Nouns.Enum.DrillingDataPoint)]
[OptionalFact(2, "FluidDensityMeasured_prec#01", Verbs.Enum.HasValue, "FluidDensityMeasured_prec")]
[OptionalFact(2, "FluidDensityMeasured_acc", Nouns.Enum.DrillingSignal)]
[OptionalFact(2, "FluidDensityMeasured_acc#01", Nouns.Enum.DrillingDataPoint)]
[OptionalFact(2, "FluidDensityMeasured_acc#01", Verbs.Enum.HasValue, "FluidDensityMeasured_acc")]
[OptionalFact(2, "SensorUncertainty#01", Nouns.Enum.SensorUncertainty)]
[OptionalFact(2, "SensorUncertainty#01", Verbs.Enum.HasUncertaintyPrecision, "FluidDensityMeasured_prec#01")]
[OptionalFact(2, "SensorUncertainty#01", Verbs.Enum.HasUncertaintyAccuracy, "FluidDensityMeasured_acc#01")]
[OptionalFact(2, "FluidDensityMeasured#01", Verbs.Enum.HasUncertainty, "SensorUncertainty#01")]
[OptionalFact(2, 21, "SensorUncertainty#01", Verbs.Enum.HasUncertaintyMean, "FluidDensityMeasured#01")]
[OptionalFact(3, "FluidDensityMeasured_fs", Nouns.Enum.DrillingSignal)]
[OptionalFact(3, "FluidDensityMeasured_fs#01", Nouns.Enum.DrillingDataPoint)]
[OptionalFact(3, "FluidDensityMeasured_fs#01", Verbs.Enum.HasValue, "FluidDensityMeasured_fs")]
[OptionalFact(3, "FluidDensityMeasured_prop", Nouns.Enum.DrillingSignal)]
[OptionalFact(3, "FluidDensityMeasured_prop#01", Nouns.Enum.DrillingDataPoint)]
[OptionalFact(3, "FluidDensityMeasured_prop#01", Verbs.Enum.HasValue, "FluidDensityMeasured_prop")]
[OptionalFact(3, "FullScaleUncertainty#01", Nouns.Enum.FullScaleUncertainty)]
[OptionalFact(3, "FullScaleUncertainty#01", Verbs.Enum.HasFullScale, "FluidDensityMeasured_fs#01")]
[OptionalFact(3, "FullScaleUncertainty#01", Verbs.Enum.HasProportionError, "FluidDensityMeasured_prop#01")]
[OptionalFact(3, "FluidDensityMeasured#01", Verbs.Enum.HasUncertainty, "FullScaleUncertainty#01")]
[OptionalFact(3, 31, "FullScaleUncertainty#01", Verbs.Enum.HasUncertaintyMean, "FluidDensityMeasured#01")]
public SensorDrillingProperty FluidDensityMeasured { get; set; } = new SensorDrillingProperty();
[AccessToVariable(CommonProperty.VariableAccessType.Readable)]
[Mandatory(CommonProperty.MandatoryType.General)]
[SemanticCategoricalVariable("AxialVelocityTopOfString", 3)]
[SemanticFact("AxialVelocityTopOfString", Nouns.Enum.DynamicDrillingSignal)]
[SemanticFact("AxialVelocityTopOfString#01", Nouns.Enum.ComputedData)]
[SemanticFact("AxialVelocityTopOfString#01", Nouns.Enum.EnumerationDataType)]
[SemanticFact("AxialVelocityTopOfString#01", Verbs.Enum.HasDynamicValue, "AxialVelocityTopOfString")]
[SemanticFact("tos#01", Nouns.Enum.TopOfStringReferenceLocation)]
[SemanticFact("AxialVelocityTopOfString#01", Verbs.Enum.IsPhysicallyLocatedAt, "tos#01")]
[SemanticFact("MovingAverage", Nouns.Enum.MovingAverage)]
[SemanticFact("AxialVelocityTopOfString#01", Verbs.Enum.IsTransformationOutput, "MovingAverage")]
public CategoricalDrillingProperty AxialVelocityTopOfString { get; set; } = new CategoricalDrillingProperty(3);
}
class Example
{
static void GenerateMermaidForMD(StreamWriter writer, string propertyName, string? mermaid)
{
if (writer != null && !string.IsNullOrEmpty(propertyName) && !string.IsNullOrEmpty(mermaid))
{
writer.WriteLine("# Semantic Graph for `" + propertyName + "`");
writer.WriteLine(mermaid);
}
}
static void Main()
{
TestClass testClass = new TestClass();
Assembly? assembly = Assembly.GetAssembly(typeof(TestClass));
if (assembly != null)
{
string tempPath = Directory.GetCurrentDirectory();
DirectoryInfo? dir = new DirectoryInfo(tempPath);
dir = dir?.Parent?.Parent?.Parent;
if (dir != null)
{
string tempFile = Path.Combine(dir.FullName, "Example06.md");
using (StreamWriter writer = new StreamWriter(tempFile))
{
var manifestFile1 = GeneratorSparQLManifestFile.GetManifestFile(assembly, typeof(TestClass).FullName, "FluidDensityEstimated", "SampleManifest", "ExampleCompany", "Test:");
if (manifestFile1 != null)
{
GenerateMermaidForMD(writer, "FluidDensityEstimated", GeneratorSparQLManifestFile.GetMermaid(manifestFile1));
}
var manifestFile2 = GeneratorSparQLManifestFile.GetManifestFile(assembly, typeof(TestClass).FullName, "FluidDensityMeasured", "SampleManifest", "ExampleCompany", "Test:");
if (manifestFile2 != null)
{
GenerateMermaidForMD(writer, "FluidDensityMeasured", GeneratorSparQLManifestFile.GetMermaid(manifestFile2));
}
var manifestFile3 = GeneratorSparQLManifestFile.GetManifestFile(assembly, typeof(TestClass).FullName, "AxialVelocityTopOfString", "SampleManifest", "ExampleCompany", "Test:");
if (manifestFile3 != null)
{
GenerateMermaidForMD(writer, "AxialVelocityTopOfString", GeneratorSparQLManifestFile.GetMermaid(manifestFile3));
}
}
}
}
}
}
}
And the results of this program are:
Semantic Graph for FluidDensityEstimated
flowchart TD
classDef typeClass fill:#f96;
classDef classClass fill:#9dd0ff;
classDef opcClass fill:#ff9dd0;
classDef quantityClass fill:#d0ff9d;
Test:FluidDensityEstimated([Test:FluidDensityEstimated]) --> opc:double([opc:double]):::opcClass
Test:FluidDensityEstimatedStdDev([Test:FluidDensityEstimatedStdDev]) --> opc:double([opc:double]):::opcClass
Test:FluidDensityEstimated_01([Test:FluidDensityEstimated_01]) --> ComputedData([ComputedData]):::typeClass
Test:FDEUncertainty_01([Test:FDEUncertainty_01]) --> GaussianUncertainty([GaussianUncertainty]):::typeClass
Test:FluidDensityEstimatedStdDev_01([Test:FluidDensityEstimatedStdDev_01]) --> DrillingDataPoint([DrillingDataPoint]):::typeClass
Test:FluidDensityEstimated_01([Test:FluidDensityEstimated_01]) -- http://ddhub.no/HasDynamicValue --> Test:FluidDensityEstimated([Test:FluidDensityEstimated]):::classClass
Test:FluidDensityEstimated_01([Test:FluidDensityEstimated_01]) -- http://ddhub.no/IsOfMeasurableQuantity --> Test:DrillingDensity([Test:DrillingDensity]):::quantityClass
Test:FluidDensityEstimated_01([Test:FluidDensityEstimated_01]) -- http://ddhub.no/HasUncertainty --> Test:FDEUncertainty_01([Test:FDEUncertainty_01]):::classClass
Test:FluidDensityEstimatedStdDev_01([Test:FluidDensityEstimatedStdDev_01]) -- http://ddhub.no/HasStaticValue --> Test:FluidDensityEstimatedStdDev([Test:FluidDensityEstimatedStdDev]):::classClass
Test:FDEUncertainty_01([Test:FDEUncertainty_01]) -- http://ddhub.no/HasUncertaintyStandardDeviation --> Test:FluidDensityEstimatedStdDev_01([Test:FluidDensityEstimatedStdDev_01]):::classClass
Semantic Graph for FluidDensityMeasured
flowchart TD
classDef typeClass fill:#f96;
classDef classClass fill:#9dd0ff;
classDef opcClass fill:#ff9dd0;
classDef quantityClass fill:#d0ff9d;
Test:FluidDensityMeasured([Test:FluidDensityMeasured]) --> opc:double([opc:double]):::opcClass
Test:FluidDensityMeasured_acc([Test:FluidDensityMeasured_acc]) --> opc:double([opc:double]):::opcClass
Test:FluidDensityMeasured_prec([Test:FluidDensityMeasured_prec]) --> opc:double([opc:double]):::opcClass
Test:FluidDensityMeasured_01([Test:FluidDensityMeasured_01]) --> PhysicalData([PhysicalData]):::typeClass
Test:tos_01([Test:tos_01]) --> TopOfStringReferenceLocation([TopOfStringReferenceLocation]):::typeClass
Test:MovingAverage([Test:MovingAverage]) --> MovingAverage([MovingAverage]):::typeClass
Test:FluidDensityMeasured_prec_01([Test:FluidDensityMeasured_prec_01]) --> DrillingDataPoint([DrillingDataPoint]):::typeClass
Test:FluidDensityMeasured_acc_01([Test:FluidDensityMeasured_acc_01]) --> DrillingDataPoint([DrillingDataPoint]):::typeClass
Test:SensorUncertainty_01([Test:SensorUncertainty_01]) --> SensorUncertainty([SensorUncertainty]):::typeClass
Test:FluidDensityMeasured_01([Test:FluidDensityMeasured_01]) -- http://ddhub.no/HasDynamicValue --> Test:FluidDensityMeasured([Test:FluidDensityMeasured]):::classClass
Test:FluidDensityMeasured_01([Test:FluidDensityMeasured_01]) -- http://ddhub.no/IsOfMeasurableQuantity --> Test:DrillingDensity([Test:DrillingDensity]):::quantityClass
Test:FluidDensityMeasured_01([Test:FluidDensityMeasured_01]) -- http://ddhub.no/IsPhysicallyLocatedAt --> Test:tos_01([Test:tos_01]):::classClass
Test:FluidDensityMeasured_01([Test:FluidDensityMeasured_01]) -- http://ddhub.no/IsTransformationOutput --> Test:MovingAverage([Test:MovingAverage]):::classClass
Test:FluidDensityMeasured_prec_01([Test:FluidDensityMeasured_prec_01]) -- http://ddhub.no/HasValue --> Test:FluidDensityMeasured_prec([Test:FluidDensityMeasured_prec]):::classClass
Test:FluidDensityMeasured_acc_01([Test:FluidDensityMeasured_acc_01]) -- http://ddhub.no/HasValue --> Test:FluidDensityMeasured_acc([Test:FluidDensityMeasured_acc]):::classClass
Test:SensorUncertainty_01([Test:SensorUncertainty_01]) -- http://ddhub.no/HasUncertaintyPrecision --> Test:FluidDensityMeasured_prec_01([Test:FluidDensityMeasured_prec_01]):::classClass
Test:SensorUncertainty_01([Test:SensorUncertainty_01]) -- http://ddhub.no/HasUncertaintyAccuracy --> Test:FluidDensityMeasured_acc_01([Test:FluidDensityMeasured_acc_01]):::classClass
Test:FluidDensityMeasured_01([Test:FluidDensityMeasured_01]) -- http://ddhub.no/HasUncertainty --> Test:SensorUncertainty_01([Test:SensorUncertainty_01]):::classClass
Test:SensorUncertainty_01([Test:SensorUncertainty_01]) -- http://ddhub.no/HasUncertaintyMean --> Test:FluidDensityMeasured_01([Test:FluidDensityMeasured_01]):::classClass
Semantic Graph for AxialVelocityTopOfString
flowchart TD
classDef typeClass fill:#f96;
classDef classClass fill:#9dd0ff;
classDef opcClass fill:#ff9dd0;
classDef quantityClass fill:#d0ff9d;
Test:AxialVelocityTopOfString([Test:AxialVelocityTopOfString]) --> opc:array_of_3_double([opc:array_of_3_double]):::opcClass
Test:AxialVelocityTopOfString_01([Test:AxialVelocityTopOfString_01]) --> ComputedData([ComputedData]):::typeClass
Test:tos_01([Test:tos_01]) --> TopOfStringReferenceLocation([TopOfStringReferenceLocation]):::typeClass
Test:MovingAverage([Test:MovingAverage]) --> MovingAverage([MovingAverage]):::typeClass
Test:AxialVelocityTopOfString_01([Test:AxialVelocityTopOfString_01]) -- http://ddhub.no/BelongsToClass --> http://ddhub.no/EnumerationDataType([http://ddhub.no/EnumerationDataType]):::classClass
Test:AxialVelocityTopOfString_01([Test:AxialVelocityTopOfString_01]) -- http://ddhub.no/HasDynamicValue --> Test:AxialVelocityTopOfString([Test:AxialVelocityTopOfString]):::classClass
Test:AxialVelocityTopOfString_01([Test:AxialVelocityTopOfString_01]) -- http://ddhub.no/IsPhysicallyLocatedAt --> Test:tos_01([Test:tos_01]):::classClass
Test:AxialVelocityTopOfString_01([Test:AxialVelocityTopOfString_01]) -- http://ddhub.no/IsTransformationOutput --> Test:MovingAverage([Test:MovingAverage]):::classClass
It can be noted that even though there both SemanticGaussianVariable
, SemanticSensorVariable
and SemanticFullScaleVariable
are defined as attributes to the property FluidDensityMeasured
, only the variables defined by SemanticSensorVariable
are used
in the ManifestFile
. This is because of the attribute SemanticManifestOptions
that declares that the semantic shall
use the options 2 and 21, which define the variables described in SemanticSensorVariable
, i.e., "FluidDensityMeasured", "FluidDensityMeasured_prec", "FluidDensityMeasured_acc".
Semantic Declations at Class Level
Sometime it is necessary to store on the DDHub more complex information than numerical or boolan values. For instance,
it may be necessary to pass structured information in their serialized form. Typically, the serialization is made using
Json
. Similarly to semantic definitions made at the property level for DrillingProperty
, it is possible to set
semantic information at the class or struct level. The available attributes are then:
AccessToVariableAttribute
ExcludeFactAttribute
OptionalExcludeFactAttribute
OptionalFactAttribute
SemanticExclusiveOrAttribute
SemanticFactAttribute
SemanticManifestOptionsAttribute
There is in addition an additional Attribute
reserved only for class
and struct
: SemanticTypeVariableAttribute
.
this attibute is used to define the variable name that is used in the semantic facts for accessing the serialized value of
the instance of the class or struct. It takes only one argument, namely the variable name.
Here is an example that shows how a class TestClass
can be declared on the DDHub
using a ManifestFile
and retrieved
from the DDHub
using a semantic query. The semantic of the test class corresponds to the a microstate generated by the
DWIS
drilling process state interpreter.
using OSDC.DotnetLibraries.Drilling.DrillingProperties;
using OSDC.UnitConversion.Conversion.DrillingEngineering;
using DWIS.Vocabulary.Schemas;
using System.Reflection;
using DWIS.API.DTO;
namespace DrillingProperties
{
[AccessToVariable(CommonProperty.VariableAccessType.Assignable)]
[SemanticTypeVariable("ComputedData")]
[SemanticFact("ComputedData", Nouns.Enum.DynamicDrillingSignal)]
[SemanticFact("ComputedData#01", Nouns.Enum.ComputedData)]
[SemanticFact("ComputedData#01", Verbs.Enum.HasDynamicValue, "ComputedData")]
[SemanticFact("ProcessState", Nouns.Enum.ProcessState)]
[SemanticFact("ProcessState", Nouns.Enum.DeterministicModel)]
[SemanticFact("ComputedData#01", Verbs.Enum.IsGeneratedBy, "ProcessState")]
[SemanticFact("DrillingProcessStateInterpreter", Nouns.Enum.DWISDrillingProcessStateInterpreter)]
[SemanticFact("ProcessState", Verbs.Enum.IsProvidedBy, "DrillingProcessStateInterpreter")]
public class TestClass
{
/// <summary>
/// the time stamp in UTC when the state has been updated
/// </summary>
public DateTime TimeStampUTC { get; set; }
/// <summary>
/// Part1: microstates from 0 to 15
/// </summary>
public int Part1 { get; set; }
/// <summary>
/// Part2: microstates from 16 to 31
/// </summary>
public int Part2 { get; set; }
/// <summary>
/// Part3: microstates from 32 to 47
/// </summary>
public int Part3 { get; set; }
/// <summary>
/// Part4: microstates from 48 to 63
/// </summary>
public int Part4 { get; set; }
/// <summary>
/// Part5: microstates from 64 to 79
/// </summary>
public int Part5 { get; set; }
}
class Example
{
static void GenerateMermaidForMD(StreamWriter writer, string? typeName, string? mermaid)
{
if (writer != null && !string.IsNullOrEmpty(typeName) && !string.IsNullOrEmpty(mermaid))
{
writer.WriteLine("# Semantic Graph for `" + typeName + "`");
writer.WriteLine(mermaid);
}
}
static void GenerateSparQLForMD(StreamWriter writer, string? typeName, Dictionary<string, QuerySpecification>? queries)
{
if (writer != null && !string.IsNullOrEmpty(typeName) && queries != null)
{
writer.WriteLine("# Semantic Queries for `" + typeName + "`");
foreach (var query in queries)
{
if (query.Value != null)
{
writer.WriteLine("## " + query.Key);
writer.WriteLine("```sparql");
writer.WriteLine(query.Value.SparQL);
writer.WriteLine("```");
}
}
}
}
static void Main()
{
TestClass testClass = new TestClass();
Assembly? assembly = Assembly.GetAssembly(typeof(TestClass));
if (assembly != null)
{
string tempPath = Directory.GetCurrentDirectory();
DirectoryInfo? dir = new DirectoryInfo(tempPath);
dir = dir?.Parent?.Parent?.Parent;
if (dir != null)
{
string tempFile = Path.Combine(dir.FullName, "Example07.md");
using (StreamWriter writer = new StreamWriter(tempFile))
{
var queries = GeneratorSparQLManifestFile.GetSparQLQueries(assembly, typeof(TestClass).FullName);
if (queries != null)
{
GenerateSparQLForMD(writer, typeof(TestClass).FullName, queries);
}
var manifestFile = GeneratorSparQLManifestFile.GetManifestFile(assembly, typeof(TestClass).FullName, "SampleManifest", "ExampleCompany", "Test:");
if (manifestFile != null)
{
GenerateMermaidForMD(writer, typeof(TestClass).FullName, GeneratorSparQLManifestFile.GetMermaid(manifestFile));
}
}
}
}
}
}
}
The results of this program are:
Semantic Queries for DrillingProperties.TestClass
Query-DrillingProperties.TestClass-000
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX ddhub: <http://ddhub.no/>
PREFIX quantity: <http://ddhub.no/UnitAndQuantity>
SELECT ?ComputedData
WHERE {
?ComputedData rdf:type ddhub:DynamicDrillingSignal .
?ComputedData#01 rdf:type ddhub:ComputedData .
?ComputedData#01 ddhub:HasDynamicValue ?ComputedData .
?ProcessState rdf:type ddhub:ProcessState .
?ProcessState ddhub:BelongsToClass ddhub:DeterministicModel .
?ComputedData#01 ddhub:IsGeneratedBy ?ProcessState .
?DrillingProcessStateInterpreter rdf:type ddhub:DWISDrillingProcessStateInterpreter .
?ProcessState ddhub:IsProvidedBy ?DrillingProcessStateInterpreter .
}
Semantic Graph for DrillingProperties.TestClass
flowchart TD
classDef typeClass fill:#f96;
classDef classClass fill:#9dd0ff;
classDef opcClass fill:#ff9dd0;
classDef quantityClass fill:#d0ff9d;
Test:ComputedData([Test:ComputedData]) --> opc:string([opc:string]):::opcClass
Test:ComputedData_01([Test:ComputedData_01]) --> ComputedData([ComputedData]):::typeClass
Test:ProcessState([Test:ProcessState]) --> ProcessState([ProcessState]):::typeClass
Test:DrillingProcessStateInterpreter([Test:DrillingProcessStateInterpreter]) --> DWISDrillingProcessStateInterpreter([DWISDrillingProcessStateInterpreter]):::typeClass
Test:ProcessState([Test:ProcessState]) -- http://ddhub.no/BelongsToClass --> http://ddhub.no/DeterministicModel([http://ddhub.no/DeterministicModel]):::classClass
Test:ComputedData_01([Test:ComputedData_01]) -- http://ddhub.no/HasDynamicValue --> Test:ComputedData([Test:ComputedData]):::classClass
Test:ComputedData_01([Test:ComputedData_01]) -- http://ddhub.no/IsGeneratedBy --> Test:ProcessState([Test:ProcessState]):::classClass
Test:ProcessState([Test:ProcessState]) -- http://ddhub.no/IsProvidedBy --> Test:DrillingProcessStateInterpreter([Test:DrillingProcessStateInterpreter]):::classClass
Dependence
This library depends on the following nugets:
DWIS.Vocabulary.Schemas
DWIS.Client.ReferenceImplementation
OSDC.DotnetLibraries.General.Statistics
OSDC.UnitConversion.Conversion.DrillingEngineering
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net8.0
- DWIS.Client.ReferenceImplementation (>= 2.1.3)
- OSDC.DotnetLibraries.General.Statistics (>= 3.1.1)
- OSDC.UnitConversion.Conversion.DrillingEngineering (>= 3.3.12)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on OSDC.DotnetLibraries.Drilling.DrillingProperties:
Package | Downloads |
---|---|
DWIS.MicroState.Model
This is the complete data model (including the semantical attributes) of the data used by the D-WIS Microstate interpretation engine |
|
OSDC.DotnetLibraries.Drilling.DrillingProperties.RDF
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
10.2.2-build.10 | 38 | 10/21/2024 |
10.2.2-build.7 | 60 | 10/17/2024 |
10.2.2-build.4 | 41 | 10/14/2024 |
10.2.2-build.1 | 53 | 10/11/2024 |
10.1.14 | 104 | 10/9/2024 |
10.1.13 | 153 | 10/8/2024 |
10.1.12 | 83 | 10/7/2024 |
10.1.11 | 89 | 10/3/2024 |
10.1.10 | 128 | 9/30/2024 |
10.1.9 | 93 | 9/22/2024 |
10.1.8 | 90 | 9/22/2024 |
10.1.7 | 84 | 9/22/2024 |
10.1.6 | 85 | 9/20/2024 |
10.1.5 | 104 | 9/2/2024 |
10.1.4 | 240 | 5/10/2024 |
10.1.3 | 105 | 5/9/2024 |
10.1.2 | 130 | 5/6/2024 |
10.1.1 | 86 | 5/3/2024 |
10.1.0 | 66 | 5/2/2024 |
10.0.2 | 95 | 4/29/2024 |
10.0.1 | 90 | 4/29/2024 |
10.0.0 | 107 | 4/26/2024 |
9.1.0 | 100 | 4/26/2024 |
9.0.1 | 102 | 4/25/2024 |
9.0.0 | 102 | 4/23/2024 |
8.0.3 | 108 | 4/23/2024 |
8.0.2 | 120 | 4/22/2024 |
8.0.1 | 108 | 4/22/2024 |
8.0.0 | 105 | 4/22/2024 |
7.0.0 | 96 | 4/21/2024 |
6.0.0 | 97 | 4/10/2024 |
5.3.0 | 115 | 4/3/2024 |
5.2.8 | 116 | 4/3/2024 |
5.2.7 | 104 | 4/2/2024 |
5.2.6 | 113 | 4/2/2024 |
5.2.5 | 115 | 4/1/2024 |
5.2.4 | 121 | 4/1/2024 |
5.2.3 | 108 | 4/1/2024 |
5.2.2 | 111 | 4/1/2024 |
5.2.1 | 100 | 4/1/2024 |
5.2.0 | 104 | 4/1/2024 |
5.1.10 | 111 | 3/30/2024 |
5.1.9 | 124 | 3/30/2024 |
5.1.8 | 110 | 3/30/2024 |
5.1.7 | 114 | 3/30/2024 |
5.1.6 | 110 | 3/30/2024 |
5.1.5 | 124 | 3/30/2024 |
5.1.4 | 120 | 3/30/2024 |
5.1.3 | 117 | 3/27/2024 |
5.1.2 | 107 | 3/27/2024 |
5.1.1 | 115 | 3/27/2024 |
5.1.0 | 111 | 3/27/2024 |
5.0.1 | 97 | 3/27/2024 |
5.0.0 | 108 | 3/27/2024 |
4.0.1 | 129 | 3/26/2024 |
4.0.0 | 140 | 3/26/2024 |
3.0.6 | 132 | 3/1/2024 |
3.0.5 | 105 | 3/1/2024 |
3.0.4 | 127 | 2/29/2024 |
3.0.3 | 111 | 2/29/2024 |
3.0.2 | 114 | 2/29/2024 |
3.0.1 | 118 | 2/21/2024 |
2.0.1 | 123 | 2/16/2024 |
2.0.0 | 142 | 2/8/2024 |