What does "^a" mean in this SPARQL query?
Asked Answered
U

1

1

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 )
  }
}
Unstopped answered 7/5, 2017 at 1:47 Comment(0)
P
6

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 .
Photothermic answered 7/5, 2017 at 4:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.