Hi Guys again :)

I have a second related question here. I have some resources here that  
I want to query that have no redirection. So the query mentioned in my  
last mail returns "NULL"

So I wonder now what the best way to proceed is. is it somehow  
possible to tell a the query below to follow the redirection IF and  
only IF a redirection exists, and otherwise return the comment  
directly (with no redirect).

Another way would be to send the normal query. Then if the result is  
NULL this could mean tehre is a redirection. tehn send the second  
Query that can follow the redirection. But I'd like to avoid that.

If someone could make an example Query that would be really appreciated.

best
martin

Zitat von Martin Kammerlander <[email protected]>:

> Solved,
>
> mhausenblas in irc channel #swig solved my issue.
>
> For Example: If you only want the german comment back and also want to
> consider a possible redirection you can use redirect like that:
>
> SELECT ?o
> WHERE {
>    <http://dbpedia.org/resource/Secure_Digital_card> ?porigin ?oorigin ;
>    dbpedia2:redirect ?redirectTarget .
>    ?redirectTarget rdfs:comment ?o .
>    FILTER ( LANG ( ?o ) = "de" )
> }
>
> see you
> martin
>
>
> Zitat von Martin Kammerlander <[email protected]>:
>
>> Hi Guys,
>>
>> Sometimes it is possible that you query for a resource in dbpedia, but
>> this resource now has "changed" and therefore it would be a redirect
>> to new resource name.
>>
>> This works when you give the link directly ie in the browser:
>>
>> http://dbpedia.org/resource/Secure_Digital_card
>>
>> will be redirected to
>>
>> http://dbpedia.org/resource/Secure_Digital
>>
>> How can I create a SPARQL query that also does follow the redirected
>> resource? Is that possible and can someone please give me a simple
>> example on this simple query, since I didn't find anything about that.
>> As far as I understood one could use "dbprop:redirect" but I'm just
>> not sure how to apply it on this simple query:
>>
>> SELECT ?p ?o
>> WHERE {
>> <http://dbpedia.org/resource/Secure_Digital_card> ?p ?o
>> }
>>
>> thx in advance
>> martin
>>
>>
>> ------------------------------------------------------------------------------
>> Beautiful is writing same markup. Internet Explorer 9 supports
>> standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
>> Spend less time writing and  rewriting code and more time creating great
>> experiences on the web. Be a part of the beta today
>> http://p.sf.net/sfu/msIE9-sfdev2dev
>> _______________________________________________
>> Dbpedia-discussion mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion
>>
>
>
>
>
> ------------------------------------------------------------------------------
> Beautiful is writing same markup. Internet Explorer 9 supports
> standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
> Spend less time writing and  rewriting code and more time creating great
> experiences on the web. Be a part of the beta today
> http://p.sf.net/sfu/msIE9-sfdev2dev
> _______________________________________________
> Dbpedia-discussion mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion
>




------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Dbpedia-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion

Reply via email to