Re: [API] Ideas

2019-11-21 Thread ajs6f
Some off-the-cuff ideas…

I'd like to catch up to Java. :grin: Here are three examples (very much off the 
top of my head, so there may some obvious reasons that we wouldn't want to do 
these) to give the flavor of what I mean, assuming we are talking about a 
really new API. I don't think anything is too unworldly, depending on our 
timescale.

• I'd like to see the introduction of Optional on a much larger scale to 
replace returning "value-or-null" in a new API. Modern JVMs in-line Optional to 
null-checks, so there is no real performance issue, and Optional (for my money) 
is no longer confusing and new, it's elegant and clear and concise.

• The Streams API has already come up. IMHO it's a no-brainer to introduce it 
alongside iterators in selected appropriate places in the SPI and a new API. 
Ideally we would even feature a few good examples of pushing computation back 
up the line.

• The Flow API (reactive streams) seems interesting in the context of SPARQL 
1.2 protocol-related discussions:

https://github.com/w3c/sparql-12/issues?utf8=%E2%9C%93=is%3Aissue+is%3Aopen+protocol

For example, if ideas like https://github.com/w3c/sparql-12/issues/7 or /84 go 
forward, we could potentially redesign RDFConnection and its underpinnings to 
use Flows. This is pretty speculative, of course, but there are other areas 
that might be interesting for this. I suspect that we could use it to do some 
level of decoupling of SPARQL execution (flows passing to each other), but that 
is well above my ability to speculate usefully on, knowing as shamefully little 
as I do about the actual paths through ARQ, and anyway, that's not API-related.

Other stuff:

I would like to look at the fairly large number of methods on classes like 
Resource and Model and see if we can corral and regularize them a bit. I'm not 
against functionality, of course, but we've built up those APIs via the "coral 
reef" model (accumulation) and so we have little oddities like:

Statement getProperty(Resource s, Property p, String lang)
and 
Property getProperty(String nameSpace, String localName)

but

Statement getRequiredProperty(Resource s, Property p)
with no
Property getRequiredProperty(String s, String p)

That's not such a horrible state of existence, but I find that the dozens and 
dozens of methods on some of our core types often get a bit hard to sort 
through, especially with little quirks like that.

We might also want to consider nomenclature. Model, for example, isn't really a 
great term to use any more for what most APIs would call a Graph. Of course, 
we've used "Graph" elsewhere. In any event, something to think about. Next.0 is 
the time to make changes like that, if we're going to make them.



ajs6f

> On Nov 21, 2019, at 12:44 PM, Andy Seaborne  wrote:
> 
> So what sort of things do people think we should look at for the main 
> application API(s).
> 
>Andy



[jira] [Resolved] (JENA-1782) Improve the informative printed form of the SHACL parse tree

2019-11-21 Thread Andy Seaborne (Jira)


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

Andy Seaborne resolved JENA-1782.
-
Resolution: Fixed

> Improve the informative printed form of the SHACL parse tree
> 
>
> Key: JENA-1782
> URL: https://issues.apache.org/jira/browse/JENA-1782
> Project: Apache Jena
>  Issue Type: Task
>  Components: SHACL
>Affects Versions: Jena 3.13.1
>Reporter: Andy Seaborne
>Assignee: Andy Seaborne
>Priority: Minor
> Fix For: Jena 3.14.0
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> Doesn't helpfully print recurively sh:or, sh:and, sh:not shapes



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Resolved] (JENA-1780) Turtle pretty printer misalignment.

2019-11-21 Thread Andy Seaborne (Jira)


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

Andy Seaborne resolved JENA-1780.
-
Fix Version/s: Jena 3.14.0
   Resolution: Fixed

> Turtle pretty printer misalignment.
> ---
>
> Key: JENA-1780
> URL: https://issues.apache.org/jira/browse/JENA-1780
> Project: Apache Jena
>  Issue Type: Task
>Reporter: Andy Seaborne
>Assignee: Andy Seaborne
>Priority: Minor
> Fix For: Jena 3.14.0
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> Prints the following:
> {noformat}
> @prefix :   .
> :s2 :p12345678  [ :q  [ :r2 "B" ] ;
>   :q  [ :r1 "A" ] ] .
> {noformat}
> The two :q should be vertically aligned.
> (The output is correct RDF)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (JENA-1780) Turtle pretty printer misalignment.

2019-11-21 Thread ASF subversion and git services (Jira)


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

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

Commit 05067fa0ae4c540b524867cf1349edc50ceb5a4e in jena's branch 
refs/heads/master from Andy Seaborne
[ https://gitbox.apache.org/repos/asf?p=jena.git;h=05067fa ]

Merge pull request #632 from afs/turtle-print

JENA-1780: Fix alignment of nested objects

> Turtle pretty printer misalignment.
> ---
>
> Key: JENA-1780
> URL: https://issues.apache.org/jira/browse/JENA-1780
> Project: Apache Jena
>  Issue Type: Task
>Reporter: Andy Seaborne
>Assignee: Andy Seaborne
>Priority: Minor
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> Prints the following:
> {noformat}
> @prefix :   .
> :s2 :p12345678  [ :q  [ :r2 "B" ] ;
>   :q  [ :r1 "A" ] ] .
> {noformat}
> The two :q should be vertically aligned.
> (The output is correct RDF)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (JENA-1782) Improve the informative printed form of the SHACL parse tree

2019-11-21 Thread ASF subversion and git services (Jira)


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

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

Commit b872793dd687f3708f73f32bc2cc27b0dc52932f in jena's branch 
refs/heads/master from Andy Seaborne
[ https://gitbox.apache.org/repos/asf?p=jena.git;h=b872793 ]

JENA-1782: Better SHACL parse tree printing


> Improve the informative printed form of the SHACL parse tree
> 
>
> Key: JENA-1782
> URL: https://issues.apache.org/jira/browse/JENA-1782
> Project: Apache Jena
>  Issue Type: Task
>  Components: SHACL
>Affects Versions: Jena 3.13.1
>Reporter: Andy Seaborne
>Assignee: Andy Seaborne
>Priority: Minor
> Fix For: Jena 3.14.0
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> Doesn't helpfully print recurively sh:or, sh:and, sh:not shapes



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (JENA-1782) Improve the informative printed form of the SHACL parse tree

2019-11-21 Thread ASF subversion and git services (Jira)


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

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

Commit 24385835aa16c218da05f8e75e48719f42510bc4 in jena's branch 
refs/heads/master from Andy Seaborne
[ https://gitbox.apache.org/repos/asf?p=jena.git;h=2438583 ]

Merge pull request #633 from afs/shacl-print

JENA-1782: Better SHACL parse tree printing

> Improve the informative printed form of the SHACL parse tree
> 
>
> Key: JENA-1782
> URL: https://issues.apache.org/jira/browse/JENA-1782
> Project: Apache Jena
>  Issue Type: Task
>  Components: SHACL
>Affects Versions: Jena 3.13.1
>Reporter: Andy Seaborne
>Assignee: Andy Seaborne
>Priority: Minor
> Fix For: Jena 3.14.0
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> Doesn't helpfully print recurively sh:or, sh:and, sh:not shapes



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (JENA-1780) Turtle pretty printer misalignment.

2019-11-21 Thread ASF subversion and git services (Jira)


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

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

Commit cf0f73446c351449439763caba7c554417d5d661 in jena's branch 
refs/heads/master from Andy Seaborne
[ https://gitbox.apache.org/repos/asf?p=jena.git;h=cf0f734 ]

JENA-1780: Fix alignment of nested objects


> Turtle pretty printer misalignment.
> ---
>
> Key: JENA-1780
> URL: https://issues.apache.org/jira/browse/JENA-1780
> Project: Apache Jena
>  Issue Type: Task
>Reporter: Andy Seaborne
>Assignee: Andy Seaborne
>Priority: Minor
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> Prints the following:
> {noformat}
> @prefix :   .
> :s2 :p12345678  [ :q  [ :r2 "B" ] ;
>   :q  [ :r1 "A" ] ] .
> {noformat}
> The two :q should be vertically aligned.
> (The output is correct RDF)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [jena] afs merged pull request #632: JENA-1780: Fix alignment of nested objects

2019-11-21 Thread GitBox
afs merged pull request #632: JENA-1780: Fix alignment of nested objects
URL: https://github.com/apache/jena/pull/632
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [jena] afs merged pull request #633: JENA-1782: Better SHACL parse tree printing

2019-11-21 Thread GitBox
afs merged pull request #633: JENA-1782: Better SHACL parse tree printing
URL: https://github.com/apache/jena/pull/633
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [jena] afs commented on issue #634: JENA-1781 update Thrift version

2019-11-21 Thread GitBox
afs commented on issue #634: JENA-1781 update Thrift version
URL: https://github.com/apache/jena/pull/634#issuecomment-557209623
 
 
   PR #635 includes this commit and workarounds needed because of a Thrift 
regression [THRIFT-5022](https://issues.apache.org/jira/browse/THRIFT-5022).
   
   Closing this - the change will get made via #635 -  thanks!


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [jena] afs closed pull request #634: JENA-1781 update Thrift version

2019-11-21 Thread GitBox
afs closed pull request #634: JENA-1781 update Thrift version
URL: https://github.com/apache/jena/pull/634
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[API] Ideas

2019-11-21 Thread Andy Seaborne
So what sort of things do people think we should look at for the main 
application API(s).


Andy


[GitHub] [jena] afs opened a new pull request #635: JENA-1781: Update for Thrift 0.13.0, including workaround for THRIFT-5022

2019-11-21 Thread GitBox
afs opened a new pull request #635: JENA-1781: Update for Thrift 0.13.0, 
including workaround for THRIFT-5022
URL: https://github.com/apache/jena/pull/635
 
 
   This include PR #634.
   
   [THRIFT-5022](https://issues.apache.org/jira/browse/THRIFT-5022).
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [jena] afs commented on issue #634: JENA-1781 update Thrift version

2019-11-21 Thread GitBox
afs commented on issue #634: JENA-1781 update Thrift version
URL: https://github.com/apache/jena/pull/634#issuecomment-556996225
 
 
   This needs a workaround to 
[THRIFT-5022](https://issues.apache.org/jira/browse/THRIFT-5022) (as per 
apache/thrift#1942).
   
   It looks like `BinRDF.apply` can work without using isOpen.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services