Search code examples
rdfsparqldbpedia

Error in SPARQL Query


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??


Solution

  • 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