I thought that maybe this would work, but it didn't, and I'm curious
why. (Nat King Cole still shows up, and
http://dbpedia.org/page/Nat_King_Cole shows that there is a triple
saying that he's a dbpedia-owl:Person.)
SELECT distinct ?x
WHERE {
?x rdfs:label ?lbl .
filter(bif:contains(?lbl, "Cole")).
?x a ?xClass .
FILTER (?xClass != dbpedia-owl:Person) .
}
(By the way, there's no point in SELECTing ?o if nothing in the query is
going to bind it.)
Bob
On 11/22/2010 9:24 AM, Rocco Tripodi wrote:
> Hello,
> someone could help me with this query?
>
> SELECT distinct ?x ?o
> WHERE {
> ?x rdfs:label ?lbl .
> filter(bif:contains(?lbl, "Cole")).
> filter (!bif:exists ((select (1) where { ?x a dbpedia-owl:Person } )))
> }
>
> I would like to retrieve all the entities that in their labels contain
> "Cole" and are not Person. I don't know why In many cases it matches
> dbpedia-owl:Person
>
> http://dbpedia.org/snorql/?query=+SELECT+distinct+%3Fx+%3Fo%0D%0A+WHERE+{%0D%0A+%3Fx+rdfs%3Alabel+%3Flbl+.%0D%0A+filter%28bif%3Acontains%28%3Flbl%2C+%22Cole%22%29%29.%0D%0A+filter+%28!bif%3Aexists+%28%28select+%281%29+where+{+%3Fx+a+dbpedia-owl%3APerson+}+%29%29%29%0D%0A+}
>
> <http://dbpedia.org/snorql/?query=+SELECT+distinct+%3Fx+%3Fo%0D%0A+WHERE+%7B%0D%0A+%3Fx+rdfs%3Alabel+%3Flbl+.%0D%0A+filter%28bif%3Acontains%28%3Flbl%2C+%22Cole%22%29%29.%0D%0A+filter+%28%21bif%3Aexists+%28%28select+%281%29+where+%7B+%3Fx+a+dbpedia-owl%3APerson+%7D+%29%29%29%0D%0A+%7D>
>
> thanks, Rocco.
>
------------------------------------------------------------------------------
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