Hi Andy, This code is in Java and we are working on Dot Net and using Sparql to work with Jena using DotNetRDF library.
I can see DotNetRDF is having support for Lucene but not for ElasticSearch. I have tried with multiple documents but not getting how we can modify SPARQL query to use ES advanced features like match phrases. Can you please help me with an example of how a match phrase can be implemented with a SPARQL query without java code? is it possible? Regards, Deepali On Wed, Jan 13, 2021 at 3:17 PM Lorenz Buehmann < buehm...@informatik.uni-leipzig.de> wrote: > that's not gonna work ... > > text:query:match_phrase > > is an invalid SPARQL predicate. You can try to put the "match_phrase" > into the query string, but I don't think it will work. A "query string > query" is used via the ES Java API [1] > > Syntax can be found online [2] > > [1] > > https://github.com/apache/jena/blob/master/jena-text-es/src/main/java/org/apache/jena/query/text/es/TextIndexES.java#L409 > [2] > > https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html > > > On 13.01.21 06:58, Deepali Singhavi wrote: > > Hi Andy, > > > > I have gone through the elastic search documentation and I know there is > an > > option of *match_phrase *but I want to know how it will work with SPARQL > > query. > > > > For example I have tried the below query but it is not working so I want > to > > understand the syntax. > > > > prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> > > prefix star: <http://stardog.com/tutorial/> > > PREFIX text: <http://jena.apache.org/text#> > > select ?subject ?object > > from <urn:music> > > WHERE { > > ?subject *text:query:match_phrase* (star:description "\"rock band > Queen\"") > > . > > ?subject star:description ?object . > > } > > > > Regards, > > Deepali > > > > On Tue, Jan 12, 2021 at 7:52 PM Andy Seaborne <a...@apache.org> wrote: > > > >> Check the documentation for Lucene and ElasticSearch. jena-text passes > >> the text query straight through. > >> > >> On 12/01/2021 13:32, Deepali Singhavi wrote: > >>> Hi, > >>> > >>> I am trying to match exact phrases using SPARQL but for Lucene it is > >>> working but not for Elastic search. Do I need to make any changes to > >>> make it work for ES.I have attached my sample ttl file and below is the > >>> query > >>> > >>> Query: > >>> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns# > >>> <http://www.w3.org/1999/02/22-rdf-syntax-ns#>> > >>> prefix star: <http://stardog.com/tutorial/ > >>> <http://stardog.com/tutorial/>> > >>> PREFIX text: <http://jena.apache.org/text# < > http://jena.apache.org/text# > >>> select ?subject ?object > >>> from <urn:music> > >>> WHERE { > >>> ?subject text:query (star:description "\"rock band Queen\"") . > >>> ?subject star:description ?object . > >>> } > >>> > >>> Please let me know if any other information is required from my side. > >>> > >>> Regards, > >>> Deepali > >>> >