You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm slightly confused whether my SPARQLConstraint (see below) is wrong or if there is a bug in RDF4J because the constraint does not fail.... but when the same query executed as a regular SPARQL query against the repository/connection API, it delivers valid results. In my understanding (correct me if this is wrong) results should result in violations.
In my app, you can assemble satellites and here I want to check if the maximum Voltage delivered by a PowerSupply-Component is sufficient to cover the demand (as a sum) of all connected Components which are subClasses of PowerSupplySink. PowerSupply and PowerSink instances both have exactly one :hasProperty/hasMaximumValue (for suppliers) and :hasProperty/hasFixedValue (for Sink) each, respectively.
The generic SPARQL-query that actually works looks like this:
String query = """
PREFIX schumann: <http://www.semanticweb.org/theod/ontologies/2023/7/schumann-ontology#>
SELECT ?this ?value
WHERE {
BIND(schumann:FSM_1_Battery as ?this)
{
SELECT ?maxVoltage
WHERE {
?this schumann:hasProperty/schumann:hasMaximumValue ?maxVoltage .
}
}
{
SELECT (sum(?voltage) AS ?value)
WHERE {
?this schumann:connectedTo/schumann:hasProperty/schumann:hasFixedValue ?voltage .
}
}
FILTER (?value < ?maxVoltage)
}
In SHACL this did not work, for debugging purposes then I just pulled out the first subquery to see if at least this works and tried this in SHACL -> it does not deliver any result -> no violation.
Here the shapeClass:
schumann:PowerSupplyInterfaceShape
sh:targetClass schumann:PowerSupplyInterface ;
sh:property [
sh:path schumann:hasProperty ;
sh:class schumann:SupplyVoltage ;
sh:minCount 1 ;
sh:maxCount 1 ;
sh:message "Exactly one supply-voltage specification must be provided." ;
] ;
sh:property [
sh:path schumann:connectedTo ;
sh:class schumann:PowerSinkInterface ;
sh:message "Power supply interfaces can only be connected to power sink interfaces" ;
];
sh:sparql [
a sh:SPARQLConstraint ;
sh:message "The power consumption exceeds the maximum voltage of the power supply." ;
sh:prefixes schumann: ;
sh:select """
SELECT $this ?maxVoltage
WHERE {
$this schumann:hasProperty/schumann:hasMaximumValue ?maxVoltage .
}
"""
]
.
So, the propertyPath clearly exists (successfully validated in vanilla SPARQL as well). In my understanding $this should be bound to instances of schumann:PowerSupplyInterface. Therefore, I do not understand what is wrong here ... or is this a bug? I have tried to debug it but as the constraint does not fail -> no report and the global logging as described on the website was not showing the variable configurations.
The full data graph is as follows:
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix uo: <http://purl.obolibrary.org/obo/> .
@prefix schumann: <http://www.semanticweb.org/theod/ontologies/2023/7/schumann-ontology#> .
# Base Classes
schumann:Supplier a rdfs:Class ;
rdfs:label "Supplier" .
schumann:Property a rdfs:Class ;
rdfs:label "Property" .
schumann:Protocol a rdfs:Class ;
rdfs:label "Protocol" .
schumann:Component a rdfs:Class ;
rdfs:label "Component" .
schumann:Domain a rdfs:Class ;
rdfs:label "Domain" .
schumann:Interface a rdfs:Class ;
rdfs:label "Interface" .
# Interfaces
schumann:NetworkInterface a rdfs:class ;
rdfs:subClassOf schumann:Interface ;
rdfs:label "NetworkInterface" ;
schumann:implementsProtocol schumann:PhysicalLayer ;
.
schumann:PowerSupplyInterface a rdfs:class ;
rdfs:subClassOf schumann:Interface ;
rdfs:label "PowerSupplyInterface" ;
.
schumann:PowerSinkInterface a rdfs:Class ;
rdfs:subClassOf schumann:Interface ;
rdfs:label "PowerSinkInterface " ;
.
# Protocols
schumann:NetworkLayer a rdfs:Class;
rdfs:subClassOf schumann:Protocol ;
rdfs:label "NetworkLayer" .
schumann:PhysicalLayer a rdfs:Class ;
rdfs:subClassOf schumann:Protocol ;
rdfs:label "Physical Layer" .
schumann:SecuritySubLayer a rdfs:Class ;
rdfs:subClassOf schumann:Protocol ;
rdfs:label "SecuritySubLayer" .
schumann:SyncChannelLayer a rdfs:Class ;
rdfs:subClassOf schumann:Protocol ;
rdfs:label "SyncChannelLayer" .
schumann:TransportLayer a rdfs:Class ;
rdfs:subClassOf schumann:Protocol ;
rdfs:label "TransportLayer" .
schumann:ApplicationLayer a rdfs:Class ;
rdfs:subClassOf schumann:Protocol ;
rdfs:label "ApplicationLayer" .
schumann:DataLinkLayer a rdfs:Class ;
rdfs:subClassOf schumann:Protocol ;
rdfs:label "DataLinkLayer" .
schumann:SpacePacketProtocol a schumann:NetworkLayer ;
rdfs:label "SpacePacketProtocol" .
# Domains
schumann:Digital a schumann:Domain .
schumann:Physical a schumann:Domain .
# Schumann Property Subclasses - dont get confused by the name 'Property', this is not a rdf:Property hierarchy!
schumann:RPMAccuracy a rdfs:Class ;
rdfs:label "RPMAccuracy" ;
rdfs:subClassOf schumann:Property.
schumann:RadiationTolerance a rdfs:Class ;
rdfs:label "RadiationTolerance" ;
rdfs:subClassOf schumann:Property.
schumann:SNR a rdfs:Class ;
rdfs:label "SNR" ;
rdfs:subClassOf schumann:Property.
schumann:SecuritySubLayer a rdfs:Class ;
rdfs:label "SecuritySubLayer" ;
rdfs:subClassOf schumann:Property.
schumann:SingleStarAccuracy a rdfs:Class ;
rdfs:label "SingleStarAccuracy" ;
rdfs:subClassOf schumann:Property.
schumann:SlewRate a rdfs:Class ;
rdfs:label "SlewRate" ;
rdfs:subClassOf schumann:Property.
schumann:SpatialDimensions a rdfs:Class ;
rdfs:label "SpatialDimensions" ;
rdfs:subClassOf schumann:Property.
schumann:SupplyVoltage a rdfs:Class ;
rdfs:label "SupplyVoltage" ;
rdfs:subClassOf schumann:Property.
schumann:TimeToFirstAcquisition a rdfs:Class ;
rdfs:label "TimeToFirstAcquisition" ;
rdfs:subClassOf schumann:Property.
schumann:AcquisitionProbability a rdfs:Class ;
rdfs:label "AcquisitionProbability" ;
rdfs:subClassOf schumann:Property.
schumann:AcquisitionTime a rdfs:Class ;
rdfs:label "AcquisitionTime" ;
rdfs:subClassOf schumann:Property.
schumann:AttitudeDeterminationAccuracy a rdfs:Class ;
rdfs:label "AttitudeDeterminationAccuracy" ;
rdfs:subClassOf schumann:Property.
schumann:AttitudeKnowledgeError a rdfs:Class ;
rdfs:label "AttitudeKnowledgeError" ;
rdfs:subClassOf schumann:Property.
schumann:Torque a rdfs:Class ;
rdfs:label "Torque" ;
rdfs:subClassOf schumann:Property.
schumann:UpdateRate a rdfs:Class ;
rdfs:label "UpdateRate" ;
rdfs:subClassOf schumann:Property.
schumann:SpatialDimensions a rdfs:Class ;
rdfs:label "SpatialDimensions" ;
rdfs:subClassOf schumann:Property.
schumann:Weight a rdfs:Class ;
rdfs:label "Weight" ;
rdfs:subClassOf schumann:Property.
schumann:Width a rdfs:Class ;
rdfs:label "Width" ;
rdfs:subClassOf schumann:SpatialDimensions .
schumann:Diameter a rdfs:Class ;
rdfs:label "Diameter" ;
rdfs:subClassOf schumann:SpatialDimensions .
schumann:Height a rdfs:Class ;
rdfs:label "Height" ;
rdfs:subClassOf schumann:SpatialDimensions .
schumann:Length a rdfs:Class ;
rdfs:label "Length" ;
rdfs:subClassOf schumann:SpatialDimensions .
schumann:KineticMoment a rdfs:Class ;
rdfs:label "KineticMoment" ;
rdfs:subClassOf schumann:Property.
schumann:LensAperture a rdfs:Class ;
rdfs:label "LensAperture" ;
rdfs:subClassOf schumann:Property.
schumann:LensFocalLength a rdfs:Class ;
rdfs:label "LensFocalLength" ;
rdfs:subClassOf schumann:Property.
schumann:Lifetime a rdfs:Class ;
rdfs:label "Lifetime" ;
rdfs:subClassOf schumann:Property.
schumann:LimitingMagnitude a rdfs:Class ;
rdfs:label "LimitingMagnitude" ;
rdfs:subClassOf schumann:Property.
schumann:Mass a rdfs:Class ;
rdfs:label "Mass" ;
rdfs:subClassOf schumann:Property;
rdfs:subClassOf schumann:Weight .
schumann:MechVibration a rdfs:Class ;
rdfs:label "MechVibration" ;
rdfs:subClassOf schumann:Property.
schumann:Lifetime a rdfs:Class ;
rdfs:label "Lifetime" ;
rdfs:subClassOf schumann:Property.
#
schumann:OperatingTemperature a rdfs:Class ;
rdfs:label "OperatingTemperature" ;
rdfs:subClassOf schumann:Property.
schumann:Availability a rdfs:Class ;
rdfs:label "Availability" ;
rdfs:subClassOf schumann:Property.
# Relations
schumann:hasInterface a rdf:Property .
schumann:hasProperty a rdf:Property .
schumann:connectedTo a rdf:Property .
schumann:hasProtocol a rdf:Property .
schumann:hasApplicationLayer a rdf:Property ;
rdfs:subPropertyOf schumann:hasProtocol .
schumann:hasDataLayer a rdf:Property ;
rdfs:subPropertyOf schumann:hasProtocol .
schumann:hasNetworkLayer a rdf:Property ;
rdfs:subPropertyOf schumann:hasProtocol .
schumann:hasPhysicalLayer a rdf:Property ;
rdfs:subPropertyOf schumann:hasProtocol .
schumann:hasSecuritySubLayer a rdf:Property ;
rdfs:subPropertyOf schumann:hasProtocol .
schumann:hasSyncChnlLayer a rdf:Property ;
rdfs:subPropertyOf schumann:hasProtocol .
schumann:hasTransportLayer a rdf:Property ;
rdfs:subPropertyOf schumann:hasProtocol .
schumann:hasSupplier a rdf:Property .
schumann:hasUnit a rdf:Property .
schumann:hasFixedValue a rdf:Property .
schumann:hasMaximumValue a rdf:Property .
schumann:hasMinimumValue a rdf:Property .
schumann:hasNDA a rdf:Property .
# schumann:hasTextValue a rdf:Property .
# schumann:hasValue a rdf:Property .
schumann:implementsProtocol a rdf:Property .
schumann:isInterfaceOf a rdf:Property .
schumann:isPropertyOf a rdf:Property .
schumann:is_unit_of a rdf:Property .
schumann:existsInDomain a rdf:Property .
########################
### Suppliers ###
########################
schumann:AAC_Clyde a schumann:Supplier .
schumann:COMAT a schumann:Supplier .
schumann:MarylandAerospace a schumann:Supplier .
schumann:SinclairInterplanetary a schumann:Supplier .
schumann:Jena-Optronik_GmbH a schumann:Supplier ;
schumann:hasSupplier schumann:COMAT ;
schumann:comment "Jena-Optronik GmbH" .
#############################
### PowerInterfaces ###
#############################
schumann:GenericPowerSupplyInterface a rdfs:Class ;
rdfs:subClassOf schumann:PowerSupplyInterface ;
.
schumann:GenericPowerSinkInterface a rdfs:Class ;
rdfs:subClassOf schumann:PowerSinkInterface ;
.
#########################
### NetworkInterfaces ###
#########################
schumann:RS422 a schumann:NetworkInterface ;
.
schumann:RS485 a schumann:NetworkInterface ;
.
########################
### Protocol Layers ###
########################
schumann:I2C a schumann:DataLinkLayer .
schumann:Proximity_1_Phy a schumann:PhysicalLayer .
schumann:RFandModulationSystems a schumann:PhysicalLayer .
schumann:ImageDataCompression a schumann:ApplicationLayer .
schumann:Proximity_1_DLL a schumann:DataLinkLayer ;
schumann:comment "Proximity-1 Data Link Layer" .
schumann:Proximity_1_CSL a schumann:SyncChannelLayer ;
schumann:comment "Proximity-1 Coding and Sync Layer" .
schumann:NSP a schumann:TransportLayer ;
schumann:comment "Universal Messaging Socket Protocol (nsp)" .
schumann:AppSpecProtocol a schumann:ApplicationLayer ;
schumann:comment "Application Specific Protocol - Not defined within CCSDS" .
schumann:CFDP a schumann:ApplicationLayer ;
a schumann:TransportLayer .
########################
### Tier2 Components ###
########################
schumann:ASTRO15w25degBaffle a schumann:Component ;
schumann:hasInterface schumann:RS422 ;
schumann:hasSupplier schumann:Jena-Optronik_GmbH .
schumann:ASTRO15w30degBaffle a schumann:Component;
schumann:hasInterface schumann:RS422 ;
schumann:hasSupplier schumann:Jena-Optronik_GmbH .
schumann:ASTROAPS a schumann:Component ;
schumann:hasSupplier schumann:Jena-Optronik_GmbH .
schumann:BladderTank a schumann:Component ;
rdfs:comment "RTa Bladder Tank" .
schumann:COPV a schumann:Component ;
rdfs:comment "Composite Overwrap Pressure Vessel (COPV)" .
schumann:Comp1 a schumann:Component ;
schumann:existsInDomain schumann:Physical ;
schumann:hasApplicationLayer schumann:AppSpecProtocol ;
schumann:hasTransportLayer schumann:CFDP ;
schumann:hasSyncChnlLayer schumann:Proximity_1_CSL ;
schumann:hasDataLayer schumann:Proximity_1_DLL ;
schumann:hasPhysicalLayer schumann:Proximity_1_Phy ;
schumann:hasSecuritySubLayer schumann:SCPS_SP ;
schumann:hasNetworkLayer schumann:SpacePacketProtocol ;
schumann:hasProperty schumann:Comp1_Mass .
schumann:Comp2 a schumann:Component ;
schumann:hasTransportLayer schumann:CFDP ;
schumann:hasApplicationLayer schumann:ImageDataCompression ;
schumann:hasSecuritySubLayer schumann:IPSec ;
schumann:hasSyncChnlLayer schumann:Proximity_1_CSL ;
schumann:hasDataLayer schumann:Proximity_1_DLL ;
schumann:hasPhysicalLayer schumann:Proximity_1_Phy ;
schumann:hasNetworkLayer schumann:SpacePacketProtocol ;
schumann:hasProperty schumann:Comp2_Mass .
schumann:CryogenicTank a schumann:Component ;
rdfs:comment "RTa Cryogenic Tank" .
schumann:FlowSensor a schumann:Component ;
rdfs:comment "RTa Flow Sensor" .
schumann:RW40 a schumann:Component ;
schumann:hasInterface schumann:RS422 ;
schumann:hasProperty schumann:RW40_8yrsLifetime ;
schumann:hasProperty schumann:RW40_SupplyVoltage14V ;
schumann:hasProperty schumann:RW40_Torque4mNm ;
schumann:hasSupplier schumann:COMAT ;
schumann:hasTransportLayer schumann:NSP ;
.
schumann:ST200 a schumann:Component ;
schumann:hasDataLayer schumann:I2C ;
schumann:hasInterface schumann:RS422 ;
schumann:hasInterface schumann:RS485 ;
schumann:hasProperty schumann:ST200_5Hz ;
schumann:hasProperty schumann:ST200_9krad ;
schumann:hasSupplier schumann:AAC_Clyde ;
.
schumann:ST-16RT2longBaffle a schumann:Component ;
schumann:hasSupplier schumann:SinclairInterplanetary .
schumann:ST-16RT2shortBaffle a schumann:Component ;
schumann:hasSupplier schumann:SinclairInterplanetary .
schumann:ST-16RT2woBaffle a schumann:Component ;
schumann:hasSupplier schumann:SinclairInterplanetary .
schumann:ST400wBaffle a schumann:Component ;
schumann:hasSupplier schumann:SinclairInterplanetary .
schumann:ST400woBaffle a schumann:Component ;
schumann:hasSupplier schumann:SinclairInterplanetary .
schumann:UART a schumann:Component ;
.
schumann:Valve a schumann:Component ;
rdfs:comment "RTa Valve Sensor" .
schumann:GRP a schumann:Component ;
rdfs:comment "Glass Fiber Reinforced Plastic" .
schumann:HotDock a schumann:Component ;
.
schumann:LevelSensor a schumann:Component ;
rdfs:comment "RTa Level Sensor" .
schumann:MAI-SS a schumann:Component ;
schumann:hasSupplier schumann:MarylandAerospace .
schumann:MAI-SSwithHousing a schumann:Component ;
schumann:hasSupplier schumann:MarylandAerospace .
schumann:MetalicHighPressureTank a schumann:Component .
schumann:PresSensor a schumann:Component ;
rdfs:comment "RTa Pressure Sensor" .
schumann:TempSensor a schumann:Component ;
rdfs:comment "RTa Temperature Sensor" .
schumann:Pump a schumann:Component ;
rdfs:comment "RTa Valve Sensor" .
schumann:GenericBattery a rdfs:Class ;
rdfs:subClassOf schumann:Component ;
rdfs:subClassOf schumann:GenericPowerSupplyInterface ;
rdfs:Comment "An unspecified generic battery" .
########################
### Property Classes ###
########################
schumann:ST200_5Hz a schumann:UpdateRate ;
schumann:hasUnit uo:UO_0000106 ;
schumann:hasFixedValue "5"^^xsd:decimal .
schumann:ST200_9krad a schumann:RadiationTolerance ;
schumann:hasUnit uo:UO_0000135 ;
schumann:hasFixedValue "9000"^^xsd:decimal .
schumann:RW40_Torque4mNm a schumann:Torque ;
schumann:hasUnit uo:UO_0000254 ;
schumann:hasFixedValue "4"^^xsd:decimal .
schumann:RW40_SupplyVoltage14V a schumann:SupplyVoltage ;
schumann:hasUnit uo:UO_0000218 ;
schumann:hasFixedValue "14"^^xsd:decimal .
schumann:Comp1_Mass a schumann:Mass ;
schumann:hasFixedValue "2"^^xsd:decimal ;
schumann:hasUnit uo:UO_0000021 .
schumann:Comp2_Mass a schumann:Mass ;
schumann:hasFixedValue "5"^^xsd:decimal ;
schumann:hasUnit uo:UO_0000021 ;
schumann:isPropertyOf schumann:Comp2 .
schumann:ASTRO15w30degBaffle_Mass a schumann:Mass ;
schumann:hasUnit uo:UO_0000021 ;
schumann:hasFixedValue "4.3"^^xsd:decimal ;
schumann:isPropertyOf schumann:ASTRO15w30degBaffle .
schumann:RW40_Mass a schumann:Mass ;
schumann:hasUnit uo:UO_0000021 ;
schumann:hasFixedValue "230"^^xsd:decimal ;
schumann:isPropertyOf schumann:RW40 .
schumann:ST200_Mass a schumann:Mass ;
schumann:hasUnit uo:UO_0000021 ;
schumann:hasFixedValue "42"^^xsd:decimal ;
schumann:isPropertyOf schumann:ST200 .
schumann:Accuracy2RPM a schumann:RPMAccuracy ;
schumann:hasFixedValue "2"^^xsd:decimal .
schumann:Astro15w25_AttitudeAcc a schumann:AttitudeDeterminationAccuracy ;
schumann:hasUnit uo:UO_0000185 ;
schumann:isPropertyOf schumann:ASTRO15w25degBaffle ;
schumann:hasFixedValue "0.000277778"^^xsd:decimal .
schumann:Astro15w25_AttitudeReacqTime a schumann:AcquisitionTime ;
schumann:hasUnit uo:UO_0000010 ;
schumann:isPropertyOf schumann:ASTRO15w25degBaffle ;
schumann:hasFixedValue "5"^^xsd:decimal .
schumann:Astro15w25_FocalLen a schumann:LensFocalLength ;
schumann:hasUnit uo:UO_0000016 ;
schumann:isPropertyOf schumann:ASTRO15w25degBaffle ;
schumann:hasFixedValue "55"^^xsd:decimal .
schumann:Astro15w25_Mass a schumann:Mass ;
schumann:hasUnit uo:UO_0000021 ;
schumann:isPropertyOf schumann:ASTRO15w25degBaffle ;
schumann:hasFixedValue "6000"^^xsd:decimal .
schumann:Astro15w25_SingleStarAcc a schumann:SingleStarAccuracy ;
schumann:hasUnit uo:UO_0000185 ;
schumann:isPropertyOf schumann:ASTRO15w25degBaffle ;
schumann:hasFixedValue "0.00138889"^^xsd:decimal .
schumann:Astro15w25_SlewRate a schumann:SlewRate ;
schumann:hasUnit uo:UO_0000010 ; # TODO <- two units?
schumann:hasUnit uo:UO_0000185 ;
schumann:hasFixedValue "0.3"^^xsd:decimal .
schumann:Astro15w25_SupplyVoltage a schumann:SupplyVoltage ;
schumann:hasUnit uo:UO_0000218 ;
schumann:isPropertyOf schumann:ASTRO15w30degBaffle ;
schumann:hasMaximumValue "52"^^xsd:decimal ;
schumann:hasMinimumValue "30"^^xsd:decimal .
schumann:Astro15w30degBaffle_SlewRate a schumann:SlewRate ;
schumann:hasUnit uo:UO_0000010 ;
schumann:hasUnit uo:UO_0000185 ;
schumann:isPropertyOf schumann:ASTRO15w30degBaffle ;
schumann:hasFixedValue "0.3"^^xsd:decimal .
schumann:AttitudeAccuracy_Astro15w30 a schumann:AttitudeDeterminationAccuracy ;
schumann:hasUnit uo:UO_0000185 ;
schumann:isPropertyOf schumann:ASTRO15w30degBaffle ;
schumann:hasFixedValue "0.000277778"^^xsd:decimal .
schumann:AttitudeReaqcTime5sec_Astro15w30 a schumann:AcquisitionTime ;
schumann:hasUnit uo:UO_0000010 ;
schumann:isPropertyOf schumann:ASTRO15w30degBaffle ;
schumann:hasFixedValue "5"^^xsd:decimal .
schumann:BaffleLen496 a schumann:Length ;
schumann:hasUnit uo:UO_0000016 ;
schumann:isPropertyOf schumann:ASTRO15w30degBaffle ;
schumann:hasFixedValue "496"^^xsd:decimal .
schumann:Diameter30deg_Astro15w30 a schumann:Diameter ;
schumann:hasUnit uo:UO_0000098 ;
schumann:isPropertyOf schumann:ASTRO15w30degBaffle ;
schumann:hasFixedValue "192"^^xsd:decimal .
schumann:RW40_8yrsLifetime a schumann:Lifetime .
schumann:GenericPowerSupplyVoltage a schumann:SupplyVoltage ;
schumann:hasUnit uo:UO_0000218 ;
schumann:hasMaximumValue "1000"^^xsd:decimal ;
.
schumann:GenericPowerSinkVoltage1V a schumann:SupplyVoltage ;
schumann:hasUnit uo:UO_0000218 ;
schumann:hasFixedValue "1"^^xsd:decimal ;
.
### FSM Graph Definitions
schumann:Comp3 a rdfs:Class ;
rdfs:subClassOf schumann:Component ;
rdfs:subClassOf schumann:GenericPowerSinkInterface ;
schumann:hasSupplier schumann:Jena-Optronik_GmbH .
################### Instances (A-Box) #########################
GRAPH schumann:FSM_1
{
# Battery
schumann:FSM_1_Battery a schumann:GenericBattery ;
schumann:hasProperty schumann:GenericPowerSupplyVoltage ;
.
# Component 2 + dedicated pwr sink interface
schumann:Comp2_FZI_PwrSinkIF a schumann:GenericPowerSinkInterface ;
schumann:hasProperty schumann:GenericPowerSinkVoltage1V ;
.
schumann:Comp2_FZI a schumann:Comp2 ;
schumann:hasInterface schumann:Comp2_FZI_PwrSinkIF ;
.
# schumann:Comp3_PwrSinkInterface_1 a schumann:GenericPowerSinkInterface .
schumann:Comp3_FZI_1 a schumann:Comp3 ;
schumann:hasProperty schumann:GenericPowerSinkVoltage1V ;
.
schumann:SpecialVoltage a schumann:SupplyVoltage ;
schumann:hasUnit uo:UO_0000218 ;
schumann:hasFixedValue "999999"^^xsd:decimal ;
.
schumann:Comp3_FZI_2 a schumann:Comp3 ;
schumann:hasProperty schumann:SpecialVoltage ;
.
# Connect battery to components
schumann:FSM_1_Battery
schumann:connectedTo schumann:Comp2_FZI_PwrSinkIF ; # dedicated SinkInterfaces instances are also possible, a Component without implicitly inherited sinkInterface can be related to them via hasInterface-property
schumann:connectedTo schumann:Comp3_FZI_1 ;
schumann:connectedTo schumann:Comp3_FZI_2 ;
.
}
Shapes (reduced):
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix uo: <http://purl.obolibrary.org/obo/> .
@prefix schumann: <http://www.semanticweb.org/theod/ontologies/2023/7/schumann-ontology#> .
schumann: a owl:Ontology ;
sh:declare [
a sh:PrefixDeclaration ;
sh:namespace "hhttp://www.semanticweb.org/theod/ontologies/2023/7/schumann-ontology#"^^xsd:anyURI ;
sh:prefix "schumann" ;
] .
schumann:PowerSupplyInterfaceShape
sh:targetClass schumann:PowerSupplyInterface ;
sh:property [
sh:path schumann:hasProperty ;
sh:class schumann:SupplyVoltage ;
sh:minCount 1 ;
sh:maxCount 1 ;
sh:message "Exactly one supply-voltage specification must be provided." ;
] ;
sh:property [
sh:path schumann:connectedTo ;
sh:class schumann:PowerSinkInterface ;
sh:message "Power supply interfaces can only be connected to power sink interfaces" ;
];
sh:sparql [
a sh:SPARQLConstraint ;
sh:message "The power consumption exceeds the maximum voltage of the power supply." ;
sh:prefixes schumann: ;
sh:select """
SELECT $this ?maxVoltage
WHERE {
$this schumann:hasProperty/schumann:hasMaximumValue ?maxVoltage .
}
"""
]
.
Some code snippet to verify that there is an output for maxVoltage:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi @ all
(sorry that it is me again :) )
I'm slightly confused whether my SPARQLConstraint (see below) is wrong or if there is a bug in RDF4J because the constraint does not fail.... but when the same query executed as a regular SPARQL query against the repository/connection API, it delivers valid results. In my understanding (correct me if this is wrong) results should result in violations.
In my app, you can assemble satellites and here I want to check if the maximum Voltage delivered by a PowerSupply-Component is sufficient to cover the demand (as a sum) of all connected Components which are subClasses of PowerSupplySink. PowerSupply and PowerSink instances both have exactly one :hasProperty/hasMaximumValue (for suppliers) and :hasProperty/hasFixedValue (for Sink) each, respectively.
The generic SPARQL-query that actually works looks like this:
In SHACL this did not work, for debugging purposes then I just pulled out the first subquery to see if at least this works and tried this in SHACL -> it does not deliver any result -> no violation.
Here the shapeClass:
So, the propertyPath clearly exists (successfully validated in vanilla SPARQL as well). In my understanding $this should be bound to instances of schumann:PowerSupplyInterface. Therefore, I do not understand what is wrong here ... or is this a bug? I have tried to debug it but as the constraint does not fail -> no report and the global logging as described on the website was not showing the variable configurations.
The full data graph is as follows:
Shapes (reduced):
Some code snippet to verify that there is an output for maxVoltage:
Beta Was this translation helpful? Give feedback.
All reactions