Reputation: 115
I have found this query, but i'm not able what does it do. I don't know what the "^a" means, particularly.
select distinct ?type where {
dbpedia:Stephen_King a ?type .
filter not exists {
?subtype ^a dbpedia:Stephen_King ;
rdfs:subClassOf ?type .
filter ( ?subtype != ?type )
}
}
Upvotes: 1
Views: 3043
Reputation: 8465
It's a SPARQL 1.1 property path which describes a route through a graph between two graph nodes, in your case it denotes the inverse path, i.e. from object to subject, thus, it's equivalent to
dbpedia:Stephen_King a ?subtype .
with a
being just a shortcut for rdf:type
It's just used here to be able to use the more compact Turtle syntax, i.e. instead of writing
dbpedia:Stephen_King a ?subtype .
?subtype rdfs:subClassOf ?type .
you can write
?subtype ^a dbpedia:Stephen_King
?subtype rdfs:subClassOf ?type .
and therefore since subjects are the same
?subtype ^a dbpedia:Stephen_King ;
rdfs:subClassOf ?type .
Upvotes: 6