English 中文(简体)
SPARQL query language tag weirdness
原标题:

This works:

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

(Results on DBpedia SPARQL Explorer)

This doesn t:

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

(Results on DBpedia SPARQL Explorer)

Why?

最佳回答

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.

问题回答

暂无回答




相关问题
Defining cardinality for a RDF statement

Im having a problem with RDF. I have a couple of triples defined as : <User rdf:about="#T"> <hasName rdf:datatype="http://www.w3.org/2001/XMLSchema#string">T</hasName> <...

Duplicate triple in RDF, authoritative view?

if a triple store contains twice the same triple, what is (if any exist) the authoritative position about this redundancy ? Additionally, should a triplestore be allowed to store twice the same ...

Pick and RDF/SPARQL

Anyone have any interest in intergrating RDF and/or SPARQL with a PICK database? Has anyone tried this yet? I have some thoughts about what to try. One idea is to figure out how to create a file with ...

Using contexts in rdflib

I am having trouble finding a clear, sensible example of usage of context with rdflib. ConjunctiveGraph does not accept contexts, and Graph is deprecated. How am I supposed to create and operate on ...

What is the difference between RDF and OWL? [closed]

I am trying to grasp the concept of Semantic Web. I am finding it hard to understand what exactly is the difference between RDF and OWL. Is OWL an extension of RDF or these two are totally different ...

Problem with SPARQLWrapper (Python)

I m making a SPARQL query against the Sesame store in localhost, using SPARQLWrapper: sparql = SPARQLWrapper( http://localhost:8080/openrdf-sesame/repositories/rep/statements ) sparql.setQuery(...

热门标签