The attached file was too big ... Now send the reduced one. Hopefully it can still contain the contents you may need ..
----- Forwarded Message ----- From: Frank Lee <[email protected]> To: "[email protected]" <[email protected]> Sent: Tuesday, November 13, 2012 10:33 AM Subject: SPARQL query for the values referenced by a specified ID OK. Please see the attached RDF/XML file - AA_CIM15_BB.xml. Basically, I'd like to get the cim:AnalogValue.value (like -252) for cim:SynchronousMachine (it's referenced by cim:Measurement.PowerSystemResource). The SPARQL query for that I had: ./s-query --service http://172.20.19.171:3030/dataset/query 'PREFIX cim: <http://iec.ch/TC57/2010/CIM-schema-cim15#> select ?id ?name ?bVol ?aVal WHERE {GRAPH <http://cimproject.zzz.com/graphs/bbb/berkeley/12.0/20120914152504_cp>{?id a cim:SynchronousMachine; cim:IdentifiedObject.name ?name. OPTIONAL {?id cim:ConductingEquipment.BaseVoltage ?bvId. ?bvId cim:BaseVoltage.nominalVoltage ?bVol} OPTIONAL { ?id cim:Measurement.PowerSystemResource ?analogValue . ?analogValue cim:AnalogValue.value ?aVal . } } } ' it works for id, name and bVol, but not for aVal. All values for aVal is exactly what I want to query. Please give me some idea how to do it. Thanks a lot. Frank +++ ________________________________ From: Andy Seaborne <[email protected]> To: [email protected] Sent: Tuesday, November 13, 2012 3:51 AM Subject: Re: SPARQL query for the values related to specified ID Please start a new thread, don't piggy back on an unrelated one. Please provide a complete, readable minimal example. This is simply unreadable. The data is incomplete. The query and the results don't correlate. Looking at: > "vars": [ "id" , "name" , "bVol" , "aVal" ] but > select ?id ?name ?bvId ?res ?analog ?analogValue ?id2 ?aVal so the results do not correspond to the query. The second OPTIONAL in the query is not connected to anything by a variable as far as I can see. After that, I'm simply lost as to what the question is about. Andy On 13/11/12 01:37, Frank Lee wrote:> Hi, Andy, > > Can you please help me to get some ideas about how to query for the values > that are related to the the specified item (like cim:SynchronousMachine). > > As you can see, there is not returning for aVal (cim:AnalogValue.value --- I want to query these values related to cim:Measurement.PowerSystemResource). Actually, I do not know how to do this kind of SPARQL query. I just put 'somethings' (colored with light green) tried to query aVal (cim:AnalogValue.value). > > CAN YOU PLEASE tell me what will be the CORRECT SPARQL query get > cim:AnalogValue.value? Thanks a lot! > > Cheers, > Frank > > > See the followings for more details. > > > The result of this SPARQL query: > > { > "head": { > "vars": [ "id" , "name" , "bVol" , "aVal" ] > } , > "results": { > "bindings": [ > > { > "id": { "type": "uri" , "value": >"file:///C:/Users/yyy/work/bbb/core/resources/rdfs/IEEE118_CIM15_MEAS.xml#_048aea70-c766-11e1-8775-005056c00008" > } , > "name": { "type": "literal" , "value": "Sporn SM" } , > "bVol": { "type": "literal" , "value": "132" } > } , > { > "id": { "type": "uri" , "value": >"file:///C:/Users/yyy/work/bbb/core/resources/rdfs/IEEE118_CIM15_MEAS.xml#_047fc6e6-c766-11e1-8775-005056c00008" > } , > "name": { "type": "literal" , "value": "Pinevlle SM" } > } , > { > "id": { "type": "uri" , "value": >"file:///C:/Users/yyy/work/bbb/core/resources/rdfs/IEEE118_CIM15_MEAS.xml#_04839777-c766-11e1-8775-005056c00008" > } , > "name": { "type": "literal" , "value": "Tidd SM" } , > "bVol": { "type": "literal" , "value": "132" } > } , > { > "id": { "type": "uri" , "value": "file:///C:/Users/yyy/work/bbb/core/resources/rdfs/IEEE118_CIM15_MEAS.xml#_04859346-c766-11e1-8775-005056c00008" } , > "name": { "type": "literal" , "value": "Philo SM" } , > "bVol": { "type": "literal" , "value": "132" } > } > > As you can see, there is not returns for aVal. Actually, I do not know how to > do this kind of SPARQL query. I just put 'somethings' (colored with light > green) tried to query aVal (cim:AnalogValue.value). > > CAN YOU PLEASE tell me what will be the CORRECT SPARQL query for it? Thanks. > > Cheers, > Frank > > > ./s-query --service http://ipaddr:3030/dataset/query 'PREFIX cim: > <http://iec.ch/TC57/2010/CIM-schema-cim15#> select ?id ?name ?bvId ?res > ?analog ?analogValue ?id2 ?aVal WHERE {GRAPH > <http://xxx.com/graphs/yyy/berkeley/12.0/20120914152504>{ > ?id a cim:SynchronousMachine; cim:IdentifiedObject.name ?name. OPTIONAL {?id > cim:ConductingEquipment.BaseVoltage ?bvId. ?bvId > cim:BaseVoltage.nominalVoltage ?bVol} OPTIONAL {?id2 > cim:Measurement.PowerSystemResource ?res . ?res cim:Analog ?analog . ?analog > cim:AnalogValue.Analog ?analogValue . ?analogValue cim:AnalogValue.value > ?aVal . } } } ' > > > > <cim:AnalogValue rdf:ID="_8672158A46976A9BC32EAB365A190703"> > <cim:AnalogValue.value>-252</cim:AnalogValue.value> > <cim:AnalogValue.Analog rdf:resource="#_8C55B894578EA96D44DEC9A318898ABC"/> > </cim:AnalogValue> > > <cim:Analog rdf:ID="_8C55B894578EA96D44DEC9A318898ABC"> > <cim:IdentifiedObject.name>MW</cim:IdentifiedObject.name> > <cim:Measurement.unitMultiplier >rdf:resource="http://iec.ch/TC57/2010/CIM-schema-cim15#UnitMultiplier.M"/> > <cim:Measurement.unitSymbol >rdf:resource="http://iec.ch/TC57/2010/CIM-schema-cim15#UnitSymbol.W"/> > <cim:Measurement.PowerSystemResource >rdf:resource="#_044cd00a-c766-11e1-8775-005056c00008"/> > <cim:Measurement.Terminal >rdf:resource="#_045e5c30-c766-11e1-8775-005056c00008"/> > <cim:Measurement.measurementType>ThreePhaseActivePower</cim:Measurement.measurementType> > </cim:Analog> > > <cim:SynchronousMachine rdf:ID="_044cd00a-c766-11e1-8775-005056c00008"> > <cim:IdentifiedObject.name>Glen Lyn SM</cim:IdentifiedObject.name> > <cim:Equipment.EquipmentContainer rdf:resource="#_04765109-c766-11e1-8775-005056c00008"/> > <cim:ConductingEquipment.BaseVoltage >rdf:resource="#_0460a620-c766-11e1-8775-005056c00008"/> > <cim:RegulatingCondEq.RegulatingControl >rdf:resource="#_045beb36-c766-11e1-8775-005056c00008"/> > <cim:SynchronousMachine.minQ>-50</cim:SynchronousMachine.minQ> > <cim:SynchronousMachine.type >rdf:resource="http://iec.ch/TC57/2010/CIM-schema-cim15#SynchronousMachineType.generator"/> > <cim:SynchronousMachine.GeneratingUnit >rdf:resource="#_044f6819-c766-11e1-8775-005056c00008"/> > <cim:SynchronousMachine.operatingMode >rdf:resource="http://iec.ch/TC57/2010/CIM-schema-cim15#SynchronousMachineOperatingMode.generator"/> > <cim:SynchronousMachine.maxQ>155</cim:SynchronousMachine.maxQ> > </cim:SynchronousMachine> > > > +++
