Re: CMS diff: ARQ - Building Queries Programmatically

2019-05-10 Thread ajs6f
Committed, thank you A. Wilke!

ajs6f

> On May 5, 2019, at 9:26 AM, A. Wilke  wrote:
> 
> Clone URL (Committers only):
> https://cms.apache.org/redirect?new=anonymous;action=diff;uri=http://jena.apache.org/documentation%2Fquery%2Fprogrammatic.mdtext
> 
> A. Wilke
> 
> Index: trunk/content/documentation/query/programmatic.mdtext
> ===
> --- trunk/content/documentation/query/programmatic.mdtext (revision 
> 1858626)
> +++ trunk/content/documentation/query/programmatic.mdtext (working copy)
> @@ -8,6 +8,10 @@
> See the examples in the ARQ `src-examples/` directory of the ARQ
> distribution, particularly `arq.examples.AlgebraExec`.
> 
> +* [src-examples at 
> gitbox.apache.org](https://gitbox.apache.org/repos/asf?p=jena.git;a=tree;f=jena-arq/src-examples)
> +* [src-examples at 
> github.com](https://github.com/apache/jena/tree/master/jena-arq/src-examples)
> +
> +
> See also [ARQ - SPARQL Algebra](algebra.html)
> 
> 
> 



[jira] [Commented] (JENA-1693) Add Aggregate Function MEDIAN To SPARQL ARQ Syntax

2019-05-10 Thread A. Soroka (JIRA)


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

A. Soroka commented on JENA-1693:
-

I'd be very happy to help you with a PR.

> Add Aggregate Function MEDIAN To SPARQL ARQ Syntax
> --
>
> Key: JENA-1693
> URL: https://issues.apache.org/jira/browse/JENA-1693
> Project: Apache Jena
>  Issue Type: New Feature
> Environment: general 
>  
>Reporter: Marco Neumann
>Priority: Minor
>  Labels: features
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> As briefly mentioned to Andy Seaborne I'd like to see the aggregate function 
> MEDIAN in the ARQ SPARQL syntax. 
> "Median is the value that separates lower half from the higher half when the 
> values are ordered in ascending or descending order. It is the middle value 
> in a given dataset. Medians are helpful in understanding the distribution of 
> data. This can be done by comparing mean and median values. By observing the 
> difference between these values we can understand whether the data is left 
> skewed or right skewed. The formula for median is: Median = ((n + 1)/2) th 
> number in the series where the numbers are ordered. Here, n denotes the 
> number of values for the given variable."
> DIVYA SPANDANA MARNEN, SPARQL-R: EXTENDED SPARQL FOR STATISTICAL COMPUTATIONS.
>  
> example
>  
> SELECT agg:median(?age) AS ?median
> WHERE
> { ?x ex:age ?age }
>  



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


[jira] [Commented] (JENA-1710) Wrong turtle serialization of RDFList with itself inside

2019-05-10 Thread Andy Seaborne (JIRA)


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

Andy Seaborne commented on JENA-1710:
-

[~szz] - thanks for the report and test case.

The indirect cycle is confusing the pretty printer. Directly including a list 
in itself is handled but the indirect, through owl:unionOf isn't handled. 
Because that is potentially an arbitrary chain of properties, it is difficult 
to see an immediate fix.

Using {{RDFData.write}} and formats {{RDFFormat.TURTLE_BLOCKS}} or 
{{RDFFormat.TURTLE_FLAT}} work - they don't do any list formatting.  

The other workaround, especially for OWL class definitions, is "don't do that!".

> Wrong turtle serialization of RDFList with itself inside
> 
>
> Key: JENA-1710
> URL: https://issues.apache.org/jira/browse/JENA-1710
> Project: Apache Jena
>  Issue Type: Bug
>  Components: Base, Jena, RIOT
>Affects Versions: Jena 3.9.0, Jena 3.10.0, Jena 3.11.0
> Environment: jena-arq-3.11.0, java8
>Reporter: ssz
>Priority: Minor
>
> Testcase:
> {quote}Model m = ModelFactory.createDefaultModel();
> Resource b0 = m.createResource();
>  Resource b1 = m.createResource();
> {color:#808080}// add 4 statements:{color}
> b0.addProperty(OWL.{color:#660e7a}unionOf{color}, 
> b1).addProperty(RDF.{color:#660e7a}type{color}, 
> OWL.{color:#660e7a}Class{color});
>  b1.addProperty(RDF.{color:#660e7a}first{color}, 
> b0).addProperty(RDF.{color:#660e7a}rest{color}, 
> RDF.{color:#660e7a}nil{color});
> m.write(System.{color:#660e7a}out{color}, {color:#008000}"ttl"{color});
> m.write(System.{color:#660e7a}out{color}, {color:#008000}"nt"{color});
> {quote}
> Output:
> {quote}_:b0    <[http://www.w3.org/1999/02/22-rdf-syntax-ns#first]>
>      _:b1 ;
>      <[http://www.w3.org/1999/02/22-rdf-syntax-ns#rest]>
>      () .
>  _:B40396d1bX2D68d6X2D40b4X2DbbcdX2Dbe185973bfc1 
> <[http://www.w3.org/1999/02/22-rdf-syntax-ns#rest]> 
> <[http://www.w3.org/1999/02/22-rdf-syntax-ns#nil]> .
>  _:B40396d1bX2D68d6X2D40b4X2DbbcdX2Dbe185973bfc1 
> <[http://www.w3.org/1999/02/22-rdf-syntax-ns#first]> 
> _:B4da6d814X2Ddb64X2D4ff1X2Da5d4X2D4f71d5718fd9 .
>  _:B4da6d814X2Ddb64X2D4ff1X2Da5d4X2D4f71d5718fd9 
> <[http://www.w3.org/1999/02/22-rdf-syntax-ns#type]> 
> <[http://www.w3.org/2002/07/owl#Class]> .
>  _:B4da6d814X2Ddb64X2D4ff1X2Da5d4X2D4f71d5718fd9 
> <[http://www.w3.org/2002/07/owl#unionOf]> 
> _:B40396d1bX2D68d6X2D40b4X2DbbcdX2Dbe185973bfc1 .
> {quote}
>  
> So in turtle there are only 2 triples, while expected 4.



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