Hello,
I’ve started exploring Stardog’s geospatial features and came across this SPARQL syntax that I did not recognize:
prefix : <http://community.stardog.com/examples/>
prefix wgs: <http://www.w3.org/2003/01/geo/wgs84_pos#>
prefix geof: <http://www.opengis.net/def/function/geosparql/>
prefix geo: <http://www.opengis.net/ont/geosparql#>
prefix qudt: <http://qudt.org/vocab/unit#>
select ?feature ?name {
?feature geof:nearby ( [rdfs:label "White House"] 2 qudt:MileUSStatute) ;
rdfs:label ?name .
}
The part that was new to me was the function argument inside the square brackets: [rdfs:label "White House"]
. After playing around, I learned that it seemed to behave like some kind of subquery and that I could simply replace this with an named individual instead, e.g. <tag:foo:bar>
. As a programmer used to strongly typed function arguments, this blew my mind. Is my understanding correct?
I’m just looking for a better understanding of the square bracket syntax. As usual thanks for your insights!
-Peter