Hi Steve,

In principle, there could be several kind of things that one may expect to be 
instances of the test1:PressureMeasuringDevice.

Since I don’t have a good example with pressure at the moment, let's talk, 
instead, about WeightMeasuringDevice such as a scale. The idea is the same:

1. There are different models of scales 
e.g.,https://www.amazon.com/eufy-Bluetooth-Measurements-Composition-Analysis/dp/B07GZBXCH6
 
<https://www.amazon.com/eufy-Bluetooth-Measurements-Composition-Analysis/dp/B07GZBXCH6>,
 so a model could be an instance. Models don’t really have quantities since a 
quantity is a specific measurement with a value. But one could say that a model 
is used to measure human weight as opposed to the weight of food.
2. There are instances of scales - a specific scale of the model 
https://www.amazon.com/eufy-Bluetooth-Measurements-Composition-Analysis/dp/B07GZBXCH6
 
<https://www.amazon.com/eufy-Bluetooth-Measurements-Composition-Analysis/dp/B07GZBXCH6>,
 with its specific barcode
3. There are applied instances of scales. In other words, it is not only a 
specific scale, but it is a scale that is being used to measure my weight 

I think you are describing the third situation because you are wanting to 
specify quantities e.g., Irene’s weight would be an instance of qudt:Quantity. 
Presumably, in your data you will have instances of qudt:Quantity and you want 
to ensure that they have the right unit of measure.

Your model would work fine for data validation of existing data e.g., if you 
have an instance of a weight measuring device and it is said to produce 
measurements (quantities) that are not measured in units of the right quantity 
kind, e.g., it is said that Irene’s weight is measured in meters you will get a 
violation. The device will be flagged as invalid.

I don’t like that both property shapes in your example have the same sh:name - 
this is confusing.

If on the other hand, you want to be able to create data based on this model 
e.g., when you create a device and then create a quantity "Irene’s weight", you 
want to be offered for selection only the appropriate units if this is a 
quantity measured by your device, then this model would not support it in EDG 
and, I doubt, would support it for any tool out of the box. 

If quantities such as Irene’s weight are already existing when you create a 
device, you may want to be offered just the quantities that use appropriate 
units of measure when describing the device. This would not work out of the box 
either.

You could create a custom application targeted to your use of your specific 
modeling pattern.

Also, with data validation, is it the device that is invalid or is it the  
quantity that is invalid? Can quantities exist independent of the devices that 
measure them? May be the issue is with the quantity - it got described with the 
wrong units and not with the device. In other words, it is correct to say that 
a specific device is used to measure my weight, but it is not correct to say 
that my weight could be measured in meters. Further, data about my weight could 
exist without knowing a specific scale that measured it.

In other words, the model design depends on whether it is only for validation 
of already existing data or for guiding you in correctly creating new data. It 
also depends on what is the focus of your validation - devices or quantities.

> On Oct 13, 2020, at 4:52 PM, Steve Ray <[email protected]> wrote:
> 
> Irene,
> To answer your question about what my second case would look like,
> here's a working example:
> 
> test1:PressureMeasuringDevice
>  a owl:Class ;
>  a sh:NodeShape ;
>  rdfs:subClassOf owl:Thing ;
>  sh:property [
>      a sh:PropertyShape ;
>      sh:path test1:producesMeasurements ;
>      sh:class qudt:Quantity ;
>      sh:name "produces measurements" ;
>    ] ;
>  sh:property [
>      a sh:PropertyShape ;
>      sh:path (
>          test1:producesMeasurements
>          qudt:unit
>          qudt:hasQuantityKind
>        ) ;
>      sh:hasValue <http://qudt.org/vocab/quantitykind/ForcePerArea> ;
>      sh:name "produces measurements" ;
>    ] ;
> .
> 
> Note that this does not require the definition of a constrained class
> PowerMeasurement. Instead, it just says "I expect an instance of the
> generalized qudt:Quantity class, but it had better have a unit with a
> quantitykind of ForcePerArea".
> 
> So, the advantage of this method is there are fewer subClasses of my
> Measurement class that I would have to define. The cost is more
> complex property shapes.
> 
> I'm quite interested in your opinion of this.
> 
> 
> Steve
> 
> 
> On Mon, Oct 12, 2020 at 12:04 PM Irene Polikoff <[email protected]> wrote:
>> 
>> I do not understand the difference between two options you are outlining. In 
>> the second case, how would the constraint look like?
>> 
>> The bigger question that would ultimately determine the answer is “what you 
>> would like to accomplish by producing this model and what do you expect to 
>> see in typical data that you will use with it?”. In other words, what do you 
>> want it to do e.g., what constraint violations would you like it to produce 
>> when validating what kind of data, what inferences would you like it to 
>> create if any?
>> 
>> There are few general best practices that can be stated in abstract, such as:
>> 
>> Do not use inverse properties; instead, use shapes with inverse paths
>> When deciding what direction to create a property in, go from “many” to “one”
>> 
>> 
>> But for most guidance, the data and goals need to be understood. There are 
>> many different options and alternatives with SHACL.  Even with the ones 
>> above it is not “100% must do", ultimately, it all depends.
>> 
>> On Oct 12, 2020, at 2:38 PM, Steve Ray <[email protected]> wrote:
>> 
>> This question is directed at anyone in this group who is fluent in
>> SHACL. I'm looking for guidance on best practices for modeling the
>> following kind of pattern:
>> 
>> A PowerMeasurementDevice takes measurements of Power.
>> 
>> Is it better practice to put a SHACL constraint on the instances of a
>> class called PowerMeasurement (that they should be measurements of
>> Power), where:
>> 
>> PowerMeasurementDevice producesMeasurements PowerMeasurement .
>> 
>> 
>> or, should I just define a property shape for PowerMeasurementDevice
>> such that the property producesMeasurements has the appropriate
>> constraints? In this case, I don't need to create a special class
>> called PowerMeasurement.
>> 
>> Any thoughts one way or the other? I'm leaning toward the explicit
>> definition of a PowerMeasurement class, but it's more intuition than
>> principle.
>> 
>> 
>> Steve
>> 
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "TopBraid Suite Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/topbraid-users/CAGUep87ZvBUe0urm5V6rxFPJOVpYCzG3Aa0qz7DxFBH-9TR9Wg%40mail.gmail.com.
>> 
>> 
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "TopBraid Suite Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/topbraid-users/E7D12854-E0D7-4342-AB1C-989E1CD1D12A%40topquadrant.com.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "TopBraid Suite Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/topbraid-users/CAGUep85%2B0qGh7WHakFjq2Y0hRfnWKMOBMUG91MaYOuOCJFTB6A%40mail.gmail.com.

-- 
You received this message because you are subscribed to the Google Groups 
"TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/topbraid-users/8D7DA1E3-2FF9-4C45-90FD-F1F9D4A61942%40topquadrant.com.

Reply via email to