check this Query

this should relate to you barack obama or the first related elements , i've
used it in keyword search and it's tested as well

query =
               "select distinct ?subject ?literal ?redirects ?disamb
 where{" +
               "?subject <http://www.w3.org/2000/01/rdf-schema#label>
?literal." +
               "optional { ?subject <
http://dbpedia.org/ontology/wikiPageRedirects> ?redirects}." +
               "optional {?subject <
http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?type}." +
               "optional { ?subject   <
http://dbpedia.org/ontology/wikiPageDisambiguates>  ?disamb}" +
               "Filter ( !(?type=<
http://www.w3.org/2004/02/skos/core#Concept>)&& !(?type= <
http://www.w3.org/1999/02/22-rdf-syntax-ns#Property>)) ." +
                "?literal bif:contains '" + bifcontains + "'.}" + "limit" +
"100";

IN your code check if that  the entity doesn't contain a ?redirects   or
 ?disamb   if it does  so your entity will be the ?redirects  one or the
?disamb , this is a good practice to avoid redirections or disambiguity
entities




On Wed, Aug 15, 2012 at 11:54 AM, Saeedeh Shekarpour <
[email protected]> wrote:

> Hi
>
> Try this query:
>
> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
>  SELECT distinct * WHERE { ?iri rdfs:label ?label.   ?label  bif:contains
>  "barak"
>  FILTER( langMatches(lang(?label), "en")). }
>
>
> On Sun, Aug 12, 2012 at 8:12 AM, Somesh Jain <[email protected]>wrote:
>
>>
>>
>> Hi folks ,
>>
>> My problem is simply this ... when I am querying with 'Barack', I am not
>> getting the summary of 'Barack_Obama' dbpedia page. I know what is the
>> procedure of getting page redirect names from a base url name .
>>
>> But , is the other way round possible ? Can I get 'Barack_Obama' by
>> sending a query with 'Barack' ? Please help me with such SPARQL query
>>
>> --
>> Regards
>> Somesh Jain
>> 4th year Undergraduate Student
>> Department of Computer Science & Engineering
>> IIT Kharagpur
>>
>>
>> ------------------------------------------------------------------------------
>> Live Security Virtual Conference
>> Exclusive live event will cover all the ways today's security and
>> threat landscape has changed and how IT managers can respond. Discussions
>> will include endpoint security, mobile security and the latest in malware
>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>> _______________________________________________
>> Dbpedia-discussion mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion
>>
>>
>
>
> --
>
> Best Regards
>
>
> ---------
>
> Saeedeh Shekarpour
>
> Phd student
>
> Department of Computer Science, University of Leipzig
>
> Research Group: http://aksw.org
>
>
>
> هر آنکسی که دراین حلقه نیست زنده به عشق
> بر او نمرده به فتوی من نماز کنید
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Dbpedia-discussion mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion
>
>


-- 
-------------------------------------------------
Hady El-Sahar
Solution Developer at LinkDevelopment

email : [email protected]
Phone : +20-01220887311
Blog :     hadyelsahar.me

<http://www.linkedin.com/in/hadyelsahar>
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Dbpedia-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion

Reply via email to