How can I retrieve all the properties of http://dbpedia.org/resource/Milano? I tried with this query but I have a few results and I don't understand the reason:
select ?prop ?c
where {<http://dbpedia.org/resource/Milano> ?prop ?c.}
How can I retrieve all the properties of http://dbpedia.org/resource/Milano? I tried with this query but I have a few results and I don't understand the reason:
select ?prop ?c
where {<http://dbpedia.org/resource/Milano> ?prop ?c.}
The question isn't entirely clear, but expect that the problem you're asking about is why you're getting triples about
dbpedia:Milano
, but notdbpedia:Milan
. This query, as you can see in the results, only returns ten rows:SPARQL results
One of those rows, however, is
So, the simple answer is "query for Milan" with a query like this:
SPARQL results
A more sophisticated answer would return the triples for
dbpedia:Milano
and any triples of anything that it redirects to (and, I suppose, anything that any of those redirect to, and so on, though I think that Wikipedia limits redirects to be one level deep). You can do this with a property path query in SPARQL:SPARQL results
In that query
?subject
will be anything related by a path of length zero or more (so, given the data that we've seen,?subject
will be bound to at leastdbpedia:Milano
anddbpedia:Milan
. If you want to preserve information about the subject of the various triples that you're using, you might want to add?subject
to theselect
line, so as to haveselect ?subject ?prop ?c
.If you don't care about the particular value of
?subject
, then you actually don't need to bind?subject
at all, and could use a blank node in the query:SPARQL results
Caveat
Unfortunately, although this last query is legal SPARQL, Virtuoso says it's an error. Fortunately, this last refinement is entirely optional; it's not vital to the solution. If you were querying against a different endpoint, you'd be able to use it. The error that Virtuoso gives is:
I contacted the Virtuoso mailing list and they confirmed that it's a Virtuoso bug, and that they'll fix it. I don't know how long it will take for the fix to get to the DBpedia endpoint, though.