GRIDAPPSD / gridappsd-training

BSD 2-Clause "Simplified" License
2 stars 1 forks source link

Document using PV id instead of inverter pecid #7

Open AAndersn opened 2 years ago

AAndersn commented 2 years ago

Platform currently uses mrid of photovoltaic or battery units instead of inverter PowerElectronicsConnection mrid

Need custom SPARQL query to get photovoltaic unit mrid and then use that mrid for difference messages

AAndersn commented 2 years ago

Battery query:

# Storage - DistStorage
PREFIX r:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX c:  <http://iec.ch/TC57/CIM100#>
SELECT ?name ?bus ?id ?fdrid ?pecid ?t1id (group_concat(distinct ?phs;separator="\n") as ?phases) WHERE {
 ?s r:type c:BatteryUnit.
 ?s c:IdentifiedObject.name ?name.
 ?pec c:PowerElectronicsConnection.PowerElectronicsUnit ?s.
# feeder selection options - if all commented out, query matches all feeders
#VALUES ?fdrid {"_5B816B93-7A5F-B64C-8460-47C17D6E4B0F"}  # 13 bus assets
 ?pec c:Equipment.EquipmentContainer ?fdr.
 ?fdr c:IdentifiedObject.mRID ?fdrid.

 ?pec c:IdentifiedObject.mRID ?pecid.

 OPTIONAL {?pecp c:PowerElectronicsConnectionPhase.PowerElectronicsConnection ?pec.
 ?pecp c:PowerElectronicsConnectionPhase.phase ?phsraw.
   bind(strafter(str(?phsraw),"SinglePhaseKind.") as ?phs) }
 bind(strafter(str(?s),"#_") as ?id).
 ?t c:Terminal.ConductingEquipment ?pec.
 ?t c:Terminal.ConnectivityNode ?cn. 
 ?t c:IdentifiedObject.mRID ?t1id.
 ?cn c:IdentifiedObject.name ?bus
}
GROUP by ?name ?bus ?id ?fdrid ?pecid ?t1id
ORDER by ?name

PV Query:

PREFIX r: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX c: <http://iec.ch/TC57/CIM100#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?name ?bus ?ratedS ?ratedU ?ipu ?p ?q ?fdrid ?id ?pecid (group_concat(distinct ?phs;separator="\n") as ?phases) WHERE {
VALUES ?feeder_mrid {"_49AD8E07-3BF9-A4E2-CB8F-C3722F837B62"}
?s r:type c:PhotovoltaicUnit.
?s c:IdentifiedObject.name ?name.
?s c:IdentifiedObject.mRID ?id.
?pec c:PowerElectronicsConnection.PowerElectronicsUnit ?s.
?pec c:IdentifiedObject.mRID ?pecid.
?pec c:Equipment.EquipmentContainer ?fdr.
?fdr c:IdentifiedObject.mRID ?feeder_mrid.
?pec c:PowerElectronicsConnection.ratedS ?ratedS.
?pec c:PowerElectronicsConnection.ratedU ?ratedU.
?pec c:PowerElectronicsConnection.maxIFault ?ipu.
?pec c:PowerElectronicsConnection.p ?p.
?pec c:PowerElectronicsConnection.q ?q.
OPTIONAL {?pecp c:PowerElectronicsConnectionPhase.PowerElectronicsConnection ?pec.
?pecp c:PowerElectronicsConnectionPhase.phase ?phsraw.
bind(strafter(str(?phsraw),"SinglePhaseKind.") as ?phs) }
?t c:Terminal.ConductingEquipment ?pec.
?t c:Terminal.ConnectivityNode ?cn.
?cn c:IdentifiedObject.name ?bus
}
GROUP by ?name ?bus ?ratedS ?ratedU ?ipu ?p ?q ?fdrid ?id ?pecid
ORDER by ?name
poorva1209 commented 1 year ago

@AAndersn Does this need to be in the backlog or closed?