Reputation: 6191
This is supposed to bring back a list of trees, and optional a thumbnail picture.
By 'trees' I mean the green, leafy plants:
PREFIX gold: <http://purl.org/linguistics/gold/>
PREFIX dbr: <http://dbpedia.org/resource/>
PREFIX dbo: <http://dbpedia.org/ontology/>
SELECT * {
?tree a dbo:Plant;
gold:hypernym dbr:Tree.
OPTIONAL { ?tree dbo:thumbnail ?thumbnail }
}
Click here to run that SPARQL above.
It mostly works: but it also brings back this type of Tree:
https://dbpedia.org/page/M-ary_tree
Oddly: the data isn't apparently labelled as being a 'dbo:Plant' though?
Is there something else going on here? (like it being 'sameAs' or something? I notice the result actually says 'http://dbpedia.org/resource/K-ary_tree', but this lands on 'M-aray').
Upvotes: 1
Views: 28
Reputation: 6191
Thanks to uninformeduser - who provided the explanation in the comments. I can confirm the explanation was correct.
The page does indeed redirect with a HTTP-301 :
> export URL=https://dbpedia.org/page/K-ary_tree
> curl -s -o /dev/null -I -w "%{http_code}" $URL
301>
> curl -s -o /dev/null -I -w "%{http_code} : %{url_effective}" $URL --location
200 : https://dbpedia.org/page/M-ary_tree>
And the provided SPARQL does show the entry is (incorrectly) classified as a plant:
# Returns 'true'
PREFIX dbr: <http://dbpedia.org/resource/>
PREFIX dbo: <http://dbpedia.org/ontology/>
ASK { dbr:K-ary_tree a dbo:Plant}
I'm still a little confused about this behaviour - since the redirect seems to be invisible at the RDF level to the end-user - the redirect just seems to happen. (Unless I'm missing some connection somewhere else).
So asking whether 'K-Array' is a plant yields yes, but the original 'M-Array' is false.
# Returns 'false'
PREFIX dbr: <http://dbpedia.org/resource/>
PREFIX dbo: <http://dbpedia.org/ontology/>
ASK { dbr:M-ary_tree a dbo:Plant }
Upvotes: 1