[jira] [Created] (JENA-1350) Embedded Fuseki for testing usage

2017-05-28 Thread Andy Seaborne (JIRA)
Andy Seaborne created JENA-1350:
---

 Summary: Embedded Fuseki for testing usage
 Key: JENA-1350
 URL: https://issues.apache.org/jira/browse/JENA-1350
 Project: Apache Jena
  Issue Type: Improvement
Reporter: Andy Seaborne
Assignee: Andy Seaborne


Provide {{ServerCtl}} (see the full server and Fuseki1) for test cycle support.

Enable the possibility of security in embedded Fuseki for testing purposes.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (JENA-1349) Regression: reading from HTTP with content-type text/plain with RDFDataMgr.loadGraph()

2017-05-28 Thread Andy Seaborne (JIRA)

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

Andy Seaborne commented on JENA-1349:
-

> In 3.20, the real content-type used to be recognized from URL ending, but not 
> anymore.

What is happening is that the {{text/plain}}, the Content-type is being used as 
declared syntax.  This is technically correct but also a bit of a nuisance 
because it is the commonly used content-type for unconfigured servers. 
Previously, for the special case of {{text/plain}} only, {{RDFDataMgr}} ignored 
the {{Content-type}} because it was wrong so often wrong.

We should probably put this behaviour back.

For reference, here is an example set of {{web.xml}} settings for RDF and 
related syntaxes. Note that {{text/turtle}} has an explicit charset (the text/* 
default is not UTF-8). Includes [the RDF 
binary|http://afs.github.io/rdf-thrift/rdf-binary-thrift.html] content types as 
well.

{noformat}
  

  
rdf
application/rdf+xml
  
  
ttl
text/turtle;charset=utf-8
  
  
nt
application/n-triples
  
  
nq
application/n-quads
  
  
trig
application/trig
  
  
jsonld
application/ld+json
  

  
tr
application/rdf+thrift
  
  
trdf
application/rdf+thrift
  
  
  
rq
application/sparql-query
  
  
ru
application/sparql-update
  

  
srx
application/sparql-results+xml
  
  
srj
application/sparql-results+json
  
  
srt
application/sparql-results+thrift
  
{noformat}

> Regression: reading from HTTP with content-type text/plain with 
> RDFDataMgr.loadGraph()
> --
>
> Key: JENA-1349
> URL: https://issues.apache.org/jira/browse/JENA-1349
> Project: Apache Jena
>  Issue Type: Bug
>  Components: RIOT
>Affects Versions: Jena 3.3.0
> Environment: uname -a
> Linux jmv-SMBIOSation 4.10.0-21-generic #23-Ubuntu SMP Fri Apr 28 16:14:22 
> UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
> java -version
> java version "1.8.0_121"
> Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
> Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
>Reporter: Jean-Marc Vanel
>
> raw.githubusercontent.com sends file as text/plain ,
> and Jena 3.3.0 has a regression reading such URL:
> In 3.20, the real content-type used to be recognized from URL ending, but not 
> anymore.
>  
> How to reproduce:  
> org.apache.jena.riot.RDFDataMgr.loadGraph("https://raw.githubusercontent.com/jmvanel/rdf-i18n/master/foaf/foaf.fr.ttl";)
> Log and stack:
> contentType for  "text/plain; 
> charset=UTF-8" 
> 20:19:57.687 [main] ERROR org.apache.jena.riot - [line: 3, col: 1 ] Expected 
> BNode or IRI: Got: [DIRECTIVE:prefix]
> readStoreURINoTransaction: after 
> rdfLoader.load(http://topbraid.org/schema/schema.ttl): 
> Failure(org.apache.jena.riot.RiotException: [line: 3, col: 1 ] Expected BNode 
> or IRI: Got: [DIRECTIVE:prefix])
> org.apache.jena.riot.RiotException: [line: 3, col: 1 ] Expected BNode or IRI: 
> Got: [DIRECTIVE:prefix]
>   at 
> org.apache.jena.riot.system.ErrorHandlerFactory$ErrorHandlerStd.fatal(ErrorHandlerFactory.java:136)
>   at 
> org.apache.jena.riot.lang.LangEngine.raiseException(LangEngine.java:148)
>   at 
> org.apache.jena.riot.lang.LangEngine.exceptionDirect(LangEngine.java:143)
>   at org.apache.jena.riot.lang.LangEngine.exception(LangEngine.java:137)
>   at 
> org.apache.jena.riot.lang.LangNTuple.checkIRIOrBNode(LangNTuple.java:89)
>   at org.apache.jena.riot.lang.LangNTriples.parseOne(LangNTriples.java:74)
>   at 
> org.apache.jena.riot.lang.LangNTriples.runParser(LangNTriples.java:53)
>   at org.apache.jena.riot.lang.LangBase.parse(LangBase.java:41)
>   at 
> org.apache.jena.riot.RDFParserRegistry$ReaderRIOTLang.read(RDFParserRegistry.java:194)
>   at org.apache.jena.riot.RDFParser.read(RDFParser.java:293)
>   at org.apache.jena.riot.RDFParser.parseNotUri(RDFParser.java:283)
>   at org.apache.jena.riot.RDFParser.parse(RDFParser.java:233)
>   at 
> org.apache.jena.riot.RDFParserBuilder.parse(RDFParserBuilder.java:405)
>   at org.apache.jena.riot.RDFDataMgr.process(RDFDataMgr.java:862)
>   at org.apache.jena.riot.RDFDataMgr.parse(RDFDataMgr.java:676)
>   at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:222)
>   at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:103)
>   at org.apache.jena.riot.RDFDataMgr.loadGraph(RDFDataMgr.java:354)
>   at 
> org.w3.banana.jena.io.JenaRDFReader$$anon$2$$anonfun$load$1.apply(JenaRDFReader.scala:76)



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Created] (JENA-1351) QueryBuilder does not support DescribeQuery

2017-05-28 Thread Claude Warren (JIRA)
Claude Warren created JENA-1351:
---

 Summary: QueryBuilder does not support DescribeQuery
 Key: JENA-1351
 URL: https://issues.apache.org/jira/browse/JENA-1351
 Project: Apache Jena
  Issue Type: Bug
  Components: QueryBuilder
Affects Versions: Jena 3.3.0
Reporter: Claude Warren
Assignee: Claude Warren


QueryBuilder module does not have an option to produce Describe queries.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (JENA-1351) QueryBuilder does not support DescribeQuery

2017-05-28 Thread ASF subversion and git services (JIRA)

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

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

Commit 4b1f560836cf8b5e30da3dcdad970389ab4c8c1f in jena's branch 
refs/heads/master from [~cla...@xenei.org]
[ https://git-wip-us.apache.org/repos/asf?p=jena.git;h=4b1f560 ]

fix for JENA-1351 : initial implementation of DescribeBilder

Includes tests and fixes to some existing tests to adjust for
realignment of internal classes.

> QueryBuilder does not support DescribeQuery
> ---
>
> Key: JENA-1351
> URL: https://issues.apache.org/jira/browse/JENA-1351
> Project: Apache Jena
>  Issue Type: Bug
>  Components: QueryBuilder
>Affects Versions: Jena 3.3.0
>Reporter: Claude Warren
>Assignee: Claude Warren
>
> QueryBuilder module does not have an option to produce Describe queries.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (JENA-1351) QueryBuilder does not support DescribeQuery

2017-05-28 Thread ASF subversion and git services (JIRA)

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

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

Commit c5786f8114bc322ab32de8ed934b53ccc34c53c7 in jena's branch 
refs/heads/master from [~cla...@xenei.org]
[ https://git-wip-us.apache.org/repos/asf?p=jena.git;h=c5786f8 ]

fix for JENA-1351 : initial implementation of DescribeBilder

added AF license header

> QueryBuilder does not support DescribeQuery
> ---
>
> Key: JENA-1351
> URL: https://issues.apache.org/jira/browse/JENA-1351
> Project: Apache Jena
>  Issue Type: Bug
>  Components: QueryBuilder
>Affects Versions: Jena 3.3.0
>Reporter: Claude Warren
>Assignee: Claude Warren
>
> QueryBuilder module does not have an option to produce Describe queries.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Resolved] (JENA-1351) QueryBuilder does not support DescribeQuery

2017-05-28 Thread Claude Warren (JIRA)

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

Claude Warren resolved JENA-1351.
-
   Resolution: Fixed
Fix Version/s: Jena 3.4.0

added DescribeBuilder class and test code

> QueryBuilder does not support DescribeQuery
> ---
>
> Key: JENA-1351
> URL: https://issues.apache.org/jira/browse/JENA-1351
> Project: Apache Jena
>  Issue Type: Bug
>  Components: QueryBuilder
>Affects Versions: Jena 3.3.0
>Reporter: Claude Warren
>Assignee: Claude Warren
> Fix For: Jena 3.4.0
>
>
> QueryBuilder module does not have an option to produce Describe queries.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Assigned] (JENA-1349) Regression: reading from HTTP with content-type text/plain with RDFDataMgr.loadGraph()

2017-05-28 Thread Andy Seaborne (JIRA)

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

Andy Seaborne reassigned JENA-1349:
---

Assignee: Andy Seaborne

> Regression: reading from HTTP with content-type text/plain with 
> RDFDataMgr.loadGraph()
> --
>
> Key: JENA-1349
> URL: https://issues.apache.org/jira/browse/JENA-1349
> Project: Apache Jena
>  Issue Type: Bug
>  Components: RIOT
>Affects Versions: Jena 3.3.0
> Environment: uname -a
> Linux jmv-SMBIOSation 4.10.0-21-generic #23-Ubuntu SMP Fri Apr 28 16:14:22 
> UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
> java -version
> java version "1.8.0_121"
> Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
> Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
>Reporter: Jean-Marc Vanel
>Assignee: Andy Seaborne
>
> raw.githubusercontent.com sends file as text/plain ,
> and Jena 3.3.0 has a regression reading such URL:
> In 3.20, the real content-type used to be recognized from URL ending, but not 
> anymore.
>  
> How to reproduce:  
> org.apache.jena.riot.RDFDataMgr.loadGraph("https://raw.githubusercontent.com/jmvanel/rdf-i18n/master/foaf/foaf.fr.ttl";)
> Log and stack:
> contentType for  "text/plain; 
> charset=UTF-8" 
> 20:19:57.687 [main] ERROR org.apache.jena.riot - [line: 3, col: 1 ] Expected 
> BNode or IRI: Got: [DIRECTIVE:prefix]
> readStoreURINoTransaction: after 
> rdfLoader.load(http://topbraid.org/schema/schema.ttl): 
> Failure(org.apache.jena.riot.RiotException: [line: 3, col: 1 ] Expected BNode 
> or IRI: Got: [DIRECTIVE:prefix])
> org.apache.jena.riot.RiotException: [line: 3, col: 1 ] Expected BNode or IRI: 
> Got: [DIRECTIVE:prefix]
>   at 
> org.apache.jena.riot.system.ErrorHandlerFactory$ErrorHandlerStd.fatal(ErrorHandlerFactory.java:136)
>   at 
> org.apache.jena.riot.lang.LangEngine.raiseException(LangEngine.java:148)
>   at 
> org.apache.jena.riot.lang.LangEngine.exceptionDirect(LangEngine.java:143)
>   at org.apache.jena.riot.lang.LangEngine.exception(LangEngine.java:137)
>   at 
> org.apache.jena.riot.lang.LangNTuple.checkIRIOrBNode(LangNTuple.java:89)
>   at org.apache.jena.riot.lang.LangNTriples.parseOne(LangNTriples.java:74)
>   at 
> org.apache.jena.riot.lang.LangNTriples.runParser(LangNTriples.java:53)
>   at org.apache.jena.riot.lang.LangBase.parse(LangBase.java:41)
>   at 
> org.apache.jena.riot.RDFParserRegistry$ReaderRIOTLang.read(RDFParserRegistry.java:194)
>   at org.apache.jena.riot.RDFParser.read(RDFParser.java:293)
>   at org.apache.jena.riot.RDFParser.parseNotUri(RDFParser.java:283)
>   at org.apache.jena.riot.RDFParser.parse(RDFParser.java:233)
>   at 
> org.apache.jena.riot.RDFParserBuilder.parse(RDFParserBuilder.java:405)
>   at org.apache.jena.riot.RDFDataMgr.process(RDFDataMgr.java:862)
>   at org.apache.jena.riot.RDFDataMgr.parse(RDFDataMgr.java:676)
>   at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:222)
>   at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:103)
>   at org.apache.jena.riot.RDFDataMgr.loadGraph(RDFDataMgr.java:354)
>   at 
> org.w3.banana.jena.io.JenaRDFReader$$anon$2$$anonfun$load$1.apply(JenaRDFReader.scala:76)



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Updated] (JENA-1348) E_DynamicFunction 2-arg constructor fails

2017-05-28 Thread Andy Seaborne (JIRA)

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

Andy Seaborne updated JENA-1348:

Summary: E_DynamicFunction 2-arg constructor fails  (was: E_DyncmicFunction 
2-arg constructor fails)

> E_DynamicFunction 2-arg constructor fails
> -
>
> Key: JENA-1348
> URL: https://issues.apache.org/jira/browse/JENA-1348
> Project: Apache Jena
>  Issue Type: Bug
>  Components: ARQ
>Affects Versions: Jena 3.3.0
>Reporter: Claude Warren
>Assignee: Claude Warren
> Fix For: Jena 3.4.0
>
>
> new E_FunctionDynamic(Expr function, ExprList args) fails with 
> UnsupportedOperationException.
> The issue is that ExprList.getList() returns an immutable list.
> constructor should call ExprList.getRawList()



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Created] (JENA-1352) QueryBuilder should provide UpdateBuilder

2017-05-28 Thread Claude Warren (JIRA)
Claude Warren created JENA-1352:
---

 Summary: QueryBuilder should provide UpdateBuilder
 Key: JENA-1352
 URL: https://issues.apache.org/jira/browse/JENA-1352
 Project: Apache Jena
  Issue Type: Improvement
  Components: QueryBuilder
Affects Versions: Jena 3.3.0
Reporter: Claude Warren
Assignee: Claude Warren
Priority: Minor


The QueryBuilder module should include an UpdateRequestBuilder that would apply 
the same sort of functionality to creating UpdateRequests.

The QueryBuilder framework will not work but should be extended to add support 
for UpdateRequest while providing the same Object based API style.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] jena pull request #255: JENA-1350: Use Fuseki embedded server for testing

2017-05-28 Thread afs
GitHub user afs opened a pull request:

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

JENA-1350: Use Fuseki embedded server for testing



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

$ git pull https://github.com/afs/jena fuseki-for-testing

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

https://github.com/apache/jena/pull/255.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 #255


commit 92931cfffb9f221f3f7183f666d6b63a2149de6f
Author: Andy Seaborne 
Date:   2017-05-28T08:51:38Z

Update the MIME types for RDF related syntaxes and file extensions.

commit 0a71419eca5e6a1045a811b01b3f0be9a8123e03
Author: Andy Seaborne 
Date:   2017-05-28T17:16:19Z

Update RAT plugin to 0.12

commit a363223b270fb104896e9a2875141dfa12960488
Author: Andy Seaborne 
Date:   2017-05-28T17:19:31Z

JENA-1350: Use embedded Fuseki for testing




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (JENA-1350) Embedded Fuseki for testing usage

2017-05-28 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-1350:
--

GitHub user afs opened a pull request:

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

JENA-1350: Use Fuseki embedded server for testing



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

$ git pull https://github.com/afs/jena fuseki-for-testing

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

https://github.com/apache/jena/pull/255.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 #255


commit 92931cfffb9f221f3f7183f666d6b63a2149de6f
Author: Andy Seaborne 
Date:   2017-05-28T08:51:38Z

Update the MIME types for RDF related syntaxes and file extensions.

commit 0a71419eca5e6a1045a811b01b3f0be9a8123e03
Author: Andy Seaborne 
Date:   2017-05-28T17:16:19Z

Update RAT plugin to 0.12

commit a363223b270fb104896e9a2875141dfa12960488
Author: Andy Seaborne 
Date:   2017-05-28T17:19:31Z

JENA-1350: Use embedded Fuseki for testing




> Embedded Fuseki for testing usage
> -
>
> Key: JENA-1350
> URL: https://issues.apache.org/jira/browse/JENA-1350
> Project: Apache Jena
>  Issue Type: Improvement
>Reporter: Andy Seaborne
>Assignee: Andy Seaborne
>
> Provide {{ServerCtl}} (see the full server and Fuseki1) for test cycle 
> support.
> Enable the possibility of security in embedded Fuseki for testing purposes.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] jena pull request #256: JENA-1349: Use RDFParser for conneg.

2017-05-28 Thread afs
GitHub user afs opened a pull request:

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

JENA-1349: Use RDFParser for conneg.

RDFDataMgr was duplicating the functionality of RDFParser but was not 
making the same decisions. Use RDFParser execlusively by creating 3 paths in 
RDFDataMgr, one each for the three cases of reading from a URI, from an 
InputStream and from a Reader.

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

$ git pull https://github.com/afs/jena jena1349-parse

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

https://github.com/apache/jena/pull/256.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 #256


commit 6853d8247d4d16f499c45d0de081d408d10d3ced
Author: Andy Seaborne 
Date:   2017-05-28T18:48:16Z

JENA-1349: Replace RDFDataMgr use of TypedInputStream with RDFParser

Use 3 code paths for URI, InputStream, Reader
Deprecate use of TypedInputStream in RDFDataMgr;
early opening of the stream requries duplicate conneg determination.

commit 931a437bb49fecdb1cb70a5e6225e27141dec86c
Author: Andy Seaborne 
Date:   2017-05-28T18:49:13Z

Replace calls to deprecated RDFDataMgr.parse operations.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (JENA-1349) Regression: reading from HTTP with content-type text/plain with RDFDataMgr.loadGraph()

2017-05-28 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-1349:
--

GitHub user afs opened a pull request:

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

JENA-1349: Use RDFParser for conneg.

RDFDataMgr was duplicating the functionality of RDFParser but was not 
making the same decisions. Use RDFParser execlusively by creating 3 paths in 
RDFDataMgr, one each for the three cases of reading from a URI, from an 
InputStream and from a Reader.

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

$ git pull https://github.com/afs/jena jena1349-parse

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

https://github.com/apache/jena/pull/256.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 #256


commit 6853d8247d4d16f499c45d0de081d408d10d3ced
Author: Andy Seaborne 
Date:   2017-05-28T18:48:16Z

JENA-1349: Replace RDFDataMgr use of TypedInputStream with RDFParser

Use 3 code paths for URI, InputStream, Reader
Deprecate use of TypedInputStream in RDFDataMgr;
early opening of the stream requries duplicate conneg determination.

commit 931a437bb49fecdb1cb70a5e6225e27141dec86c
Author: Andy Seaborne 
Date:   2017-05-28T18:49:13Z

Replace calls to deprecated RDFDataMgr.parse operations.




> Regression: reading from HTTP with content-type text/plain with 
> RDFDataMgr.loadGraph()
> --
>
> Key: JENA-1349
> URL: https://issues.apache.org/jira/browse/JENA-1349
> Project: Apache Jena
>  Issue Type: Bug
>  Components: RIOT
>Affects Versions: Jena 3.3.0
> Environment: uname -a
> Linux jmv-SMBIOSation 4.10.0-21-generic #23-Ubuntu SMP Fri Apr 28 16:14:22 
> UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
> java -version
> java version "1.8.0_121"
> Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
> Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
>Reporter: Jean-Marc Vanel
>Assignee: Andy Seaborne
>
> raw.githubusercontent.com sends file as text/plain ,
> and Jena 3.3.0 has a regression reading such URL:
> In 3.20, the real content-type used to be recognized from URL ending, but not 
> anymore.
>  
> How to reproduce:  
> org.apache.jena.riot.RDFDataMgr.loadGraph("https://raw.githubusercontent.com/jmvanel/rdf-i18n/master/foaf/foaf.fr.ttl";)
> Log and stack:
> contentType for  "text/plain; 
> charset=UTF-8" 
> 20:19:57.687 [main] ERROR org.apache.jena.riot - [line: 3, col: 1 ] Expected 
> BNode or IRI: Got: [DIRECTIVE:prefix]
> readStoreURINoTransaction: after 
> rdfLoader.load(http://topbraid.org/schema/schema.ttl): 
> Failure(org.apache.jena.riot.RiotException: [line: 3, col: 1 ] Expected BNode 
> or IRI: Got: [DIRECTIVE:prefix])
> org.apache.jena.riot.RiotException: [line: 3, col: 1 ] Expected BNode or IRI: 
> Got: [DIRECTIVE:prefix]
>   at 
> org.apache.jena.riot.system.ErrorHandlerFactory$ErrorHandlerStd.fatal(ErrorHandlerFactory.java:136)
>   at 
> org.apache.jena.riot.lang.LangEngine.raiseException(LangEngine.java:148)
>   at 
> org.apache.jena.riot.lang.LangEngine.exceptionDirect(LangEngine.java:143)
>   at org.apache.jena.riot.lang.LangEngine.exception(LangEngine.java:137)
>   at 
> org.apache.jena.riot.lang.LangNTuple.checkIRIOrBNode(LangNTuple.java:89)
>   at org.apache.jena.riot.lang.LangNTriples.parseOne(LangNTriples.java:74)
>   at 
> org.apache.jena.riot.lang.LangNTriples.runParser(LangNTriples.java:53)
>   at org.apache.jena.riot.lang.LangBase.parse(LangBase.java:41)
>   at 
> org.apache.jena.riot.RDFParserRegistry$ReaderRIOTLang.read(RDFParserRegistry.java:194)
>   at org.apache.jena.riot.RDFParser.read(RDFParser.java:293)
>   at org.apache.jena.riot.RDFParser.parseNotUri(RDFParser.java:283)
>   at org.apache.jena.riot.RDFParser.parse(RDFParser.java:233)
>   at 
> org.apache.jena.riot.RDFParserBuilder.parse(RDFParserBuilder.java:405)
>   at org.apache.jena.riot.RDFDataMgr.process(RDFDataMgr.java:862)
>   at org.apache.jena.riot.RDFDataMgr.parse(RDFDataMgr.java:676)
>   at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:222)
>   at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:103)
>   at org.apache.jena.riot.RDFDataMgr.loadGraph(RDFDataMgr.java:354)
>   at 
> org.w3.banana.jena.io.JenaRDFReader$$anon$2$$anonfun$load$1.apply(JenaRDFReader.scala:76)



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (JENA-1350) Embedded Fuseki for testing usage

2017-05-28 Thread Andy Seaborne (JIRA)

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

Andy Seaborne commented on JENA-1350:
-

{{ServerCtl}} becomes {{FusekiTestServer}}.  In fact, with embedded Fuseki, it 
is quite simple to just run the server, beforeClass/afterClass and not need a 
test harness.  The dataset in the server can be manipulated from the tests.

{noformat}
private static FusekiEmbeddedServer server ;
private static DatasetGraph serverdsg = DatasetGraphFactory.createTxnMem() ;

@BeforeClass
public static void beforeClass() {
server = FusekiEmbeddedServer.create()
.setPort()
.add("/ds", serverdsg)
.build()
.start();
}

@Before
public void beforeTest() {
// Clear up data in server servers
Txn.executeWrite(serverdsg, ()->serverdsg.clear()) ;
}

@AfterClass
public static void afterClass() {
server.stop(); 
}
{noformat}

> Embedded Fuseki for testing usage
> -
>
> Key: JENA-1350
> URL: https://issues.apache.org/jira/browse/JENA-1350
> Project: Apache Jena
>  Issue Type: Improvement
>Reporter: Andy Seaborne
>Assignee: Andy Seaborne
>
> Provide {{ServerCtl}} (see the full server and Fuseki1) for test cycle 
> support.
> Enable the possibility of security in embedded Fuseki for testing purposes.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] jena pull request #255: JENA-1350: Use Fuseki embedded server for testing

2017-05-28 Thread ajs6f
Github user ajs6f commented on a diff in the pull request:

https://github.com/apache/jena/pull/255#discussion_r118848106
  
--- Diff: 
jena-fuseki2/jena-fuseki-embedded/src/test/java/org/apache/jena/fuseki/embedded/FusekiTestAuth.java
 ---
@@ -0,0 +1,182 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.fuseki.embedded;
+
+import static org.apache.jena.fuseki.server.FusekiEnv.choosePort;
+
+import java.util.Objects;
+
+import org.apache.jena.atlas.web.HttpException;
+import org.apache.jena.fuseki.FusekiException;
+import org.apache.jena.sparql.core.DatasetGraph ;
+import org.apache.jena.sparql.core.DatasetGraphFactory;
+import org.apache.jena.web.HttpSC;
+import org.eclipse.jetty.security.*;
+import org.eclipse.jetty.security.authentication.BasicAuthenticator;
+import org.eclipse.jetty.util.security.Constraint;
+import org.eclipse.jetty.util.security.Credential;
+import org.eclipse.jetty.util.security.Password;
+import org.junit.Assert;
+
+/**
+ * Testing HTTP athentication.
+ * 
+ * {@code FusekiAuth} provides helper code for before/after (any of 
suite/class/test).
+ * The pattern of usage is:
+ * 
+ * 
+ * @BeforeClass
+ * public static void beforeClassAuth() {
+ * SecurityHandler sh = FusekiAuth.makeSimpleSecurityHandler("/*", 
"USER", "PASSWORD");
+ * FusekiAuth.setupServer(true, sh);
+ * }
+ * 
+ * @AfterClass
+ * public static void afterClassAuth() {
+ * FusekiAuth.teardownServer();
+ * // Clear up any pooled connections.
+ * HttpOp.setDefaultHttpClient(HttpOp.createPoolingHttpClient());
+ * }
+ * 
+ * @Test
+ * public void myAuthTest() {
+ * BasicCredentialsProvider credsProvider = new 
BasicCredentialsProvider();
+ * Credentials credentials = new UsernamePasswordCredentials("USER", 
"PASSWORD");
+ * credsProvider.setCredentials(AuthScope.ANY, credentials);
+ * HttpClient client = 
HttpClients.custom().setDefaultCredentialsProvider(credsProvider).build();
+ * try (TypedInputStream in = 
HttpOp.execHttpGet(ServerCtl.urlDataset(), "* /*", client, null)) {}
+ * }
+ * 
+ * @Test
+ * public void myAuthTestRejected() {
+ * BasicCredentialsProvider credsProvider = new 
BasicCredentialsProvider();
+ * Credentials credentials = new UsernamePasswordCredentials("USER", 
"PASSWORD");
+ * credsProvider.setCredentials(AuthScope.ANY, credentials);
+ * HttpClient client = 
HttpClients.custom().setDefaultCredentialsProvider(credsProvider).build();
+ * try (TypedInputStream in = 
HttpOp.execHttpGet(ServerCtl.urlDataset(), "* /*", client, null)) {}
+ * catch (HttpException ex) {
+ * throw assertAuthHttpException(ex);
+ * }
+ * }
+ * 
+ * 
+ * {@code @BeforeClass} can be {@code @Before} but server stop-start is 
expensive so a
+ * large test suite may end up quite slow.
+ */
+public class FusekiTestAuth {
+private static int currentPort = choosePort() ;
+
+public static int port() {
+return currentPort ;
+}
+
+static boolean CLEAR_DSG_DIRECTLY = true ;
+static private DatasetGraph dsgTesting ;
+
+// Abstraction that runs a SPARQL server for tests.
+public static final String urlRoot(){ return 
"http://localhost:"+port()+"/" ; }
+public static final String datasetPath(){ return "/dataset" ; }
+public static final String urlDataset() { return 
"http://localhost:"+port()+datasetPath() ; }
+public static final DatasetGraph getDataset()   { return dsgTesting ; }
+
+public static final String serviceUpdate()  { return 
"http://localhost:"+port()+datasetPath()+"/update" ; } 
+public static final String serviceQuery()   { return 
"http://localhost:"+port()+datasetPath()+"/query" ; }
+public static final String serviceGSP() { return 
"http:/

[jira] [Commented] (JENA-1350) Embedded Fuseki for testing usage

2017-05-28 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-1350:
--

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

https://github.com/apache/jena/pull/255#discussion_r118848106
  
--- Diff: 
jena-fuseki2/jena-fuseki-embedded/src/test/java/org/apache/jena/fuseki/embedded/FusekiTestAuth.java
 ---
@@ -0,0 +1,182 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.fuseki.embedded;
+
+import static org.apache.jena.fuseki.server.FusekiEnv.choosePort;
+
+import java.util.Objects;
+
+import org.apache.jena.atlas.web.HttpException;
+import org.apache.jena.fuseki.FusekiException;
+import org.apache.jena.sparql.core.DatasetGraph ;
+import org.apache.jena.sparql.core.DatasetGraphFactory;
+import org.apache.jena.web.HttpSC;
+import org.eclipse.jetty.security.*;
+import org.eclipse.jetty.security.authentication.BasicAuthenticator;
+import org.eclipse.jetty.util.security.Constraint;
+import org.eclipse.jetty.util.security.Credential;
+import org.eclipse.jetty.util.security.Password;
+import org.junit.Assert;
+
+/**
+ * Testing HTTP athentication.
+ * 
+ * {@code FusekiAuth} provides helper code for before/after (any of 
suite/class/test).
+ * The pattern of usage is:
+ * 
+ * 
+ * @BeforeClass
+ * public static void beforeClassAuth() {
+ * SecurityHandler sh = FusekiAuth.makeSimpleSecurityHandler("/*", 
"USER", "PASSWORD");
+ * FusekiAuth.setupServer(true, sh);
+ * }
+ * 
+ * @AfterClass
+ * public static void afterClassAuth() {
+ * FusekiAuth.teardownServer();
+ * // Clear up any pooled connections.
+ * HttpOp.setDefaultHttpClient(HttpOp.createPoolingHttpClient());
+ * }
+ * 
+ * @Test
+ * public void myAuthTest() {
+ * BasicCredentialsProvider credsProvider = new 
BasicCredentialsProvider();
+ * Credentials credentials = new UsernamePasswordCredentials("USER", 
"PASSWORD");
+ * credsProvider.setCredentials(AuthScope.ANY, credentials);
+ * HttpClient client = 
HttpClients.custom().setDefaultCredentialsProvider(credsProvider).build();
+ * try (TypedInputStream in = 
HttpOp.execHttpGet(ServerCtl.urlDataset(), "* /*", client, null)) {}
+ * }
+ * 
+ * @Test
+ * public void myAuthTestRejected() {
+ * BasicCredentialsProvider credsProvider = new 
BasicCredentialsProvider();
+ * Credentials credentials = new UsernamePasswordCredentials("USER", 
"PASSWORD");
+ * credsProvider.setCredentials(AuthScope.ANY, credentials);
+ * HttpClient client = 
HttpClients.custom().setDefaultCredentialsProvider(credsProvider).build();
+ * try (TypedInputStream in = 
HttpOp.execHttpGet(ServerCtl.urlDataset(), "* /*", client, null)) {}
+ * catch (HttpException ex) {
+ * throw assertAuthHttpException(ex);
+ * }
+ * }
+ * 
+ * 
+ * {@code @BeforeClass} can be {@code @Before} but server stop-start is 
expensive so a
+ * large test suite may end up quite slow.
+ */
+public class FusekiTestAuth {
+private static int currentPort = choosePort() ;
+
+public static int port() {
+return currentPort ;
+}
+
+static boolean CLEAR_DSG_DIRECTLY = true ;
+static private DatasetGraph dsgTesting ;
+
+// Abstraction that runs a SPARQL server for tests.
+public static final String urlRoot(){ return 
"http://localhost:"+port()+"/" ; }
+public static final String datasetPath(){ return "/dataset" ; }
+public static final String urlDataset() { return 
"http://localhost:"+port()+datasetPath() ; }
+public static final DatasetGraph getDataset()   { return dsgTesting ; }
+
+public static final String serviceUpdate()  { return

[GitHub] jena pull request #255: JENA-1350: Use Fuseki embedded server for testing

2017-05-28 Thread afs
Github user afs commented on a diff in the pull request:

https://github.com/apache/jena/pull/255#discussion_r118848329
  
--- Diff: 
jena-fuseki2/jena-fuseki-embedded/src/test/java/org/apache/jena/fuseki/embedded/FusekiTestAuth.java
 ---
@@ -0,0 +1,182 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.fuseki.embedded;
+
+import static org.apache.jena.fuseki.server.FusekiEnv.choosePort;
+
+import java.util.Objects;
+
+import org.apache.jena.atlas.web.HttpException;
+import org.apache.jena.fuseki.FusekiException;
+import org.apache.jena.sparql.core.DatasetGraph ;
+import org.apache.jena.sparql.core.DatasetGraphFactory;
+import org.apache.jena.web.HttpSC;
+import org.eclipse.jetty.security.*;
+import org.eclipse.jetty.security.authentication.BasicAuthenticator;
+import org.eclipse.jetty.util.security.Constraint;
+import org.eclipse.jetty.util.security.Credential;
+import org.eclipse.jetty.util.security.Password;
+import org.junit.Assert;
+
+/**
+ * Testing HTTP athentication.
+ * 
+ * {@code FusekiAuth} provides helper code for before/after (any of 
suite/class/test).
+ * The pattern of usage is:
+ * 
+ * 
+ * @BeforeClass
+ * public static void beforeClassAuth() {
+ * SecurityHandler sh = FusekiAuth.makeSimpleSecurityHandler("/*", 
"USER", "PASSWORD");
+ * FusekiAuth.setupServer(true, sh);
+ * }
+ * 
+ * @AfterClass
+ * public static void afterClassAuth() {
+ * FusekiAuth.teardownServer();
+ * // Clear up any pooled connections.
+ * HttpOp.setDefaultHttpClient(HttpOp.createPoolingHttpClient());
+ * }
+ * 
+ * @Test
+ * public void myAuthTest() {
+ * BasicCredentialsProvider credsProvider = new 
BasicCredentialsProvider();
+ * Credentials credentials = new UsernamePasswordCredentials("USER", 
"PASSWORD");
+ * credsProvider.setCredentials(AuthScope.ANY, credentials);
+ * HttpClient client = 
HttpClients.custom().setDefaultCredentialsProvider(credsProvider).build();
+ * try (TypedInputStream in = 
HttpOp.execHttpGet(ServerCtl.urlDataset(), "* /*", client, null)) {}
+ * }
+ * 
+ * @Test
+ * public void myAuthTestRejected() {
+ * BasicCredentialsProvider credsProvider = new 
BasicCredentialsProvider();
+ * Credentials credentials = new UsernamePasswordCredentials("USER", 
"PASSWORD");
+ * credsProvider.setCredentials(AuthScope.ANY, credentials);
+ * HttpClient client = 
HttpClients.custom().setDefaultCredentialsProvider(credsProvider).build();
+ * try (TypedInputStream in = 
HttpOp.execHttpGet(ServerCtl.urlDataset(), "* /*", client, null)) {}
+ * catch (HttpException ex) {
+ * throw assertAuthHttpException(ex);
+ * }
+ * }
+ * 
+ * 
+ * {@code @BeforeClass} can be {@code @Before} but server stop-start is 
expensive so a
+ * large test suite may end up quite slow.
+ */
+public class FusekiTestAuth {
+private static int currentPort = choosePort() ;
+
+public static int port() {
+return currentPort ;
+}
+
+static boolean CLEAR_DSG_DIRECTLY = true ;
+static private DatasetGraph dsgTesting ;
+
+// Abstraction that runs a SPARQL server for tests.
+public static final String urlRoot(){ return 
"http://localhost:"+port()+"/" ; }
+public static final String datasetPath(){ return "/dataset" ; }
+public static final String urlDataset() { return 
"http://localhost:"+port()+datasetPath() ; }
+public static final DatasetGraph getDataset()   { return dsgTesting ; }
+
+public static final String serviceUpdate()  { return 
"http://localhost:"+port()+datasetPath()+"/update" ; } 
+public static final String serviceQuery()   { return 
"http://localhost:"+port()+datasetPath()+"/query" ; }
+public static final String serviceGSP() { return 
"http://l

[jira] [Commented] (JENA-1350) Embedded Fuseki for testing usage

2017-05-28 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-1350:
--

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

https://github.com/apache/jena/pull/255#discussion_r118848329
  
--- Diff: 
jena-fuseki2/jena-fuseki-embedded/src/test/java/org/apache/jena/fuseki/embedded/FusekiTestAuth.java
 ---
@@ -0,0 +1,182 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.fuseki.embedded;
+
+import static org.apache.jena.fuseki.server.FusekiEnv.choosePort;
+
+import java.util.Objects;
+
+import org.apache.jena.atlas.web.HttpException;
+import org.apache.jena.fuseki.FusekiException;
+import org.apache.jena.sparql.core.DatasetGraph ;
+import org.apache.jena.sparql.core.DatasetGraphFactory;
+import org.apache.jena.web.HttpSC;
+import org.eclipse.jetty.security.*;
+import org.eclipse.jetty.security.authentication.BasicAuthenticator;
+import org.eclipse.jetty.util.security.Constraint;
+import org.eclipse.jetty.util.security.Credential;
+import org.eclipse.jetty.util.security.Password;
+import org.junit.Assert;
+
+/**
+ * Testing HTTP athentication.
+ * 
+ * {@code FusekiAuth} provides helper code for before/after (any of 
suite/class/test).
+ * The pattern of usage is:
+ * 
+ * 
+ * @BeforeClass
+ * public static void beforeClassAuth() {
+ * SecurityHandler sh = FusekiAuth.makeSimpleSecurityHandler("/*", 
"USER", "PASSWORD");
+ * FusekiAuth.setupServer(true, sh);
+ * }
+ * 
+ * @AfterClass
+ * public static void afterClassAuth() {
+ * FusekiAuth.teardownServer();
+ * // Clear up any pooled connections.
+ * HttpOp.setDefaultHttpClient(HttpOp.createPoolingHttpClient());
+ * }
+ * 
+ * @Test
+ * public void myAuthTest() {
+ * BasicCredentialsProvider credsProvider = new 
BasicCredentialsProvider();
+ * Credentials credentials = new UsernamePasswordCredentials("USER", 
"PASSWORD");
+ * credsProvider.setCredentials(AuthScope.ANY, credentials);
+ * HttpClient client = 
HttpClients.custom().setDefaultCredentialsProvider(credsProvider).build();
+ * try (TypedInputStream in = 
HttpOp.execHttpGet(ServerCtl.urlDataset(), "* /*", client, null)) {}
+ * }
+ * 
+ * @Test
+ * public void myAuthTestRejected() {
+ * BasicCredentialsProvider credsProvider = new 
BasicCredentialsProvider();
+ * Credentials credentials = new UsernamePasswordCredentials("USER", 
"PASSWORD");
+ * credsProvider.setCredentials(AuthScope.ANY, credentials);
+ * HttpClient client = 
HttpClients.custom().setDefaultCredentialsProvider(credsProvider).build();
+ * try (TypedInputStream in = 
HttpOp.execHttpGet(ServerCtl.urlDataset(), "* /*", client, null)) {}
+ * catch (HttpException ex) {
+ * throw assertAuthHttpException(ex);
+ * }
+ * }
+ * 
+ * 
+ * {@code @BeforeClass} can be {@code @Before} but server stop-start is 
expensive so a
+ * large test suite may end up quite slow.
+ */
+public class FusekiTestAuth {
+private static int currentPort = choosePort() ;
+
+public static int port() {
+return currentPort ;
+}
+
+static boolean CLEAR_DSG_DIRECTLY = true ;
+static private DatasetGraph dsgTesting ;
+
+// Abstraction that runs a SPARQL server for tests.
+public static final String urlRoot(){ return 
"http://localhost:"+port()+"/" ; }
+public static final String datasetPath(){ return "/dataset" ; }
+public static final String urlDataset() { return 
"http://localhost:"+port()+datasetPath() ; }
+public static final DatasetGraph getDataset()   { return dsgTesting ; }
+
+public static final String serviceUpdate()  { return