[jira] [Updated] (JENA-978) jena-text: store original literals

2015-08-19 Thread Osma Suominen (JIRA)

 [ 
https://issues.apache.org/jira/browse/JENA-978?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Osma Suominen updated JENA-978:
---
Attachment: text-query.mdtext.diff

   jena-text: store original literals
 

 Key: JENA-978
 URL: https://issues.apache.org/jira/browse/JENA-978
 Project: Apache Jena
  Issue Type: Improvement
  Components: Text
Affects Versions: Jena 2.13.0
Reporter: Osma Suominen
Assignee: Osma Suominen
 Fix For: Jena 3.0.0

 Attachments: text-query.mdtext.diff


 As discussed on the dev list, this PR implements a feature where it's 
 possible to store the original literal values in the jena-text Lucene index 
 and to access them when querying the index.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Reopened] (JENA-978) jena-text: store original literals

2015-08-19 Thread Osma Suominen (JIRA)

 [ 
https://issues.apache.org/jira/browse/JENA-978?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Osma Suominen reopened JENA-978:


Apparently I need to reopen the issue to be able to attach my patch...


   jena-text: store original literals
 

 Key: JENA-978
 URL: https://issues.apache.org/jira/browse/JENA-978
 Project: Apache Jena
  Issue Type: Improvement
  Components: Text
Affects Versions: Jena 2.13.0
Reporter: Osma Suominen
Assignee: Osma Suominen
 Fix For: Jena 3.0.0


 As discussed on the dev list, this PR implements a feature where it's 
 possible to store the original literal values in the jena-text Lucene index 
 and to access them when querying the index.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-978) jena-text: store original literals

2015-08-19 Thread Osma Suominen (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-978?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14702606#comment-14702606
 ] 

Osma Suominen commented on JENA-978:


I forgot to document this earlier (was busy with family). I have now created 
documentation for this in the form of a patch for text-query.mdtext, which I 
will attach. Could this go into the production web site, since it's already in 
3.0.0?

   jena-text: store original literals
 

 Key: JENA-978
 URL: https://issues.apache.org/jira/browse/JENA-978
 Project: Apache Jena
  Issue Type: Improvement
  Components: Text
Affects Versions: Jena 2.13.0
Reporter: Osma Suominen
Assignee: Osma Suominen
 Fix For: Jena 3.0.0


 As discussed on the dev list, this PR implements a feature where it's 
 possible to store the original literal values in the jena-text Lucene index 
 and to access them when querying the index.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-1010) Wrong parsing of aggregate functions in HAVING clause

2015-08-19 Thread Ruben Navarro Piris (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-1010?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14702734#comment-14702734
 ] 

Ruben Navarro Piris commented on JENA-1010:
---

Thanks for the quick response!

Does this mean that the Op would still look like this?

{code}
(project (?c ?prop)
  (order ((desc ?c) ?prop)
(filter ( ?.0 1)
  (extend ((?c ?.0))
(group (?prop) ((?.0 (count ?o)))
  (graph ?g
(bgp (triple ?s ?prop ?o
{code}

Does '?.0' represent an alias for the count expression? And what's the meaning 
of the 'extend' function (or were can I found documentation for it)?

 Wrong parsing of aggregate functions in HAVING clause
 -

 Key: JENA-1010
 URL: https://issues.apache.org/jira/browse/JENA-1010
 Project: Apache Jena
  Issue Type: Bug
  Components: Jena
Affects Versions: Jena 2.13.0
Reporter: Ruben Navarro Piris
Assignee: Andy Seaborne
 Fix For: Jena 3.0.0


 Using an aggregate funtion (count) in the HAVING clause leads to some weird 
 parsing. The following code reproduces the problem (output also provided)
 {code:java}
 public class Test {
   public static void main(String[] args) {
 AlgebraGenerator ag = new AlgebraGenerator();
 // this query counts the number of occurrences of a property
 // showing only properties with more than one occurrence
 String q = 
 SELECT (count(?o) AS ?c) ?prop 
 + WHERE { GRAPH ?g { ?s ?prop ?o } } 
 + GROUP BY ?prop HAVING ( count(?o)  1 ) 
 + ORDER BY DESC(?c) ?prop;
 Query query = QueryFactory.create(q);
 System.out.println(query);
 Op queryOp = ag.compile(query);
 System.out.println(queryOp);
 
 Query rewritten = OpAsQuery.asQuery(queryOp);
 System.out.println(rewritten);
   }
 }
 {code}
 {code}
 SELECT  (COUNT(?o) AS ?c) ?prop
 WHERE
   { GRAPH ?g
   { ?s ?prop ?o}
   }
 GROUP BY ?prop
 HAVING ( COUNT(?o)  1 )
 ORDER BY DESC(?c) ?prop
 (project (?c ?prop)
   (order ((desc ?c) ?prop)
 (filter ( ?.0 1)
   (extend ((?c ?.0))
 (group (?prop) ((?.0 (count ?o)))
   (graph ?g
 (bgp (triple ?s ?prop ?o
 SELECT  ?c ?prop
 WHERE
   { { GRAPH ?g
 { ?s ?prop ?o}
   BIND(COUNT(?o) AS ?c)
 }
 FILTER ( ?.0  1 )
   }
 GROUP BY ?prop
 ORDER BY DESC(?c) ?prop
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-1010) Wrong parsing of aggregate functions in HAVING clause

2015-08-19 Thread Andy Seaborne (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-1010?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14702754#comment-14702754
 ] 

Andy Seaborne commented on JENA-1010:
-

{{?.0}} is an internally generated variable used to assign the value of 
{{(count ?o)}} -- this is than assigned to {{?c}} and {{?.0}} is invisible.

{{(group (?prop) ((?.0 (count ?o)))}} is calculate the group and aggregate 
count into ?.0.

There are various times internal variables are generated - they are always 
synactically illegal names to avoid clashes with any used in the query.  You 
can see {{?/x}} sometimes, even {{?//x}}.

{{(extend)}} is the algebra operator for {{BIND}}.

It is done via a temporary because 

{noformat}
SELECT (count(*) AS ?c1) (count(*) AS ?c2) {  }
{noformat}
or
{noformat}
SELECT (count(*) AS ?c1) { ... }
HAVING (count(*)  2)
{noformat}
still only calculates {{count(*)}} once.

You see {{(filter ( ?.0 1)}} because the {{HAVING}} has no {{AS}}.

 Wrong parsing of aggregate functions in HAVING clause
 -

 Key: JENA-1010
 URL: https://issues.apache.org/jira/browse/JENA-1010
 Project: Apache Jena
  Issue Type: Bug
  Components: Jena
Affects Versions: Jena 2.13.0
Reporter: Ruben Navarro Piris
Assignee: Andy Seaborne
 Fix For: Jena 3.0.0


 Using an aggregate funtion (count) in the HAVING clause leads to some weird 
 parsing. The following code reproduces the problem (output also provided)
 {code:java}
 public class Test {
   public static void main(String[] args) {
 AlgebraGenerator ag = new AlgebraGenerator();
 // this query counts the number of occurrences of a property
 // showing only properties with more than one occurrence
 String q = 
 SELECT (count(?o) AS ?c) ?prop 
 + WHERE { GRAPH ?g { ?s ?prop ?o } } 
 + GROUP BY ?prop HAVING ( count(?o)  1 ) 
 + ORDER BY DESC(?c) ?prop;
 Query query = QueryFactory.create(q);
 System.out.println(query);
 Op queryOp = ag.compile(query);
 System.out.println(queryOp);
 
 Query rewritten = OpAsQuery.asQuery(queryOp);
 System.out.println(rewritten);
   }
 }
 {code}
 {code}
 SELECT  (COUNT(?o) AS ?c) ?prop
 WHERE
   { GRAPH ?g
   { ?s ?prop ?o}
   }
 GROUP BY ?prop
 HAVING ( COUNT(?o)  1 )
 ORDER BY DESC(?c) ?prop
 (project (?c ?prop)
   (order ((desc ?c) ?prop)
 (filter ( ?.0 1)
   (extend ((?c ?.0))
 (group (?prop) ((?.0 (count ?o)))
   (graph ?g
 (bgp (triple ?s ?prop ?o
 SELECT  ?c ?prop
 WHERE
   { { GRAPH ?g
 { ?s ?prop ?o}
   BIND(COUNT(?o) AS ?c)
 }
 FILTER ( ?.0  1 )
   }
 GROUP BY ?prop
 ORDER BY DESC(?c) ?prop
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-978) jena-text: store original literals

2015-08-19 Thread Andy Seaborne (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-978?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14702699#comment-14702699
 ] 

Andy Seaborne commented on JENA-978:


Just commit the changes to the site SVN.  People can review in in place, indeed 
view it properly at jena.staging.apache.org so it's easier that way.

As for publishing the site, that's a project-wide issue not specific to this 
JIRA so I'll take that to email.

   jena-text: store original literals
 

 Key: JENA-978
 URL: https://issues.apache.org/jira/browse/JENA-978
 Project: Apache Jena
  Issue Type: Improvement
  Components: Text
Affects Versions: Jena 2.13.0
Reporter: Osma Suominen
Assignee: Osma Suominen
 Fix For: Jena 3.0.0

 Attachments: text-query.mdtext.diff


 As discussed on the dev list, this PR implements a feature where it's 
 possible to store the original literal values in the jena-text Lucene index 
 and to access them when querying the index.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-978) jena-text: store original literals

2015-08-19 Thread Osma Suominen (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-978?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14702717#comment-14702717
 ] 

Osma Suominen commented on JENA-978:


Right, committed to site SVN. Visible in staging: 
http://jena.staging.apache.org/documentation/query/text-query.html#storing-literal-values

   jena-text: store original literals
 

 Key: JENA-978
 URL: https://issues.apache.org/jira/browse/JENA-978
 Project: Apache Jena
  Issue Type: Improvement
  Components: Text
Affects Versions: Jena 2.13.0
Reporter: Osma Suominen
Assignee: Osma Suominen
 Fix For: Jena 3.0.0

 Attachments: text-query.mdtext.diff


 As discussed on the dev list, this PR implements a feature where it's 
 possible to store the original literal values in the jena-text Lucene index 
 and to access them when querying the index.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-978) jena-text: store original literals

2015-08-19 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-978?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14702715#comment-14702715
 ] 

ASF subversion and git services commented on JENA-978:
--

Commit 1696533 from o...@apache.org in branch 'site/trunk'
[ https://svn.apache.org/r1696533 ]

Add documentatin for storing original literal values (JENA-978) introduced in 
3.0.0

   jena-text: store original literals
 

 Key: JENA-978
 URL: https://issues.apache.org/jira/browse/JENA-978
 Project: Apache Jena
  Issue Type: Improvement
  Components: Text
Affects Versions: Jena 2.13.0
Reporter: Osma Suominen
Assignee: Osma Suominen
 Fix For: Jena 3.0.0

 Attachments: text-query.mdtext.diff


 As discussed on the dev list, this PR implements a feature where it's 
 possible to store the original literal values in the jena-text Lucene index 
 and to access them when querying the index.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


Publish website? Was : [jira] [Commented] (JENA-978) jena-text: store original literals

2015-08-19 Thread Andy Seaborne

Switching to email because the question is also about the whole web site.

On 19/08/15 07:55, Osma Suominen (JIRA) wrote:


I have now created documentation for this in the form of a patch for

 text-query.mdtext, which I will attach. Could this go into the
 production web site, since it's already in 3.0.0?

I don't see why not.  From what I remember, the only pending 
documentation without feature is the GSoC CONSTRUCT-quads page, and the 
link to it.  As that's nearly ready anyway, I say we can publish the 
site now - we can publish again for the editorial changes for GSoC that 
Ying requested.  Publishing the site is, as a process, lightweight.


Give it 24 hours for anyone to raise comments, then feel free to 
publish.  If you are unsure about how to do that, just ask (*)


Andy

(*) I do it by logging into people.apache.org and
typing publish.pl jena. If you view the diffs and they are large (not 
the case here - it is the case for all the javadoc), it bring up a 
less session so type q to get out.