Search code examples
sparqlrdfjenaarqblank-nodes

ARQ query for blank node


I am working on RDF query language. So, I have installed Apache Jena.
RDF data is given below:

@prefix foaf: <http://xlmns.com/foaf/0.1/> .

_:a foaf:name  "Alice" .
_:b foaf:name  "Ashish" .

And ARQ query is:

PREFIX foaf:  <http://xmlns.com/foaf/0.1/>

SELECT ?x ?name
WHERE { ?x foaf:name ?name }

Problem — my result is:

+---+------+
| x | name |
+---+------+
+---+------+

The correct result is:

+-----+---------+
|  x  |  name   |
+-----+---------+
| _:c | "Alice" |
| _:d | "Bob"   |
+-----+---------+

Solution

  • The prefix in your data is wrong. The query correctly uses xmlns, but the data has a typo, xlmns (the "l" and "m" are swapped).