在两个RDF文件之间查询SPARQL

时间:2016-05-20 14:17:13

标签: java eclipse sparql jena

我有两个rdf文件,第一个是数据流,第二个是知识库。我希望通过这个查询将能够在两个文件之间进行连接,以便根据流文件的idSensore值来查找知识库中相同idSensore的信息(tipologia和valore)。

这是我的代码:

<rdf:Description rdf:about="http://www.dati.lombardia.it/resource/_647i-nhxk/18899588">
    <socrata:rowID>18899588</socrata:rowID>
    <rdfs:member rdf:resource="http://www.dati.lombardia.it/resource/_647i-nhxk"/>
    <ds:idsensore>2447</ds:idsensore>
    <ds:data>2016-05-01T09:10:00</ds:data>
    <ds:valore>6</ds:valore>
    <ds:stato>VA</ds:stato></rdf:Description>

这是流RDF文件:

<rdf:Description rdf:about="http://www.dati.lombardia.it/resource/nf78-nj6b/1">
    <socrata:rowID>1</socrata:rowID>
    <rdfs:member rdf:resource="http://www.dati.lombardia.it/resource/nf78-nj6b"/>
    <ds:idsensore>2001</ds:idsensore>
    <ds:tipologia>Temperatura</ds:tipologia>
    <ds:unit_dimisura>C</ds:unit_dimisura>
    <ds:idstazione>100</ds:idstazione>
    <ds:nomestazione>Milano - Lambrate</ds:nomestazione>
    <ds:quota>120</ds:quota>
    <ds:provincia>MI</ds:provincia>
    <ds:nomecomune>Milano</ds:nomecomune>
    <ds:indirizzo>parco Lambro - acquedotto</ds:indirizzo>
    <ds:cgb_nord>5038191</ds:cgb_nord>
    <ds:cgb_est>1520147</ds:cgb_est>
    <ds:lng>9.25751572</ds:lng>
    <ds:lat>45.49678183</ds:lat>
    <ds:location><geo:SpatialThing>
        <geo:lat>45.49678183</geo:lat>
        <geo:long>9.25751572</geo:long></geo:SpatialThing></ds:location></rdf:Description>

这是知识库RDF文件:

{
    "ConnectionStrings": {
      "DefaultConnectionString": "Default",
      "CustomConnectionString": "Custom"
    }
}

请帮我查询

0 个答案:

没有答案