That is in no way a normal SPARQL query. I don't know where in particular you 
got it, but it is an example of Blazegraph/BigData's "GAS" API. It's not an 
example of idiomatic SPARQL at all.

https://wiki.blazegraph.com/wiki/index.php/RDF_GAS_API

That is a specialist extension API for one product's particular capability.

You can refer to any number of good tutorials for how to write normal SPARQL. 
Jena itself maintains one:

https://jena.apache.org/tutorials/sparql.html


---
A. Soroka
The University of Virginia Library

> On Mar 5, 2017, at 11:37 AM, Laura Morales <[email protected]> wrote:
> 
>> Could you be more specific about these intuitions and difficulties?
> 
> with other query languages such as gremlin you start from a vertex (or set of 
> vertices), and follow links (predicates). This is very intuitive, because it 
> resemble the picture of a graph that I have in mind. For example, I can start 
> from the vertex "Bruce Springsteen" and follow its out-links 
> "some_namespace:song". Very easy to understand and work with. SPARQL, at 
> least to me, seems to be way more intricate, messy, verbose, and ultimately 
> difficult to understand. Just look at this query (copied from wikidata 
> examples) for a query as simple as "Children of Genghis Khan".... I barely 
> understand how to read it to be honest
> 
> #Children of Genghis Khan
> #added before 2016-10
> #defaultView:Graph
> 
> PREFIX gas: <http://www.bigdata.com/rdf/gas#>
> 
> SELECT ?item ?itemLabel ?pic ?linkTo
> WHERE
> {
>  SERVICE gas:service {
>    gas:program gas:gasClass "com.bigdata.rdf.graph.analytics.SSSP" ;
>                gas:in wd:Q720 ;
>                gas:traversalDirection "Forward" ;
>                gas:out ?item ;
>                gas:out1 ?depth ;
>                gas:maxIterations 4 ;
>                gas:linkType wdt:P40 .
>  }
>  OPTIONAL { ?item wdt:P40 ?linkTo }
>  OPTIONAL { ?item wdt:P18 ?pic }
>  SERVICE wikibase:label {bd:serviceParam wikibase:language "en" }
> }

Reply via email to