1

I'm making that SPARQL query:

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?label WHERE { 
<http://pt.dbpedia.org/resource/Brasil> rdfs:label ?label.}

and I don't get any results for ?text . I checked that URI on my browser and found the rdfs:label property there. Is that problem caused by the URI form http://pt.dbpedia.org/? I've already used the same query with IRIs starting with http://dbpedia.org/resource/, e.g., http://dbpedia.org/resource/Google and those work. I'm using Jena, and can provide code showing how I'm dereferencing the IRI.

Joshua Taylor
  • 84,998
  • 9
  • 154
  • 353
Luciane
  • 259
  • 4
  • 23

1 Answers1

4

If I run your query against the Portuguese DBpedia SPARQL endpoint (http://pt.dbpedia.org/sparql), I get the results you'd want ("Brasil"):

SELECT ?label WHERE { 
  <http://pt.dbpedia.org/resource/Brasil> rdfs:label ?label.
}

SPARQL results (one)

Running the same query against the main (English) DBpedia SPARQL endpoint (http://dbpedia.org/sparql), though, I get no results.

SELECT ?label WHERE { 
  <http://pt.dbpedia.org/resource/Brasil> rdfs:label ?label.
}

SPARQL results (none)

It looks like you need to be sure to query against the right endpoint. On the main SPARQL endpoint, though, you can ask about things that are owl:sameAs the Brasil resource in Portuguese DBpedia. E.g.,

SELECT ?label WHERE { 
  ?brasil owl:sameAs <http://pt.dbpedia.org/resource/Brasil> ;
          rdfs:label ?label .
}

SPARQL results (lots)

That gives you lots of results, though, since you're getting the names in lots of different languages. You could ask for labels just in Portuguese, though (and you probably want to add distinct here) and you can get "Brasil" and "Brazil":

SELECT distinct ?label WHERE { 
  ?brasil owl:sameAs <http://pt.dbpedia.org/resource/Brasil> ;
          rdfs:label ?label .
  filter( langMatches(lang(?label),"pt") )
}

SPARQL results (two)

Joshua Taylor
  • 84,998
  • 9
  • 154
  • 353
  • Hi! I tested the last query you gave me but still get no results. In fact, when I test it at http://pt.dbpedia.org/sparql, I don't get results. I posted another question showing how I'm doing that with Jena. Here's the link: http://stackoverflow.com/questions/20407333/writing-sparql-queries-with-jena-to-query-for-uris-like-http-pt-dbpedia-org – Luciane Dec 05 '13 at 18:01
  • @Luciane You ran the first query against the Portuguese DBpedia, and the rest against the main English DBpedia, right? I'm still getting the expected results… – Joshua Taylor Dec 05 '13 at 20:49