Re: Extending ARQ to retrieve FILTER operations from Sparql Queries

2018-04-24 Thread anuj kumar
Thanks Rob for the pointers. I will start digging now.

On Tue, Apr 24, 2018 at 5:57 PM, Rob Vesse  wrote:

> Looking at the code for how TDB does this might be useful:
>
> https://github.com/apache/jena/blob/master/jena-tdb/src/
> main/java/org/apache/jena/tdb/solver/OpExecutorTDB1.java
>
> Rob
>
> On 24/04/2018, 16:54, "Rob Vesse"  wrote:
>
> The point is to not modify the parsing but the execution
>
> By substituting a different OpExecutor implementation you can provide
> a custom executeOp() implementation that recognizes when an OpFilter
> operator is seen and acts accordingly
>
> Rob
>
> On 24/04/2018, 16:34, "anuj kumar"  wrote:
>
> I have another query, this time relating to ARQ and how I can
> extend it.
> *Background*
>
> I am using HBase as the underlying Data Store for Triples (by
> implementing
> various Jena Extension points).
> So far so good.
> But now I have certain SPARQL queries that have FILTER operations
> defined.
> With a huge data set, that I have, its taking a lot of time to
> FILTER the
> data out.
>
> So, I want to extract the FILTER portion of the Query out and
> simply want
> to pass it as a HBase Filter to the HBase client so that filtering
> can
> happen at RegionServer level itself.
>
> This question is very similar to the question here
>  jena-arq-filter-optimization?rq=1>
> on
> stackoverflow.
>
> I have been reading about ARQ and OpExecutor and believe that it
> may be
> what I need but I cant seem to find a simple example on which I
> can build
> up.
>
> Can someone help me with getting to understand how I can parse the
> incoming
> query to REMOVE the FILTER clause from it and instead take the
> filter
> statement and evaluate it.
>
> Thanks,
> --
> *Anuj Kumar*
>
>
>
>
>
>
>
>
>
>
>


-- 
*Anuj Kumar*


[GitHub] jena pull request #407: Cleanup

2018-04-24 Thread afs
Github user afs commented on a diff in the pull request:

https://github.com/apache/jena/pull/407#discussion_r183833097
  
--- Diff: 
jena-db/jena-tdb2/src/main/java/org/apache/jena/tdb2/store/DatasetGraphSwitchable.java
 ---
@@ -111,7 +112,8 @@ public Graph getDefaultGraph() {
 
 @Override
 public Graph getGraph(Node gn) {
-return ngCache.getOrFill(gn, 
()->GraphViewSwitchable.createNamedGraph(this, gn));
+Node key = ( gn != null ) ? gn : Quad.defaultGraphNodeGenerated;
+return ngCache.getOrFill(gn, 
()->GraphViewSwitchable.createNamedGraph(this, key));
--- End diff --

Yes, doh!  Thanks for spotting that.


---


[jira] [Commented] (JENA-1532) Jena Text Elastic Search Does not perform proper date comparison during query

2018-04-24 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-1532?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16450279#comment-16450279
 ] 

ASF GitHub Bot commented on JENA-1532:
--

Github user anujgandharv commented on the issue:

https://github.com/apache/jena/pull/406
  
I agree with you @osma. I have made the changes to use QueryParserBase 
instead of custom logic. Let me know if it is OK.


> Jena Text Elastic Search Does not perform proper date comparison during query
> -
>
> Key: JENA-1532
> URL: https://issues.apache.org/jira/browse/JENA-1532
> Project: Apache Jena
>  Issue Type: Bug
>  Components: Text
>Affects Versions: Jena 3.7.0
>Reporter: Anuj Kumar
>Priority: Major
>
> Jena Text Elastic Search is an implementation of the text query capability of 
> Jena to perform text based searching and Filtering of data. It uses [Query 
> String 
> Query|https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html]
>  capability of elastic search to perform searches.
> We found a bug in the implementation where searching on date values does not 
> work properly. For example, if we have a following text query:
> {code:java}
> SELECT ?s { ?s text:query ('2016-12-01T15:31:10-05:00') ;{code}
> then the implementation threw exception because there are unescaped ":" 
> (colon) in the value. Since ":" is a reserved character in the Query String 
> Query capability of Elastic search, we have to escape the character. 
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[GitHub] jena issue #406: JENA-1532 | Added support for escaping special characters i...

2018-04-24 Thread anujgandharv
Github user anujgandharv commented on the issue:

https://github.com/apache/jena/pull/406
  
I agree with you @osma. I have made the changes to use QueryParserBase 
instead of custom logic. Let me know if it is OK.


---


[jira] [Commented] (JENA-1528) HttpQuery does not set the readTimeout

2018-04-24 Thread A. Soroka (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-1528?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16450259#comment-16450259
 ] 

A. Soroka commented on JENA-1528:
-

[~nithril] can you please open a new ticket to discuss default HTTP 
configuration? I think you are asking for a more clear pattern of overrides, 
but I'm not sure...

> HttpQuery does not set the readTimeout
> --
>
> Key: JENA-1528
> URL: https://issues.apache.org/jira/browse/JENA-1528
> Project: Apache Jena
>  Issue Type: Bug
>  Components: ARQ
>Affects Versions: Jena 3.7.0
>Reporter: Nicolas Labrot
>Assignee: A. Soroka
>Priority: Minor
> Fix For: Jena 3.8.0
>
>
> {{org.apache.jena.sparql.engine.http.HttpQuery#contextualizeTimeoutSettings}} 
> sets the connectTimeout but not the readTimeout
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[GitHub] jena pull request #407: Cleanup

2018-04-24 Thread rvesse
Github user rvesse commented on a diff in the pull request:

https://github.com/apache/jena/pull/407#discussion_r183809337
  
--- Diff: 
jena-db/jena-tdb2/src/main/java/org/apache/jena/tdb2/store/DatasetGraphSwitchable.java
 ---
@@ -111,7 +112,8 @@ public Graph getDefaultGraph() {
 
 @Override
 public Graph getGraph(Node gn) {
-return ngCache.getOrFill(gn, 
()->GraphViewSwitchable.createNamedGraph(this, gn));
+Node key = ( gn != null ) ? gn : Quad.defaultGraphNodeGenerated;
+return ngCache.getOrFill(gn, 
()->GraphViewSwitchable.createNamedGraph(this, key));
--- End diff --

Shouldn't the first `gn` reference on this line also be changed to `key` 
otherwise you are adding a potentially `null` key to the cache


---


[GitHub] jena pull request #407: Cleanup

2018-04-24 Thread afs
GitHub user afs opened a pull request:

https://github.com/apache/jena/pull/407

Cleanup

A number of small things noticed while investigating a TDB2 report.

Includes tweak for JENA-1428 (cleanup) and fix for JENA-1531.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/afs/jena cleanup

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/jena/pull/407.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #407






---


[jira] [Commented] (JENA-1532) Jena Text Elastic Search Does not perform proper date comparison during query

2018-04-24 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-1532?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16450128#comment-16450128
 ] 

ASF GitHub Bot commented on JENA-1532:
--

Github user afs commented on a diff in the pull request:

https://github.com/apache/jena/pull/406#discussion_r183788841
  
--- Diff: 
jena-text-es/src/main/java/org/apache/jena/query/text/es/TextIndexES.java ---
@@ -422,6 +422,27 @@ public EntityDefinition getDocDef() {
 }
 
 private String parse(String fieldName, String qs, String lang) {
+//Escape special characters if any in the query string
+qs = qs.replaceAll("\\:", ":")
+.replaceAll("\\+", "+")
+.replaceAll("\\-", "-")
+.replaceAll("\\=", "=")
+.replaceAll("\\&", "&")
+.replaceAll("\\|", "|")
+.replaceAll("\\>", ">")
+.replaceAll("\\<", "<")
+.replaceAll("\\!", "!")
+.replaceAll("\\(", "(")
+.replaceAll("\\)", ")")
+.replaceAll("\\{", "{")
+.replaceAll("\\}", "}")
+.replaceAll("\\]", "]")
+.replaceAll("\\[", "[")
+.replaceAll("\\^", "^")
+.replaceAll("\\~", "~")
+.replaceAll("\\?", "?");
+
--- End diff --

The [Lucene escape 
code|https://github.com/apache/lucene-solr/blob/master/lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParserBase.java#L971].

It includes `\\` and does a simple pass over the string.

The thing to watch for with `replaceAll` is that it creates a regex every 
call which can mount up even for these fixed string regexps.


> Jena Text Elastic Search Does not perform proper date comparison during query
> -
>
> Key: JENA-1532
> URL: https://issues.apache.org/jira/browse/JENA-1532
> Project: Apache Jena
>  Issue Type: Bug
>  Components: Text
>Affects Versions: Jena 3.7.0
>Reporter: Anuj Kumar
>Priority: Major
>
> Jena Text Elastic Search is an implementation of the text query capability of 
> Jena to perform text based searching and Filtering of data. It uses [Query 
> String 
> Query|https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html]
>  capability of elastic search to perform searches.
> We found a bug in the implementation where searching on date values does not 
> work properly. For example, if we have a following text query:
> {code:java}
> SELECT ?s { ?s text:query ('2016-12-01T15:31:10-05:00') ;{code}
> then the implementation threw exception because there are unescaped ":" 
> (colon) in the value. Since ":" is a reserved character in the Query String 
> Query capability of Elastic search, we have to escape the character. 
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[GitHub] jena pull request #406: JENA-1532 | Added support for escaping special chara...

2018-04-24 Thread afs
Github user afs commented on a diff in the pull request:

https://github.com/apache/jena/pull/406#discussion_r183788841
  
--- Diff: 
jena-text-es/src/main/java/org/apache/jena/query/text/es/TextIndexES.java ---
@@ -422,6 +422,27 @@ public EntityDefinition getDocDef() {
 }
 
 private String parse(String fieldName, String qs, String lang) {
+//Escape special characters if any in the query string
+qs = qs.replaceAll("\\:", ":")
+.replaceAll("\\+", "+")
+.replaceAll("\\-", "-")
+.replaceAll("\\=", "=")
+.replaceAll("\\&", "&")
+.replaceAll("\\|", "|")
+.replaceAll("\\>", ">")
+.replaceAll("\\<", "<")
+.replaceAll("\\!", "!")
+.replaceAll("\\(", "(")
+.replaceAll("\\)", ")")
+.replaceAll("\\{", "{")
+.replaceAll("\\}", "}")
+.replaceAll("\\]", "]")
+.replaceAll("\\[", "[")
+.replaceAll("\\^", "^")
+.replaceAll("\\~", "~")
+.replaceAll("\\?", "?");
+
--- End diff --

The [Lucene escape 
code|https://github.com/apache/lucene-solr/blob/master/lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParserBase.java#L971].

It includes `\\` and does a simple pass over the string.

The thing to watch for with `replaceAll` is that it creates a regex every 
call which can mount up even for these fixed string regexps.


---


Re: Extending ARQ to retrieve FILTER operations from Sparql Queries

2018-04-24 Thread Rob Vesse
Looking at the code for how TDB does this might be useful:

https://github.com/apache/jena/blob/master/jena-tdb/src/main/java/org/apache/jena/tdb/solver/OpExecutorTDB1.java

Rob

On 24/04/2018, 16:54, "Rob Vesse"  wrote:

The point is to not modify the parsing but the execution

By substituting a different OpExecutor implementation you can provide a 
custom executeOp() implementation that recognizes when an OpFilter operator is 
seen and acts accordingly

Rob

On 24/04/2018, 16:34, "anuj kumar"  wrote:

I have another query, this time relating to ARQ and how I can extend it.
*Background*

I am using HBase as the underlying Data Store for Triples (by 
implementing
various Jena Extension points).
So far so good.
But now I have certain SPARQL queries that have FILTER operations 
defined.
With a huge data set, that I have, its taking a lot of time to FILTER 
the
data out.

So, I want to extract the FILTER portion of the Query out and simply 
want
to pass it as a HBase Filter to the HBase client so that filtering can
happen at RegionServer level itself.

This question is very similar to the question here


on
stackoverflow.

I have been reading about ARQ and OpExecutor and believe that it may be
what I need but I cant seem to find a simple example on which I can 
build
up.

Can someone help me with getting to understand how I can parse the 
incoming
query to REMOVE the FILTER clause from it and instead take the filter
statement and evaluate it.

Thanks,
-- 
*Anuj Kumar*












Re: Extending ARQ to retrieve FILTER operations from Sparql Queries

2018-04-24 Thread Rob Vesse
The point is to not modify the parsing but the execution

By substituting a different OpExecutor implementation you can provide a custom 
executeOp() implementation that recognizes when an OpFilter operator is seen 
and acts accordingly

Rob

On 24/04/2018, 16:34, "anuj kumar"  wrote:

I have another query, this time relating to ARQ and how I can extend it.
*Background*

I am using HBase as the underlying Data Store for Triples (by implementing
various Jena Extension points).
So far so good.
But now I have certain SPARQL queries that have FILTER operations defined.
With a huge data set, that I have, its taking a lot of time to FILTER the
data out.

So, I want to extract the FILTER portion of the Query out and simply want
to pass it as a HBase Filter to the HBase client so that filtering can
happen at RegionServer level itself.

This question is very similar to the question here


on
stackoverflow.

I have been reading about ARQ and OpExecutor and believe that it may be
what I need but I cant seem to find a simple example on which I can build
up.

Can someone help me with getting to understand how I can parse the incoming
query to REMOVE the FILTER clause from it and instead take the filter
statement and evaluate it.

Thanks,
-- 
*Anuj Kumar*







[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-04-24 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-632?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16450118#comment-16450118
 ] 

ASF GitHub Bot commented on JENA-632:
-

Github user afs commented on a diff in the pull request:

https://github.com/apache/jena/pull/114#discussion_r183786125
  
--- Diff: jena-arq/Grammar/master.jj ---
@@ -2176,6 +2251,19 @@ String String() : { Token t ; String lex ; }
 }
 }
 
+#ifdef ARQ
+Number Number() : { Token t ; Number number ; }
+{
+  (
+t = < INTEGER > { number = integerValue(t.image) ; }
+  | t = < DECIMAL > { number = doubleValue(t.image) ; }
--- End diff --

Couldn't reply to the number point - I think the rebase has moved things 
around - it now looks right.  Tests will tell!


> Generate JSON from SPARQL directly.
> ---
>
> Key: JENA-632
> URL: https://issues.apache.org/jira/browse/JENA-632
> Project: Apache Jena
>  Issue Type: Improvement
>  Components: ARQ, Fuseki
>Reporter: Andy Seaborne
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> The capability to generate JSON directly from a SPARQL (or extended SPARQL) 
> query would enable the creation of JSON data API over published linked data.
> This project would cover:
> # Design and publication of a design.
> # Refinement of design based on community feed
> # Implementation, including testing.
> # Refinement of implementation based on community feed
> Skills required: Java, some parser work, design and discussion with the user 
> community, basic understanding of HTTP and content negotiation.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[GitHub] jena pull request #114: JENA-632: Generate JSON from SPARQL directly

2018-04-24 Thread afs
Github user afs commented on a diff in the pull request:

https://github.com/apache/jena/pull/114#discussion_r183786125
  
--- Diff: jena-arq/Grammar/master.jj ---
@@ -2176,6 +2251,19 @@ String String() : { Token t ; String lex ; }
 }
 }
 
+#ifdef ARQ
+Number Number() : { Token t ; Number number ; }
+{
+  (
+t = < INTEGER > { number = integerValue(t.image) ; }
+  | t = < DECIMAL > { number = doubleValue(t.image) ; }
--- End diff --

Couldn't reply to the number point - I think the rebase has moved things 
around - it now looks right.  Tests will tell!


---


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-04-24 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-632?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16450116#comment-16450116
 ] 

ASF GitHub Bot commented on JENA-632:
-

Github user afs commented on a diff in the pull request:

https://github.com/apache/jena/pull/114#discussion_r183785846
  
--- Diff: jena-arq/Grammar/master.jj ---
@@ -2176,6 +2251,19 @@ String String() : { Token t ; String lex ; }
 }
 }
 
+#ifdef ARQ
+Number Number() : { Token t ; Number number ; }
+{
+  (
+t = < INTEGER > { number = integerValue(t.image) ; }
+  | t = < DECIMAL > { number = doubleValue(t.image) ; }
--- End diff --

Observa
tion: The JSON clause can be DRY-ed with `JsonObjectMember() (  
JsonObjectMember()) *` and put lines 342-355 in `JsonObjectMember`.


> Generate JSON from SPARQL directly.
> ---
>
> Key: JENA-632
> URL: https://issues.apache.org/jira/browse/JENA-632
> Project: Apache Jena
>  Issue Type: Improvement
>  Components: ARQ, Fuseki
>Reporter: Andy Seaborne
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> The capability to generate JSON directly from a SPARQL (or extended SPARQL) 
> query would enable the creation of JSON data API over published linked data.
> This project would cover:
> # Design and publication of a design.
> # Refinement of design based on community feed
> # Implementation, including testing.
> # Refinement of implementation based on community feed
> Skills required: Java, some parser work, design and discussion with the user 
> community, basic understanding of HTTP and content negotiation.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[GitHub] jena pull request #114: JENA-632: Generate JSON from SPARQL directly

2018-04-24 Thread afs
Github user afs commented on a diff in the pull request:

https://github.com/apache/jena/pull/114#discussion_r183785846
  
--- Diff: jena-arq/Grammar/master.jj ---
@@ -2176,6 +2251,19 @@ String String() : { Token t ; String lex ; }
 }
 }
 
+#ifdef ARQ
+Number Number() : { Token t ; Number number ; }
+{
+  (
+t = < INTEGER > { number = integerValue(t.image) ; }
+  | t = < DECIMAL > { number = doubleValue(t.image) ; }
--- End diff --

Observa
tion: The JSON clause can be DRY-ed with `JsonObjectMember() (  
JsonObjectMember()) *` and put lines 342-355 in `JsonObjectMember`.


---


Extending ARQ to retrieve FILTER operations from Sparql Queries

2018-04-24 Thread anuj kumar
I have another query, this time relating to ARQ and how I can extend it.
*Background*

I am using HBase as the underlying Data Store for Triples (by implementing
various Jena Extension points).
So far so good.
But now I have certain SPARQL queries that have FILTER operations defined.
With a huge data set, that I have, its taking a lot of time to FILTER the
data out.

So, I want to extract the FILTER portion of the Query out and simply want
to pass it as a HBase Filter to the HBase client so that filtering can
happen at RegionServer level itself.

This question is very similar to the question here

on
stackoverflow.

I have been reading about ARQ and OpExecutor and believe that it may be
what I need but I cant seem to find a simple example on which I can build
up.

Can someone help me with getting to understand how I can parse the incoming
query to REMOVE the FILTER clause from it and instead take the filter
statement and evaluate it.

Thanks,
-- 
*Anuj Kumar*


Re: Question about Jena Indexing

2018-04-24 Thread anuj kumar
Hey Ajs6f,
 Thats what I also thought but I tried the approach and it didn't work.
This is how i did it

> dataset.begin(ReadWrite.WRITE) ;
> try {
> Model m = dataset.getDefaultModel() ;
> Model m2 = ModelFactory.createDefaultModel();
> m2.read(file);
> m2.write(System.out);
> m.add(m2);
> //RDFDataMgr.read(m, file) ;
> dataset.commit() ;
>
> I may be doing something stupid here, i know.


I will keep digging.

Thanks,
Anuj Kumar


On Tue, Apr 24, 2018 at 2:10 PM, ajs6f  wrote:

> Hello, Anuj--
>
> I may be missing something about your question, but wouldn't
> Model.add(Model) [1] work here?
>
> ajs6f
>
> [1] https://jena.apache.org/documentation/javadoc/jena/
> org/apache/jena/rdf/model/Model.html#add-org.apache.jena.rdf.model.Model-
>
> > On Apr 24, 2018, at 7:14 AM, anuj kumar  wrote:
> >
> > Hi,
> > I have a scenario, where I have an instance of a Model Object that
> contains
> > multiple Statements.
> > Now I want to index the statements in this Model in Jena Text ES indexing
> > implementation.
> >
> > *Question is*: How can i do that. :)
> >
> > Until now I was indexing data by reading the data from a file into a
> model
> > instance using RDFDataMgr which automatically binds the read with the
> index
> > lifecycle. This was done like this:
> >
> >> dataset.begin(ReadWrite.WRITE) ;
> >> try {
> >>Model m = dataset.getDefaultModel() ;
> >>RDFDataMgr.read(m, file) ;
> >>dataset.commit() ;
> >> } finally { dataset.end() ; }
> >>
> >>
> >> But now, instead of reading the triples from a file (or Inputstream), i
> > want to  read the triples from a Model Instance.
> >
> > Can someone help me with this please.
> >
> > Thanks,
> > Anuj Kumar
> >
> > --
> > *Anuj Kumar*
>
>


-- 
*Anuj Kumar*


[jira] [Commented] (JENA-1524) org.apache.jena.system is split by org.apache.jena.arq and org.apache.jena.core

2018-04-24 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-1524?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16449979#comment-16449979
 ] 

ASF GitHub Bot commented on JENA-1524:
--

Github user afs commented on the issue:

https://github.com/apache/jena/pull/401
  
`RemovalNotification` is used in the constructor for `CacheGuava`.


> org.apache.jena.system is split by org.apache.jena.arq and 
> org.apache.jena.core
> ---
>
> Key: JENA-1524
> URL: https://issues.apache.org/jira/browse/JENA-1524
> Project: Apache Jena
>  Issue Type: Bug
>  Components: Jena
>Affects Versions: Jena 3.7.0
>Reporter: Christopher Johnson
>Priority: Major
>
> a JPMS module cannot require both org.apache.jena.arq and 
> org.apache.jena.core since org.apache.jena.system can be read from both.  
> This cannot be resolved with --patch-module since arq and core provide 
> different implementations.  Suggestion is to make a distinction by renaming 
> system to sys in either one.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[GitHub] jena issue #401: [JENA-1524] org.apache.jena.system is split by org.apache.j...

2018-04-24 Thread afs
Github user afs commented on the issue:

https://github.com/apache/jena/pull/401
  
`RemovalNotification` is used in the constructor for `CacheGuava`.


---


[jira] [Commented] (JENA-1524) org.apache.jena.system is split by org.apache.jena.arq and org.apache.jena.core

2018-04-24 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-1524?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16449950#comment-16449950
 ] 

ASF GitHub Bot commented on JENA-1524:
--

Github user christopher-johnson commented on the issue:

https://github.com/apache/jena/pull/401
  
Indeed, these dependency questions are issues that I need to solve... I 
would prefer to simplify the über-jar `jena-osgi` dependency of 
`commons.rdf.jena` by creating lean modular jena artifacts (with BND 
manifests), that can be managed by a downstream application more easily.

I have a quick related question about the shaded-guava dependency.  Would 
you know why `org.apache.jena.atlas.lib.cache.CacheGuava` would still be 
looking for `org/apache/jena/ext/com/google/common/cache/RemovalNotification` 
even though there are absolutely no references to the shadow redirection in the 
code or the build scripts?  This reference to the shadow redirection is buried 
somewhere (perhaps in my filesystem), and I know that it is not using any local 
maven cache now as I built `org.apache.jena.base` in offline mode.  Thanks.


> org.apache.jena.system is split by org.apache.jena.arq and 
> org.apache.jena.core
> ---
>
> Key: JENA-1524
> URL: https://issues.apache.org/jira/browse/JENA-1524
> Project: Apache Jena
>  Issue Type: Bug
>  Components: Jena
>Affects Versions: Jena 3.7.0
>Reporter: Christopher Johnson
>Priority: Major
>
> a JPMS module cannot require both org.apache.jena.arq and 
> org.apache.jena.core since org.apache.jena.system can be read from both.  
> This cannot be resolved with --patch-module since arq and core provide 
> different implementations.  Suggestion is to make a distinction by renaming 
> system to sys in either one.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[GitHub] jena issue #401: [JENA-1524] org.apache.jena.system is split by org.apache.j...

2018-04-24 Thread christopher-johnson
Github user christopher-johnson commented on the issue:

https://github.com/apache/jena/pull/401
  
Indeed, these dependency questions are issues that I need to solve... I 
would prefer to simplify the über-jar `jena-osgi` dependency of 
`commons.rdf.jena` by creating lean modular jena artifacts (with BND 
manifests), that can be managed by a downstream application more easily.

I have a quick related question about the shaded-guava dependency.  Would 
you know why `org.apache.jena.atlas.lib.cache.CacheGuava` would still be 
looking for `org/apache/jena/ext/com/google/common/cache/RemovalNotification` 
even though there are absolutely no references to the shadow redirection in the 
code or the build scripts?  This reference to the shadow redirection is buried 
somewhere (perhaps in my filesystem), and I know that it is not using any local 
maven cache now as I built `org.apache.jena.base` in offline mode.  Thanks.


---


[GitHub] jena issue #401: [JENA-1524] org.apache.jena.system is split by org.apache.j...

2018-04-24 Thread afs
Github user afs commented on the issue:

https://github.com/apache/jena/pull/401
  
> Compilation  in JPMS requires a module-info.java and is distinct from 
compiling in JDK 9+.

The issue is for trellisldp to solve surely? The transitivity is an 
indirect jena-osgi dependency and a direct jena dependency.

Or a PR to improve `jena-osgi` (which does not get much use or at least not 
much user@ questions). You may also wish to take that up with CommonsRDF. I'm 
not sure OSGi is helping here.

`jena-osgi` does not affect the oaj.atlas issue between `jena-arq` and 
`jena-base`.

This PR is for the org.system split package. This seems completed. I'd like 
to get this merged and other matters taken up in separate issues/JIRA so we can 
make incremental progress.



---


[jira] [Commented] (JENA-1524) org.apache.jena.system is split by org.apache.jena.arq and org.apache.jena.core

2018-04-24 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-1524?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16449845#comment-16449845
 ] 

ASF GitHub Bot commented on JENA-1524:
--

Github user afs commented on the issue:

https://github.com/apache/jena/pull/401
  
> Compilation  in JPMS requires a module-info.java and is distinct from 
compiling in JDK 9+.

The issue is for trellisldp to solve surely? The transitivity is an 
indirect jena-osgi dependency and a direct jena dependency.

Or a PR to improve `jena-osgi` (which does not get much use or at least not 
much user@ questions). You may also wish to take that up with CommonsRDF. I'm 
not sure OSGi is helping here.

`jena-osgi` does not affect the oaj.atlas issue between `jena-arq` and 
`jena-base`.

This PR is for the org.system split package. This seems completed. I'd like 
to get this merged and other matters taken up in separate issues/JIRA so we can 
make incremental progress.



> org.apache.jena.system is split by org.apache.jena.arq and 
> org.apache.jena.core
> ---
>
> Key: JENA-1524
> URL: https://issues.apache.org/jira/browse/JENA-1524
> Project: Apache Jena
>  Issue Type: Bug
>  Components: Jena
>Affects Versions: Jena 3.7.0
>Reporter: Christopher Johnson
>Priority: Major
>
> a JPMS module cannot require both org.apache.jena.arq and 
> org.apache.jena.core since org.apache.jena.system can be read from both.  
> This cannot be resolved with --patch-module since arq and core provide 
> different implementations.  Suggestion is to make a distinction by renaming 
> system to sys in either one.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[GitHub] jena issue #390: Bugfix Tutorial 6: Missing "/" at the end of an URI resulte...

2018-04-24 Thread ajs6f
Github user ajs6f commented on the issue:

https://github.com/apache/jena/pull/390
  
@kinow Yep, those Commons threads are exactly what brought it back to my 
mind. Okay, I suggest that we leave this particular issue as @kinow suggests 
(Jira ticket and go from there) and I will (sometime today or tomorrow) restart 
those threads on dev@ about GitBox, etc.


---


Re: Question about Jena Indexing

2018-04-24 Thread ajs6f
Hello, Anuj--

I may be missing something about your question, but wouldn't Model.add(Model) 
[1] work here?

ajs6f

[1] 
https://jena.apache.org/documentation/javadoc/jena/org/apache/jena/rdf/model/Model.html#add-org.apache.jena.rdf.model.Model-

> On Apr 24, 2018, at 7:14 AM, anuj kumar  wrote:
> 
> Hi,
> I have a scenario, where I have an instance of a Model Object that contains
> multiple Statements.
> Now I want to index the statements in this Model in Jena Text ES indexing
> implementation.
> 
> *Question is*: How can i do that. :)
> 
> Until now I was indexing data by reading the data from a file into a model
> instance using RDFDataMgr which automatically binds the read with the index
> lifecycle. This was done like this:
> 
>> dataset.begin(ReadWrite.WRITE) ;
>> try {
>>Model m = dataset.getDefaultModel() ;
>>RDFDataMgr.read(m, file) ;
>>dataset.commit() ;
>> } finally { dataset.end() ; }
>> 
>> 
>> But now, instead of reading the triples from a file (or Inputstream), i
> want to  read the triples from a Model Instance.
> 
> Can someone help me with this please.
> 
> Thanks,
> Anuj Kumar
> 
> -- 
> *Anuj Kumar*



Question about Jena Indexing

2018-04-24 Thread anuj kumar
Hi,
I have a scenario, where I have an instance of a Model Object that contains
multiple Statements.
Now I want to index the statements in this Model in Jena Text ES indexing
implementation.

*Question is*: How can i do that. :)

Until now I was indexing data by reading the data from a file into a model
instance using RDFDataMgr which automatically binds the read with the index
lifecycle. This was done like this:

> dataset.begin(ReadWrite.WRITE) ;
> try {
> Model m = dataset.getDefaultModel() ;
> RDFDataMgr.read(m, file) ;
> dataset.commit() ;
> } finally { dataset.end() ; }
>
>
> But now, instead of reading the triples from a file (or Inputstream), i
want to  read the triples from a Model Instance.

Can someone help me with this please.

Thanks,
Anuj Kumar

-- 
*Anuj Kumar*


[jira] [Commented] (JENA-1524) org.apache.jena.system is split by org.apache.jena.arq and org.apache.jena.core

2018-04-24 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-1524?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16449644#comment-16449644
 ] 

ASF GitHub Bot commented on JENA-1524:
--

Github user christopher-johnson commented on the issue:

https://github.com/apache/jena/pull/401
  
Compilation in JPMS requires a `module-info.java` and is distinct from 
compiling in JDK 9+.  

> What is the issue here? Does anything break?

A quick background of the use case might help here.  I have been developing 
JPMS support for the TrellisLDP project recently and have encountered several 
blocking dependency issues resulting from `jena-osgi`, which is a [transitive 
dependency 
](https://github.com/apache/commons-rdf/blob/master/commons-rdf-jena/pom.xml#L68-L72)
 resulting from `org.apache.commons.rdf.jena` that is a direct dependency of 
the `org.trellisldp.app.triplestore` implementation.  JPMS compilation is 
strict and cannot resolve a class-containing package sourced from multiple 
"parent modules" (even if the package is private).[1]   A good question here 
that you raise is what happens if a top level package contains no classes and 
only exports subpackages.  This requires further investigation and I do not 
know whether this semi-split, semi-private package, multi-module configuration 
works, but it is probably not advisable according to the requirements of the 
[specification](http://openjdk.java.net/projects/jigsaw/spec/reqs/#non-interference).

Regarding this PR, I am running tests now.  BTW, for me, the shaded-guava 
jar does not work.   I do not know whether it is my IDE, JRE or the maven build 
configuration.  At any rate, I can run tests if I replace the shaded-guava with 
a direct dependency.  Also, `guava 21.0` does not work (without hacking) in a 
JDK10 because it depends on  `javax.annotation.Nullable`.  (it seems that 
`guava 24.1-jre` removes the problematic jsr-305 annotations).

There seems to be an initialization/lifecycle issue that can be seen when 
running `TestFactoryRDF`.  The first test to fail there is 
`factoryRDF_triple_01` with this exception 
`java.lang.ExceptionInInitializerError`.
also 
`com.google.common.util.concurrent.ExecutionError: 
java.lang.NoClassDefFoundError: Could not initialize class 
org.apache.jena.riot.system.RiotLib` is reported.

The preceding tests pass.  It could be my issue, though as an 
initialization related, it could be a consequence of a the changes in this PR:

`java.lang.ExceptionInInitializerError` is also produced in a test runtime 
use of `org.apache.jena.arq` by a `org.trellisldp.vocabulary` test:
```
java.lang.ExceptionInInitializerError
   
org.apache.jena.riot.RDFParserBuilder.buildFactoryRDF(RDFParserBuilder.java:597)
   
org.apache.jena.riot.RDFParserBuilder.build(RDFParserBuilder.java:569)
   
org.apache.jena.riot.RDFParserBuilder.parse(RDFParserBuilder.java:512)
   
org.trellisldp.vocabulary.AbstractVocabularyTest.getVocabulary(AbstractVocabularyTest.java:56)
   
org.trellisldp.vocabulary.AbstractVocabularyTest.testVocabulary(AbstractVocabularyTest.java:62)
```

[1] 
https://stackoverflow.com/questions/40616739/java-9-overlapping-non-exported-packages


> org.apache.jena.system is split by org.apache.jena.arq and 
> org.apache.jena.core
> ---
>
> Key: JENA-1524
> URL: https://issues.apache.org/jira/browse/JENA-1524
> Project: Apache Jena
>  Issue Type: Bug
>  Components: Jena
>Affects Versions: Jena 3.7.0
>Reporter: Christopher Johnson
>Priority: Major
>
> a JPMS module cannot require both org.apache.jena.arq and 
> org.apache.jena.core since org.apache.jena.system can be read from both.  
> This cannot be resolved with --patch-module since arq and core provide 
> different implementations.  Suggestion is to make a distinction by renaming 
> system to sys in either one.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[GitHub] jena issue #401: [JENA-1524] org.apache.jena.system is split by org.apache.j...

2018-04-24 Thread christopher-johnson
Github user christopher-johnson commented on the issue:

https://github.com/apache/jena/pull/401
  
Compilation in JPMS requires a `module-info.java` and is distinct from 
compiling in JDK 9+.  

> What is the issue here? Does anything break?

A quick background of the use case might help here.  I have been developing 
JPMS support for the TrellisLDP project recently and have encountered several 
blocking dependency issues resulting from `jena-osgi`, which is a [transitive 
dependency 
](https://github.com/apache/commons-rdf/blob/master/commons-rdf-jena/pom.xml#L68-L72)
 resulting from `org.apache.commons.rdf.jena` that is a direct dependency of 
the `org.trellisldp.app.triplestore` implementation.  JPMS compilation is 
strict and cannot resolve a class-containing package sourced from multiple 
"parent modules" (even if the package is private).[1]   A good question here 
that you raise is what happens if a top level package contains no classes and 
only exports subpackages.  This requires further investigation and I do not 
know whether this semi-split, semi-private package, multi-module configuration 
works, but it is probably not advisable according to the requirements of the 
[specification](http://openjdk.java.net/projects/jigs
 aw/spec/reqs/#non-interference).

Regarding this PR, I am running tests now.  BTW, for me, the shaded-guava 
jar does not work.   I do not know whether it is my IDE, JRE or the maven build 
configuration.  At any rate, I can run tests if I replace the shaded-guava with 
a direct dependency.  Also, `guava 21.0` does not work (without hacking) in a 
JDK10 because it depends on  `javax.annotation.Nullable`.  (it seems that 
`guava 24.1-jre` removes the problematic jsr-305 annotations).

There seems to be an initialization/lifecycle issue that can be seen when 
running `TestFactoryRDF`.  The first test to fail there is 
`factoryRDF_triple_01` with this exception 
`java.lang.ExceptionInInitializerError`.
also 
`com.google.common.util.concurrent.ExecutionError: 
java.lang.NoClassDefFoundError: Could not initialize class 
org.apache.jena.riot.system.RiotLib` is reported.

The preceding tests pass.  It could be my issue, though as an 
initialization related, it could be a consequence of a the changes in this PR:

`java.lang.ExceptionInInitializerError` is also produced in a test runtime 
use of `org.apache.jena.arq` by a `org.trellisldp.vocabulary` test:
```
java.lang.ExceptionInInitializerError
   
org.apache.jena.riot.RDFParserBuilder.buildFactoryRDF(RDFParserBuilder.java:597)
   
org.apache.jena.riot.RDFParserBuilder.build(RDFParserBuilder.java:569)
   
org.apache.jena.riot.RDFParserBuilder.parse(RDFParserBuilder.java:512)
   
org.trellisldp.vocabulary.AbstractVocabularyTest.getVocabulary(AbstractVocabularyTest.java:56)
   
org.trellisldp.vocabulary.AbstractVocabularyTest.testVocabulary(AbstractVocabularyTest.java:62)
```

[1] 
https://stackoverflow.com/questions/40616739/java-9-overlapping-non-exported-packages


---


[jira] [Commented] (JENA-1532) Jena Text Elastic Search Does not perform proper date comparison during query

2018-04-24 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-1532?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16449458#comment-16449458
 ] 

ASF GitHub Bot commented on JENA-1532:
--

Github user anujgandharv commented on a diff in the pull request:

https://github.com/apache/jena/pull/406#discussion_r183642709
  
--- Diff: 
jena-text-es/src/main/java/org/apache/jena/query/text/es/TextIndexES.java ---
@@ -422,6 +422,27 @@ public EntityDefinition getDocDef() {
 }
 
 private String parse(String fieldName, String qs, String lang) {
+//Escape special characters if any in the query string
+qs = qs.replaceAll("\\:", ":")
+.replaceAll("\\+", "+")
+.replaceAll("\\-", "-")
+.replaceAll("\\=", "=")
+.replaceAll("\\&", "&")
+.replaceAll("\\|", "|")
+.replaceAll("\\>", ">")
+.replaceAll("\\<", "<")
+.replaceAll("\\!", "!")
+.replaceAll("\\(", "(")
+.replaceAll("\\)", ")")
+.replaceAll("\\{", "{")
+.replaceAll("\\}", "}")
+.replaceAll("\\]", "]")
+.replaceAll("\\[", "[")
+.replaceAll("\\^", "^")
+.replaceAll("\\~", "~")
+.replaceAll("\\?", "?");
+
--- End diff --

So, what i understand is that backslashes need to be escaped even before 
they reach the Jena ES query method, just like double quotes. Therefore i 
haven't added the check for it. I can add a unit test depicting the escaping of 
backslash in the query string itself. Let me know if that would help.


> Jena Text Elastic Search Does not perform proper date comparison during query
> -
>
> Key: JENA-1532
> URL: https://issues.apache.org/jira/browse/JENA-1532
> Project: Apache Jena
>  Issue Type: Bug
>  Components: Text
>Affects Versions: Jena 3.7.0
>Reporter: Anuj Kumar
>Priority: Major
>
> Jena Text Elastic Search is an implementation of the text query capability of 
> Jena to perform text based searching and Filtering of data. It uses [Query 
> String 
> Query|https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html]
>  capability of elastic search to perform searches.
> We found a bug in the implementation where searching on date values does not 
> work properly. For example, if we have a following text query:
> {code:java}
> SELECT ?s { ?s text:query ('2016-12-01T15:31:10-05:00') ;{code}
> then the implementation threw exception because there are unescaped ":" 
> (colon) in the value. Since ":" is a reserved character in the Query String 
> Query capability of Elastic search, we have to escape the character. 
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[GitHub] jena pull request #406: JENA-1532 | Added support for escaping special chara...

2018-04-24 Thread anujgandharv
Github user anujgandharv commented on a diff in the pull request:

https://github.com/apache/jena/pull/406#discussion_r183642709
  
--- Diff: 
jena-text-es/src/main/java/org/apache/jena/query/text/es/TextIndexES.java ---
@@ -422,6 +422,27 @@ public EntityDefinition getDocDef() {
 }
 
 private String parse(String fieldName, String qs, String lang) {
+//Escape special characters if any in the query string
+qs = qs.replaceAll("\\:", ":")
+.replaceAll("\\+", "+")
+.replaceAll("\\-", "-")
+.replaceAll("\\=", "=")
+.replaceAll("\\&", "&")
+.replaceAll("\\|", "|")
+.replaceAll("\\>", ">")
+.replaceAll("\\<", "<")
+.replaceAll("\\!", "!")
+.replaceAll("\\(", "(")
+.replaceAll("\\)", ")")
+.replaceAll("\\{", "{")
+.replaceAll("\\}", "}")
+.replaceAll("\\]", "]")
+.replaceAll("\\[", "[")
+.replaceAll("\\^", "^")
+.replaceAll("\\~", "~")
+.replaceAll("\\?", "?");
+
--- End diff --

So, what i understand is that backslashes need to be escaped even before 
they reach the Jena ES query method, just like double quotes. Therefore i 
haven't added the check for it. I can add a unit test depicting the escaping of 
backslash in the query string itself. Let me know if that would help.


---


[jira] [Commented] (JENA-1532) Jena Text Elastic Search Does not perform proper date comparison during query

2018-04-24 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-1532?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16449431#comment-16449431
 ] 

ASF GitHub Bot commented on JENA-1532:
--

Github user osma commented on a diff in the pull request:

https://github.com/apache/jena/pull/406#discussion_r183630332
  
--- Diff: jena-text-es/src/main/java/examples/JenaESTextExample.java ---
@@ -73,7 +73,8 @@ public static void queryDataWithoutProperty(Dataset 
dataset)
 String qs = StrUtils.strjoinNL
 ( "SELECT * "
 //, " { ?s text:query (rdfs:comment 'this' 
'lang:en') ;"
-, " { ?s text:query ('this' 'lang:en*') ;"
+//, " { ?s text:query ('this' 'lang:en*') ;"
--- End diff --

Does the example code have to be changed?


> Jena Text Elastic Search Does not perform proper date comparison during query
> -
>
> Key: JENA-1532
> URL: https://issues.apache.org/jira/browse/JENA-1532
> Project: Apache Jena
>  Issue Type: Bug
>  Components: Text
>Affects Versions: Jena 3.7.0
>Reporter: Anuj Kumar
>Priority: Major
>
> Jena Text Elastic Search is an implementation of the text query capability of 
> Jena to perform text based searching and Filtering of data. It uses [Query 
> String 
> Query|https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html]
>  capability of elastic search to perform searches.
> We found a bug in the implementation where searching on date values does not 
> work properly. For example, if we have a following text query:
> {code:java}
> SELECT ?s { ?s text:query ('2016-12-01T15:31:10-05:00') ;{code}
> then the implementation threw exception because there are unescaped ":" 
> (colon) in the value. Since ":" is a reserved character in the Query String 
> Query capability of Elastic search, we have to escape the character. 
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[GitHub] jena pull request #406: JENA-1532 | Added support for escaping special chara...

2018-04-24 Thread osma
Github user osma commented on a diff in the pull request:

https://github.com/apache/jena/pull/406#discussion_r183630591
  
--- Diff: 
jena-text-es/src/main/java/org/apache/jena/query/text/es/TextIndexES.java ---
@@ -422,6 +422,27 @@ public EntityDefinition getDocDef() {
 }
 
 private String parse(String fieldName, String qs, String lang) {
+//Escape special characters if any in the query string
+qs = qs.replaceAll("\\:", ":")
+.replaceAll("\\+", "+")
+.replaceAll("\\-", "-")
+.replaceAll("\\=", "=")
+.replaceAll("\\&", "&")
+.replaceAll("\\|", "|")
+.replaceAll("\\>", ">")
+.replaceAll("\\<", "<")
+.replaceAll("\\!", "!")
+.replaceAll("\\(", "(")
+.replaceAll("\\)", ")")
+.replaceAll("\\{", "{")
+.replaceAll("\\}", "}")
+.replaceAll("\\]", "]")
+.replaceAll("\\[", "[")
+.replaceAll("\\^", "^")
+.replaceAll("\\~", "~")
+.replaceAll("\\?", "?");
+
--- End diff --

What about escaping preexisting backslashes in the query string? I suppose 
that would have to be done first.


---


[jira] [Commented] (JENA-1532) Jena Text Elastic Search Does not perform proper date comparison during query

2018-04-24 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-1532?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16449432#comment-16449432
 ] 

ASF GitHub Bot commented on JENA-1532:
--

Github user osma commented on a diff in the pull request:

https://github.com/apache/jena/pull/406#discussion_r183630591
  
--- Diff: 
jena-text-es/src/main/java/org/apache/jena/query/text/es/TextIndexES.java ---
@@ -422,6 +422,27 @@ public EntityDefinition getDocDef() {
 }
 
 private String parse(String fieldName, String qs, String lang) {
+//Escape special characters if any in the query string
+qs = qs.replaceAll("\\:", ":")
+.replaceAll("\\+", "+")
+.replaceAll("\\-", "-")
+.replaceAll("\\=", "=")
+.replaceAll("\\&", "&")
+.replaceAll("\\|", "|")
+.replaceAll("\\>", ">")
+.replaceAll("\\<", "<")
+.replaceAll("\\!", "!")
+.replaceAll("\\(", "(")
+.replaceAll("\\)", ")")
+.replaceAll("\\{", "{")
+.replaceAll("\\}", "}")
+.replaceAll("\\]", "]")
+.replaceAll("\\[", "[")
+.replaceAll("\\^", "^")
+.replaceAll("\\~", "~")
+.replaceAll("\\?", "?");
+
--- End diff --

What about escaping preexisting backslashes in the query string? I suppose 
that would have to be done first.


> Jena Text Elastic Search Does not perform proper date comparison during query
> -
>
> Key: JENA-1532
> URL: https://issues.apache.org/jira/browse/JENA-1532
> Project: Apache Jena
>  Issue Type: Bug
>  Components: Text
>Affects Versions: Jena 3.7.0
>Reporter: Anuj Kumar
>Priority: Major
>
> Jena Text Elastic Search is an implementation of the text query capability of 
> Jena to perform text based searching and Filtering of data. It uses [Query 
> String 
> Query|https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html]
>  capability of elastic search to perform searches.
> We found a bug in the implementation where searching on date values does not 
> work properly. For example, if we have a following text query:
> {code:java}
> SELECT ?s { ?s text:query ('2016-12-01T15:31:10-05:00') ;{code}
> then the implementation threw exception because there are unescaped ":" 
> (colon) in the value. Since ":" is a reserved character in the Query String 
> Query capability of Elastic search, we have to escape the character. 
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[GitHub] jena pull request #406: JENA-1532 | Added support for escaping special chara...

2018-04-24 Thread osma
Github user osma commented on a diff in the pull request:

https://github.com/apache/jena/pull/406#discussion_r183630332
  
--- Diff: jena-text-es/src/main/java/examples/JenaESTextExample.java ---
@@ -73,7 +73,8 @@ public static void queryDataWithoutProperty(Dataset 
dataset)
 String qs = StrUtils.strjoinNL
 ( "SELECT * "
 //, " { ?s text:query (rdfs:comment 'this' 
'lang:en') ;"
-, " { ?s text:query ('this' 'lang:en*') ;"
+//, " { ?s text:query ('this' 'lang:en*') ;"
--- End diff --

Does the example code have to be changed?


---