Hi,
There is more machinery around the algebra for running visitor patterns
over algebra expressions than there is for syntax (ElementVisitor).
RecursiveElementVisitor applies an ElementVisitor over an abstract
syntax tree.
There isn't anything I know of to do the analysis of the pattern. The
nearest is the BGP reorder code [*] would reorder those two triple
patterns but its doing a different job and is only working on basic
graph patterns.
Andy
[*] ReorderFixed, ReorderTransformationSubstitution
On 07/10/2019 02:13, Bart van Leeuwen wrote:
Hi,
I'm looking for some examples to analyze a sparql query e.g.
select * where { ?s a ?t . ?s <http://example.com#b> ?x }
I would like to be able to infer that ?t is rdf:class
and that ?x is related to ?s by ex#b
I've looked at Query.getQueryPattern() and the walker but couldn't find
a nice example of how to do this.
Met Vriendelijke Groet / With Kind Regards
Bart van Leeuwen
twitter: @semanticfire
tel. +31(0)6-53182997
Netage B.V.
http://netage.nl <http://netage.nl/>
Esdoornstraat 3
3461ER Linschoten
The Netherlands