0

I wanted to get the "is dbo:wikiPageRedirects of" and use it as an alias to the label.

enter image description here

ex:

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 foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX dbo: <http://dbpedia.org/ontology/>
PREFIX : <http://dbpedia.org/resource/>
PREFIX dbpedia2: <http://dbpedia.org/property/>
PREFIX dbpedia: <http://dbpedia.org/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>


SELECT *
WHERE {
    FILTER (?uri = <http://dbpedia.org/resource/Benigno_Aquino_III>)

    OPTIONAL{
        ?uri rdfs:label ?label .
        FILTER( LANG(?label) = "" || LANGMATCHES(LANG(?label), "en") )
    } 
    OPTIONAL
    {
        ?uri dbo:birthDate ?birthDate .
    } 
    OPTIONAL
    {
        ?uri rdfs:label "Benigno Aquino III"@en ;
             dbo:wikiPageRedirects ?redirectsTo .
    }
} 

what I get is a blank wikiPageRedirects, But when i use http://dbpedia.org/resource/PNOY i get http://dbpedia.org/resource/Benigno_Aquino_III as redirectsTo. I want to do the opposite.

user3883507
  • 69
  • 1
  • 8

1 Answers1

2

The relation is "dbo:wikiPageRedirects of" and not "dbo:wikiPageRedirects". In this case, it means that http://dbpedia.org/resource/Benigno_Aquino_III lists the resources which have a connection of the sort

?u dbo:wikiPageRedirects http://dbpedia.org/resource/Benigno_Aquino_III

you should use

?redirectsTo dbo:wikiPageRedirects ?uri .
Jerome WAGNER
  • 21,986
  • 8
  • 62
  • 77
  • Thank you for the knowledge Jerome! :) now i understand how this thing works! now the problem is how to limit the result to one and then insert the **redirectsTo** to inside the result. Well thanks! – user3883507 Dec 15 '15 at 08:54