Hi, All, Thanks for all suggestions, comments and warm help. Especially thanks to Andy ... Eventually, we're able to figure it out:-)
Cheers, Frank Here is the SPARQL query and the query results for other engineers who may be also interested in: ./s-query --service http://ipaddr:3030/dataset/query'PREFIX cim: <http://iec.ch/TC57/2010/CIM-schema-cim15#> select ?name ?value WHERE {GRAPH <http://yyy.com/graphs/bbb/12.0/20120914152504_cp>{?id a cim:SynchronousMachine; cim:IdentifiedObject.name ?name. ?anId a cim:Analog; cim:Measurement.PowerSystemResource ?id. ?anValId a cim:AnalogValue; cim:AnalogValue.Analog ?anId; cim:AnalogValue.value ?value. } } ' { "head": { "vars": [ "name" , "value" ] } , "results": { "bindings": [ { "name": { "type": "literal" , "value": "Muskngum SM" } , "value": { "type": "literal" , "value": "-392" } } , { "name": { "type": "literal" , "value": "Muskngum SM" } , "value": { "type": "literal" , "value": "-0" } } , { "name": { "type": "literal" , "value": "W.Kammer SM" } , "value": { "type": "literal" , "value": "-160" } } , { "name": { "type": "literal" , "value": "W.Kammer SM" } , "value": { "type": "literal" , "value": "-0" } } , { "name": { "type": "literal" , "value": "ClinchRv SM" } , "value": { "type": "literal" , "value": "-0" } } , { "name": { "type": "literal" , "value": "ClinchRv SM" } , "value": { "type": "literal" , "value": "-607" } } , { "name": { "type": "literal" , "value": "Glen Lyn SM" } , "value": { "type": "literal" , "value": "-0" } } , { "name": { "type": "literal" , "value": "Glen Lyn SM" } , "value": { "type": "literal" , "value": "-252" } } , { "name": { "type": "literal" , "value": "DeerCrk SM" } , "value": { "type": "literal" , "value": "-0" } } , { "name": { "type": "literal" , "value": "DeerCrk SM" } , "value": { "type": "literal" , "value": "-7" } } , { "name": { "type": "literal" , "value": "TwinBrch SM" } , "value": { "type": "literal" , "value": "-0" } } , { "name": { "type": "literal" , "value": "TwinBrch SM" } , "value": { "type": "literal" , "value": "-85" } } , { "name": { "type": "literal" , "value": "Breed SM" } , "value": { "type": "literal" , "value": "-450" } } , { "name": { "type": "literal" , "value": "Breed SM" } , "value": { "type": "literal" , "value": "-0" } } , { "name": { "type": "literal" , "value": "Muskngum SM" } , "value": { "type": "literal" , "value": "-391" } } , { "name": { "type": "literal" , "value": "Muskngum SM" } , "value": { "type": "literal" , "value": "-0" } } , { "name": { "type": "literal" , "value": "TannrsCk SM" } , "value": { "type": "literal" , "value": "-314" } } , { "name": { "type": "literal" , "value": "TannrsCk SM" } , "value": { "type": "literal" , "value": "-0" } } , { "name": { "type": "literal" , "value": "TannrsCk SM" } , "value": { "type": "literal" , "value": "-220" } } , { "name": { "type": "literal" , "value": "TannrsCk SM" } , "value": { "type": "literal" , "value": "-0" } } , { "name": { "type": "literal" , "value": "Claytor SM" } , "value": { "type": "literal" , "value": "-40" } } , { "name": { "type": "literal" , "value": "Claytor SM" } , "value": { "type": "literal" , "value": "-0" } } , { "name": { "type": "literal" , "value": "Torrey SM" } , "value": { "type": "literal" , "value": "-0" } } , { "name": { "type": "literal" , "value": "Torrey SM" } , "value": { "type": "literal" , "value": "-48" } } , { "name": { "type": "literal" , "value": "CabinCrk SM" } , "value": { "type": "literal" , "value": "-0" } } , { "name": { "type": "literal" , "value": "CabinCrk SM" } , "value": { "type": "literal" , "value": "-477" } } , { "name": { "type": "literal" , "value": "DanRiver SM" } , "value": { "type": "literal" , "value": "-36" } } , { "name": { "type": "literal" , "value": "DanRiver SM" } , "value": { "type": "literal" , "value": "-0" } } , { "name": { "type": "literal" , "value": "W.Lancst SM" } , "value": { "type": "literal" , "value": "-19" } } , { "name": { "type": "literal" , "value": "W.Lancst SM" } , "value": { "type": "literal" , "value": "-0" } } , { "name": { "type": "literal" , "value": "Sporn SM" } , "value": { "type": "literal" , "value": "-0" } } , { "name": { "type": "literal" , "value": "Sporn SM" } , "value": { "type": "literal" , "value": "-516.4000244140625" } } , { "name": { "type": "literal" , "value": "Pinevlle SM" } , "value": { "type": "literal" , "value": "-4" } } , { "name": { "type": "literal" , "value": "Pinevlle SM" } , "value": { "type": "literal" , "value": "-0" } } , { "name": { "type": "literal" , "value": "Tidd SM" } , "value": { "type": "literal" , "value": "-155" } } , { "name": { "type": "literal" , "value": "Tidd SM" } , "value": { "type": "literal" , "value": "-0" } } , { "name": { "type": "literal" , "value": "Philo SM" } , "value": { "type": "literal" , "value": "-204" } } , { "name": { "type": "literal" , "value": "Philo SM" } , "value": { "type": "literal" , "value": "-0" } } ] } } ________________________________ From: Andy Seaborne <[email protected]> To: Frank Lee <[email protected]> Sent: Tuesday, November 20, 2012 9:54 AM Subject: Re: SPARQL query for the values referenced by a specified ID I have explained how to investigate your query. The next step for you is apply my previous suggestions. Replying "yes" or "no" is not satisfactory - use the queries to discover what your data actually looks like. I also suggested that you do not use RDF/XML but convert it to Turtle. I do not answer questions off-list. Andy On 20/11/12 00:14, Frank Lee wrote: > Hi, Andy, > > We can simply ignore the domain --- for we also not quite familiar with > this domain right now :-). But we can focus on the SPARQL query itself. > This kind of query for you guys (Jena experts) must be very simple. > Again, thanks for your warm help. > > Cheers, > Frank > > ++++ > > ------------------------------------------------------------------------ > *From:* Andy Seaborne <[email protected]> > *To:* [email protected] > *Sent:* Friday, November 16, 2012 1:22 AM > *Subject:* Re: SPARQL query for the values referenced by a specified ID > > The shape of the query depends on the data and I known nothing about the > domain. > > On 15/11/12 18:50, Frank Lee wrote: > > Thanks a lot, Andy. > > > > Since you are the expert, normally, what kind of SPARQL query you'd > have? Let's forget about all these existing ones and come up with a > workable query string. Thanks. > > Just simply query all the values (cim:AnalogValue.value) referenced > by the chain of cim:Analog, cim:Measurement.PowerSystemResource and > cim:SynchronousMachine. > > That is meaningless - some are properties, some are classes. > > Output the data as Turtle and study the data. > > Andy > > > > > Cheers, > > Frank > > > > Here is the reduced original data from RDF file > > > > <?xml version="1.0" encoding="UTF-8" ?> > > <rdf:RDF xmlns:cim="http://iec.ch/TC57/2010/CIM-schema-cim15#" > xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> > > <cim:Terminal rdf:ID="_58D23877E70F49AB1273427E482636E3"> > > <cim:IdentifiedObject.name>T1</cim:IdentifiedObject.name> > > <cim:Terminal.ConductingEquipment > rdf:resource="#_41C523013BF3CA80A10769F38E88FD42"/> > > <cim:Terminal.ConnectivityNode > rdf:resource="#_89B1FAA85658B6A92AE0465B57EBD879"/> > > <cim:Terminal.sequenceNumber>1</cim:Terminal.sequenceNumber> > > </cim:Terminal> > > > > >
