BrickSchema / py-brickschema

Python package for working with Brick (brickschema.org/)
Other
52 stars 14 forks source link

Graph.validate() fails when Brick ontology is preloaded to the graph #106

Open emesar opened 6 months ago

emesar commented 6 months ago

For a simple graph that only includes the Brick ontology, validation appears to fail.

from brickschema import Graph

g = Graph(load_brick=True)
_, _, report = g.validate()
print(report)

The resulting report:

Validation Report
Conforms: False
Results (38):
Constraint Violation in ClassConstraintComponent (http://www.w3.org/ns/shacl#ClassConstraintComponent):
        Severity: sh:Violation
        Source Shape: bsh:hasQUDTReferenceShape
        Focus Node: brick:Power_Factor
        Value Node: qudtqk:PowerFactor
        Result Path: brick:hasQUDTReference
        Message: Value does not have class qudt:QuantityKind
Constraint Violation in ClassConstraintComponent (http://www.w3.org/ns/shacl#ClassConstraintComponent):
        Severity: sh:Violation
        Source Shape: bsh:hasQUDTReferenceShape
        Focus Node: brick:Speed
        Value Node: qudtqk:Speed
        Result Path: brick:hasQUDTReference
        Message: Value does not have class qudt:QuantityKind
Constraint Violation in ClassConstraintComponent (http://www.w3.org/ns/shacl#ClassConstraintComponent):
        Severity: sh:Violation
        Source Shape: bsh:hasQUDTReferenceShape
        Focus Node: brick:Capacity
        Value Node: qudtqk:Capacity
        Result Path: brick:hasQUDTReference
        Message: Value does not have class qudt:QuantityKind
Constraint Violation in ClassConstraintComponent (http://www.w3.org/ns/shacl#ClassConstraintComponent):
        Severity: sh:Violation
        Source Shape: bsh:hasQUDTReferenceShape
        Focus Node: brick:Active_Power
        Value Node: qudtqk:ActivePower
        Result Path: brick:hasQUDTReference
        Message: Value does not have class qudt:QuantityKind
Constraint Violation in ClassConstraintComponent (http://www.w3.org/ns/shacl#ClassConstraintComponent):
        Severity: sh:Violation
        Source Shape: bsh:hasQUDTReferenceShape
        Focus Node: brick:Luminous_Intensity
        Value Node: qudtqk:LuminousIntensity
        Result Path: brick:hasQUDTReference
        Message: Value does not have class qudt:QuantityKind
Constraint Violation in ClassConstraintComponent (http://www.w3.org/ns/shacl#ClassConstraintComponent):
        Severity: sh:Violation
        Source Shape: bsh:hasQUDTReferenceShape
        Focus Node: brick:Time
        Value Node: qudtqk:Time
        Result Path: brick:hasQUDTReference
        Message: Value does not have class qudt:QuantityKind
Constraint Violation in ClassConstraintComponent (http://www.w3.org/ns/shacl#ClassConstraintComponent):
        Severity: sh:Violation
        Source Shape: bsh:hasQUDTReferenceShape
        Focus Node: brick:Flow
        Value Node: qudtqk:VolumeFlowRate
        Result Path: brick:hasQUDTReference
        Message: Value does not have class qudt:QuantityKind
Constraint Violation in ClassConstraintComponent (http://www.w3.org/ns/shacl#ClassConstraintComponent):
        Severity: sh:Violation
        Source Shape: bsh:hasQUDTReferenceShape
        Focus Node: brick:Conductivity
        Value Node: qudtqk:Conductivity
        Result Path: brick:hasQUDTReference
        Message: Value does not have class qudt:QuantityKind
Constraint Violation in ClassConstraintComponent (http://www.w3.org/ns/shacl#ClassConstraintComponent):
        Severity: sh:Violation
        Source Shape: bsh:hasQUDTReferenceShape
        Focus Node: brick:Voltage
        Value Node: qudtqk:Voltage
        Result Path: brick:hasQUDTReference
        Message: Value does not have class qudt:QuantityKind
Constraint Violation in ClassConstraintComponent (http://www.w3.org/ns/shacl#ClassConstraintComponent):
        Severity: sh:Violation
        Source Shape: bsh:hasQUDTReferenceShape
        Focus Node: brick:Atmospheric_Pressure
        Value Node: qudtqk:AtmosphericPressure
        Result Path: brick:hasQUDTReference
        Message: Value does not have class qudt:QuantityKind
Constraint Violation in ClassConstraintComponent (http://www.w3.org/ns/shacl#ClassConstraintComponent):
        Severity: sh:Violation
        Source Shape: bsh:hasQUDTReferenceShape
        Focus Node: brick:Luminance
        Value Node: qudtqk:Luminance
        Result Path: brick:hasQUDTReference
        Message: Value does not have class qudt:QuantityKind
Constraint Violation in ClassConstraintComponent (http://www.w3.org/ns/shacl#ClassConstraintComponent):
        Severity: sh:Violation
        Source Shape: bsh:hasQUDTReferenceShape
        Focus Node: brick:Torque
        Value Node: qudtqk:Torque
        Result Path: brick:hasQUDTReference
        Message: Value does not have class qudt:QuantityKind
Constraint Violation in ClassConstraintComponent (http://www.w3.org/ns/shacl#ClassConstraintComponent):
        Severity: sh:Violation
        Source Shape: bsh:hasQUDTReferenceShape
        Focus Node: brick:Radiance
        Value Node: qudtqk:Radiance
        Result Path: brick:hasQUDTReference
        Message: Value does not have class qudt:QuantityKind
Constraint Violation in ClassConstraintComponent (http://www.w3.org/ns/shacl#ClassConstraintComponent):
        Severity: sh:Violation
        Source Shape: bsh:hasQUDTReferenceShape
        Focus Node: brick:Temperature
        Value Node: qudtqk:Temperature
        Result Path: brick:hasQUDTReference
        Message: Value does not have class qudt:QuantityKind
Constraint Violation in ClassConstraintComponent (http://www.w3.org/ns/shacl#ClassConstraintComponent):
        Severity: sh:Violation
        Source Shape: bsh:hasQUDTReferenceShape
        Focus Node: brick:Angle
        Value Node: qudtqk:Angle
        Result Path: brick:hasQUDTReference
        Message: Value does not have class qudt:QuantityKind
Constraint Violation in ClassConstraintComponent (http://www.w3.org/ns/shacl#ClassConstraintComponent):
        Severity: sh:Violation
        Source Shape: bsh:hasQUDTReferenceShape
        Focus Node: brick:Differential_Dynamic_Pressure
        Value Node: qudtqk:DynamicPressure
        Result Path: brick:hasQUDTReference
        Message: Value does not have class qudt:QuantityKind
Constraint Violation in ClassConstraintComponent (http://www.w3.org/ns/shacl#ClassConstraintComponent):
        Severity: sh:Violation
        Source Shape: bsh:hasQUDTReferenceShape
        Focus Node: brick:Frequency
        Value Node: qudtqk:Frequency
        Result Path: brick:hasQUDTReference
        Message: Value does not have class qudt:QuantityKind
Constraint Violation in ClassConstraintComponent (http://www.w3.org/ns/shacl#ClassConstraintComponent):
        Severity: sh:Violation
        Source Shape: bsh:hasQUDTReferenceShape
        Focus Node: brick:Absolute_Humidity
        Value Node: qudtqk:AbsoluteHumidity
        Result Path: brick:hasQUDTReference
        Message: Value does not have class qudt:QuantityKind
Constraint Violation in ClassConstraintComponent (http://www.w3.org/ns/shacl#ClassConstraintComponent):
        Severity: sh:Violation
        Source Shape: bsh:hasQUDTReferenceShape
        Focus Node: brick:Relative_Humidity
        Value Node: qudtqk:RelativeHumidity
        Result Path: brick:hasQUDTReference
        Message: Value does not have class qudt:QuantityKind
Constraint Violation in ClassConstraintComponent (http://www.w3.org/ns/shacl#ClassConstraintComponent):
        Severity: sh:Violation
        Source Shape: bsh:hasQUDTReferenceShape
        Focus Node: brick:Mass
        Value Node: qudtqk:Mass
        Result Path: brick:hasQUDTReference
        Message: Value does not have class qudt:QuantityKind
Constraint Violation in ClassConstraintComponent (http://www.w3.org/ns/shacl#ClassConstraintComponent):
        Severity: sh:Violation
        Source Shape: bsh:hasQUDTReferenceShape
        Focus Node: brick:Complex_Power
        Value Node: qudtqk:ComplexPower
        Result Path: brick:hasQUDTReference
        Message: Value does not have class qudt:QuantityKind
Constraint Violation in ClassConstraintComponent (http://www.w3.org/ns/shacl#ClassConstraintComponent):
        Severity: sh:Violation
        Source Shape: bsh:hasQUDTReferenceShape
        Focus Node: brick:Volume
        Value Node: qudtqk:Volume
        Result Path: brick:hasQUDTReference
        Message: Value does not have class qudt:QuantityKind
Constraint Violation in ClassConstraintComponent (http://www.w3.org/ns/shacl#ClassConstraintComponent):
        Severity: sh:Violation
        Source Shape: bsh:hasQUDTReferenceShape
        Focus Node: brick:Electric_Power
        Value Node: qudtqk:ElectricPower
        Result Path: brick:hasQUDTReference
        Message: Value does not have class qudt:QuantityKind
Constraint Violation in ClassConstraintComponent (http://www.w3.org/ns/shacl#ClassConstraintComponent):
        Severity: sh:Violation
        Source Shape: bsh:hasQUDTReferenceShape
        Focus Node: brick:Pressure
        Value Node: qudtqk:Pressure
        Result Path: brick:hasQUDTReference
        Message: Value does not have class qudt:QuantityKind
Constraint Violation in ClassConstraintComponent (http://www.w3.org/ns/shacl#ClassConstraintComponent):
        Severity: sh:Violation
        Source Shape: bsh:hasQUDTReferenceShape
        Focus Node: brick:Static_Pressure
        Value Node: qudtqk:StaticPressure
        Result Path: brick:hasQUDTReference
        Message: Value does not have class qudt:QuantityKind
Constraint Violation in ClassConstraintComponent (http://www.w3.org/ns/shacl#ClassConstraintComponent):
        Severity: sh:Violation
        Source Shape: bsh:hasQUDTReferenceShape
        Focus Node: brick:Dewpoint
        Value Node: qudtqk:DewPointTemperature
        Result Path: brick:hasQUDTReference
        Message: Value does not have class qudt:QuantityKind
Constraint Violation in ClassConstraintComponent (http://www.w3.org/ns/shacl#ClassConstraintComponent):
        Severity: sh:Violation
        Source Shape: bsh:hasQUDTReferenceShape
        Focus Node: brick:Luminous_Flux
        Value Node: qudtqk:LuminousFlux
        Result Path: brick:hasQUDTReference
        Message: Value does not have class qudt:QuantityKind
Constraint Violation in ClassConstraintComponent (http://www.w3.org/ns/shacl#ClassConstraintComponent):
        Severity: sh:Violation
        Source Shape: bsh:hasQUDTReferenceShape
        Focus Node: brick:Apparent_Power
        Value Node: qudtqk:ApparentPower
        Result Path: brick:hasQUDTReference
        Message: Value does not have class qudt:QuantityKind
Constraint Violation in ClassConstraintComponent (http://www.w3.org/ns/shacl#ClassConstraintComponent):
        Severity: sh:Violation
        Source Shape: bsh:hasQUDTReferenceShape
        Focus Node: brick:Real_Power
        Value Node: qudtqk:ActivePower
        Result Path: brick:hasQUDTReference
        Message: Value does not have class qudt:QuantityKind
Constraint Violation in ClassConstraintComponent (http://www.w3.org/ns/shacl#ClassConstraintComponent):
        Severity: sh:Violation
        Source Shape: bsh:hasQUDTReferenceShape
        Focus Node: brick:Enthalpy
        Value Node: qudtqk:Enthalpy
        Result Path: brick:hasQUDTReference
        Message: Value does not have class qudt:QuantityKind
Constraint Violation in ClassConstraintComponent (http://www.w3.org/ns/shacl#ClassConstraintComponent):
        Severity: sh:Violation
        Source Shape: bsh:hasQUDTReferenceShape
        Focus Node: brick:Illuminance
        Value Node: qudtqk:Illuminance
        Result Path: brick:hasQUDTReference
        Message: Value does not have class qudt:QuantityKind
Constraint Violation in ClassConstraintComponent (http://www.w3.org/ns/shacl#ClassConstraintComponent):
        Severity: sh:Violation
        Source Shape: bsh:hasQUDTReferenceShape
        Focus Node: brick:Reactive_Power
        Value Node: qudtqk:ReactivePower
        Result Path: brick:hasQUDTReference
        Message: Value does not have class qudt:QuantityKind
Constraint Violation in ClassConstraintComponent (http://www.w3.org/ns/shacl#ClassConstraintComponent):
        Severity: sh:Violation
        Source Shape: bsh:hasQUDTReferenceShape
        Focus Node: brick:Differential_Temperature
        Value Node: qudtqk:Temperature
        Result Path: brick:hasQUDTReference
        Message: Value does not have class qudt:QuantityKind
Constraint Violation in ClassConstraintComponent (http://www.w3.org/ns/shacl#ClassConstraintComponent):
        Severity: sh:Violation
        Source Shape: bsh:hasQUDTReferenceShape
        Focus Node: brick:Electric_Current
        Value Node: qudtqk:ElectricCurrent
        Result Path: brick:hasQUDTReference
        Message: Value does not have class qudt:QuantityKind
Constraint Violation in ClassConstraintComponent (http://www.w3.org/ns/shacl#ClassConstraintComponent):
        Severity: sh:Violation
        Source Shape: bsh:hasQUDTReferenceShape
        Focus Node: brick:Thermal_Energy
        Value Node: qudtqk:ThermalEnergy
        Result Path: brick:hasQUDTReference
        Message: Value does not have class qudt:QuantityKind
Constraint Violation in ClassConstraintComponent (http://www.w3.org/ns/shacl#ClassConstraintComponent):
        Severity: sh:Violation
        Source Shape: bsh:hasQUDTReferenceShape
        Focus Node: brick:Differential_Static_Pressure
        Value Node: qudtqk:StaticPressure
        Result Path: brick:hasQUDTReference
        Message: Value does not have class qudt:QuantityKind
Constraint Violation in ClassConstraintComponent (http://www.w3.org/ns/shacl#ClassConstraintComponent):
        Severity: sh:Violation
        Source Shape: bsh:hasQUDTReferenceShape
        Focus Node: brick:Power
        Value Node: qudtqk:Power
        Result Path: brick:hasQUDTReference
        Message: Value does not have class qudt:QuantityKind
Constraint Violation in ClassConstraintComponent (http://www.w3.org/ns/shacl#ClassConstraintComponent):
        Severity: sh:Violation
        Source Shape: bsh:hasQUDTReferenceShape
        Focus Node: brick:Velocity_Pressure
        Value Node: qudtqk:DynamicPressure
        Result Path: brick:hasQUDTReference
        Message: Value does not have class qudt:QuantityKind
gtfierro commented 6 months ago

This is due to recent changes in QUDT, which caught some insufficient extensions of QUDT we were doing in Brick. As long as you just have these QUDT results in your validation result, you should be ok. We are working on fixing these validation issues in the main Brick repo