Error in SPARQL Query

放肆的年华 提交于 2019-12-13 20:51:46

问题


I'm getting an error with my SPARQL query but can't find it out:

Query

PREFIX owl: <http://www.w3.org/2002/07/owl#> 
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> 
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> 
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 
PREFIX dbpedia-owl: <http://dbpedia.org/ontology/> 
PREFIX : <http://dbpedia.org/resource/> 
PREFIX dbpedia2: <http://dbpedia.org/property/> 
PREFIX dbpedia: <http://dbpedia.org/> 
SELECT DISTINCT ?lat, ?long { 
:Taj_Mahal dbpedia2:latitude ?lat . 
:Taj_Mahal dbpedia2:longitude ?long }

Error

Encountered " "," ", "" at line 9, column 21.
Was expecting one of:
     ...
     ...
    "from" ...
    "where" ...
    "(" ...
    "{" ...

Any suggestion??


回答1:


you should not put a comma between ?lat and ?long

SELECT DISTINCT ?lat ?long { 
    :Taj_Mahal dbpedia2:latitude ?lat . 
    :Taj_Mahal dbpedia2:longitude ?long 
}

run query



来源:https://stackoverflow.com/questions/15680198/error-in-sparql-query

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!