Adding value restrictions on data properties

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Adding value restrictions on data properties

Lindsay
Hi all! I'm trying to create a class called high energy instrument that is equivalent to an instrument that has a power greater than a certain value.

I'm using bfo and common core ontologies. This what I have so far.

class HighEnergyInstrument():
            equivalent_to = [SatelliteInstrument &has_quality.some(
                              Power & is_measured_by_ratio.some(
                               RatioMeasurementInformationContentEntity & inheres_in.some(
                                InformationBearingEntity & has_integer_value.min(30,)
                                  & uses_measurement_unit.some(units.WattMeasurementUnit)
                              )))]
       

in protege I would use the string '30'^^xsd:integer but I'm not sure if there's something different in owlready2.

Thanks in advance!
Reply | Threaded
Open this post in threaded view
|

Re: Adding value restrictions on data properties

Jiba
Administrator
Hello,

I think you should use constrained datatypes. For example, has_integer_value.min(30,) should be written:

        ConstrainedDatatype(int, min_inclusive = 30)

Constrained datatypes can be used as a class, e.g. in a some() or only() statement.

Best regards,
Jean-Baptiste Lamy
MCF, LIMICS, Université Paris 13
Reply | Threaded
Open this post in threaded view
|

Re: Adding value restrictions on data properties

Lindsay
That's exactly what I was looking for. Thanks!