views:

89

answers:

2
SELECT * WHERE{
?x rdfs:label "Chalti Ka Naam Gaadi"@en .
?x foaf:name ?z .    
}

This works

SELECT * WHERE{
?x foaf:name "Chalti Ka Naam Gaadi" .
?x rdfs:label ?z .    
}

This doesnt

Why?

Can try running it here http://dbpedia.org/snorql/ Tried adding the query link directly but doesnt work, possibly due to some markup or escaping issue.

A: 

This is no answer, just a short investigation ...

This works (and is very slow):

SELECT * WHERE{
    ?x foaf:name ?name FILTER regex(?name, "^Chalti", "i") .
}

# =>

x                       name
:Chalti_Ka_Naam_Gaadi   "Chalti Ka Naam Gaadi"

This works, too:

SELECT * WHERE{
    ?x foaf:name ?name FILTER regex(?name, "Chalti Ka Naam Gaadi", "i") .
}

This also:

SELECT * WHERE{
    ?x foaf:name ?name FILTER regex(?name, "Chalti Ka Naam Gaadi") .
}

This works:

SELECT * WHERE{
    ?x dbpedia2:name "Chalti Ka Naam Gaadi"@en .
}

Since foaf:name is labelled testing in the docs, maybe one shouldn't rely on it at this time.

The MYYN
Interesting. Thanks for looking at it. Looks like a bug somewhere. Where do I find whats in testing? Which doc? Still figuring my way around...
Klerk
The link to the docs was: http://xmlns.com/foaf/spec/#term_name, good luck!
The MYYN
Was just about to post the link...thanks again. Learnt something new today. Thanks!
Klerk
+1  A: 

Your issue is that plain literals with language tags: "Chalti Ka Naam Gaadi"@en

are not the same as plain literals without language tags: "Chalti Ka Naam Gaadi"

Literals are structured things made of a lexical part, language (maybe), or datatype (maybe).

You could filter: FILTER ( str( ?name ) = "Chalti Ka Naam Gaadi")

(str() returns the lexical part of the literal)

but, depending on the query engine, that will be much slower.