Claude,

This sounds useful, are you referring to the actual Jena source code for 
your examples?

Met Vriendelijke Groet / With Kind Regards
Bart van Leeuwen


twitter: @semanticfire
tel. +31(0)6-53182997
Netage B.V.
http://netage.nl
Esdoornstraat 3
3461ER Linschoten
The Netherlands




From:   Claude Warren <cla...@xenei.com>
To:     users@jena.apache.org
Date:   07-10-2019 12:47
Subject:        Re: Analyzing SPARQL Queries



Bart,

Not sure exactly what you are trying to do or actually looking for but,
assuming you have a parsed query and you want to detect the
<?s RDF.type ?t> pattern so you can state that ?t is a class you could use
the ElementVisitor pattern.  See the query builder WhereHandler.build()
method as well as the BuildElementVisitor class for examples of how to
traverse the where statements.  You will probably want to override the
`public void visit(ElementTriplesBlock el)` and `public void
visit(ElementPathBlock el)` methods.

You should also be able to do the second inference as well.

Claude


On Mon, Oct 7, 2019 at 11:01 AM Bart van Leeuwen 
<bart_van_leeu...@netage.nl>
wrote:

> Adrian,
>
> I'm looking for code examples specifically Jena, don't see any 
references
> here.
>
> Met Vriendelijke Groet / With Kind Regards
> Bart van Leeuwen
>
>
> twitter: @semanticfire
> tel. +31(0)6-53182997
> Netage B.V.
> http://netage.nl
> Esdoornstraat 3
> 3461ER Linschoten
> The Netherlands
>
>
>
>
> From:        Adrian Walker <adriandwal...@gmail.com>
> To:        users@jena.apache.org
> Date:        07-10-2019 05:48
> Subject:        Re: Analyzing SPARQL Queries
> ------------------------------
>
>
>
> Bart,
> This might be useful --
> www.executable-english.com/demo_agents/RDFQueryLangComparison1.agent
>
>                                            Cheers,  -- Adrian
>
> Adrian Walker
> Executable English LLC
> San Jose, CA, USA
> (USA) 860 830 2085 (California time)
> www.executable-english.com
>
> On Sun, Oct 6, 2019 at 6:13 PM Bart van Leeuwen <
> bart_van_leeu...@netage.nl>
> 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
> > Esdoornstraat 3
> > 3461ER Linschoten
> > The Netherlands
> >
>
>
>

-- 
I like: Like Like - The likeliest place on the web
<http://like-like.xenei.com>
LinkedIn: http://www.linkedin.com/in/claudewarren


Reply via email to