Sparql not working propely using SERVICE

Hi @hwilliams ,
I have this issue SPARQL QUERY, in Virtuoso 07.20.3233 on Windows Single Server Edition ():

  1. Case OK:

         PREFIX dbo: <http://dbpedia.org/ontology/>
         PREFIX rdfs:   <http://www.w3.org/2000/01/rdf-schema#>
         SELECT ?City
         WHERE {
         SERVICE <https://dbpedia.org/sparql>
         {
            ?City a dbo:City ;
            rdfs:label ?Label ;
            dbo:postalCode ?PostalCode .
            Filter ( lang(?Label) = "en" )
          }  } LIMIT 10
    

  1. Case KO (insert of an empty line):

         PREFIX dbo: <http://dbpedia.org/ontology/>
         PREFIX rdfs:   <http://www.w3.org/2000/01/rdf-schema#>
         SELECT ?City
         
         WHERE {
         SERVICE <https://dbpedia.org/sparql>
         {
            ?City a dbo:City ;
            rdfs:label ?Label ;
            dbo:postalCode ?PostalCode .
            Filter ( lang(?Label) = "en" )
          }  } LIMIT 10
    

  1. Case KO (insert column named ?Label):

    PREFIX dbo: http://dbpedia.org/ontology/
    PREFIX rdfs: http://www.w3.org/2000/01/rdf-schema#
    SELECT ?City, ?Label
    WHERE {
    SERVICE https://dbpedia.org/sparql
    {
    ?City a dbo:City ;
    rdfs:label ?Label ;
    dbo:postalCode ?PostalCode .
    Filter ( lang(?Label) = β€œen” )
    } } LIMIT 10

In general, if I put spaces or change the query, will not work :expressionless:

All 3 queries work for me against the latest Virtuoso 7.2.11 (07.20.3238) build, and as you indicate using a older 07.20.3233 build I would recommend upgrading to the latest build …

1 Like