3

Maven リポジトリの Jena (TDB 0.10.1、CORE/ARQ 2.10.1) を使用しています。このファイルをインポートしました:

tdbloader --graph=http://linkedgeodata.org --loc=$bsdStore $lgdData"supermarkets.ttl"

私は今、このモデルを次のようにクエリしようとしています:

PREFIX lgd: <http://linkedgeodata.org/ontology/> 
PREFIX wgs: <http://www.w3.org/2003/01/geo/wgs84_pos#>  
PREFIX geo: <http://geovocab.org/geometry#>  
PREFIX gis:     <http://www.opengis.net/ont/geosparql#>  
PREFIX rdfs:    <http://www.w3.org/2000/01/rdf-schema#>  

SELECT DISTINCT ?supermarket ?label ?latitude ?longitude ?points  
FROM <http://linkedgeodata.org>  
WHERE {  
    ?supermarket a lgd:Supermarket .  
    ?supermarket ?p ?o .  
    OPTIONAL { 
      ?supermarket rdfs:label ?label .  
      ?supermarket geo:geometry ?geo .  
      ?geo gis:asWKT ?points .  
      ?supermarket wgs:lat ?latitude .  
      ?supermarket wgs:long ?longitude .  
    }
} 

残念ながら、これは空の結果セットを返します。wgs​​ パターンを別の OPTIONAL に移動すると、正しい結果が得られます。

SELECT DISTINCT ?supermarket ?label ?latitude ?longitude ?points  
FROM <http://linkedgeodata.org>  
WHERE {  
    ?supermarket a lgd:Supermarket .  
    ?supermarket ?p ?o .  
    OPTIONAL { 
         ?supermarket rdfs:label ?label .  
         ?supermarket geo:geometry ?geo .  
         ?geo gis:asWKT ?points .  
    }
    OPTIONAL {
         ?supermarket wgs:lat ?latitude .  
         ?supermarket wgs:long ?longitude .  
    }
}     

これは Jena のバグですか、それともクエリが間違っていますか? 乾杯、ダニエル

4

1 に答える 1