简体   繁体   中英

sparql with brackets in subject

I am trying to query dbpedia using sparql and running into a problem with brackets in the subject name. This query runs but returns nothing. If I try it on a similar Person without brackets it works.

PREFIX dbpedia-owl: <http://dbpedia.org/ontology/>

SELECT * WHERE
{
<http://dbpedia.org/resource/Yves_Saint_Laurent_(designer)> dbpedia-owl:abstract ?abstract ;
dbpedia-owl:thumbnail ?thumbnail .filter(langMatches(lang(?abstract),"en"))
}

I have tried various characters to escape the brackets but nothing seems to works. Is there another way to get the data out?

I think that your problem is related to the fact that 'Yves Saint Laurent' doesn't have the property thumbnail.

Take a look at : Yves Saint Laurent on dbpedia

This query works :

PREFIX dbpedia-owl: <http://dbpedia.org/ontology/>

SELECT * WHERE
{
<http://dbpedia.org/resource/Yves_Saint_Laurent_(designer)>
dbpedia-owl:abstract ?abstract
filter(langMatches(lang(?abstract),"en"))
}

I tested it on : http://dbpedia.org/sparql

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM