Re: 10G loading file to fuseki

2017-01-19 Thread A. Soroka
Your procedure seems reasonable. I still don't understand what you mean by "I 
can query the small Lexo database but not the LinkedCT one." What exactly are 
you doing to send queries?

Please show the configuration you added for your new dataset.

---
A. Soroka
The University of Virginia Library
> On Jan 19, 2017, at 2:24 PM, Reihaneh Amini  wrote:
> 
> Sure!
> Thanks for helping!
> 
> 1. TDB laoding:
> 
> public static void main(String[] args) {
> 
> String file = "./linkedct-live-dump-latest.nt";   //source 10 GB file
>   String directory;
>   directory = "./Data";
> //target TDB files
> 
>   Dataset dataset = TDBFactory.createDataset(directory);
> 
>   Model model = dataset.getNamedModel("http://nameFile;);
> 
>   TDBLoader.loadModel(model, file );
> 
> 
>   }
> 
> I loaded the big file by using TDB model and finally after 10 hours of
> execution, it gave me the Data folder that contains 28 files with .dat and
> .idn suffix.
> 
> 2. I have a directory that I downloaded from download part of fuseki-server
> naming: "apache-jena-fuseki-2.4.1". It contains a batch file that by
> running that file from command-line I get access to the server by
> localhost/3030.
> When I get access to the server and upload a small dataset (<100mb) there
> named "Lexo", automatically that dataset will be appeared in the
> "apache-jena-fuseki-2.4.1/run/databases/lexo". That dataset contains the
> .dat and .idn files.
> 
> So, by doing the reverse process. First I read my big dataset by step one.
> Then I save these generated files into
> "apache-jena-fuseki-2.4.1/run/databases/LinkedCT"  path under "LinkedCT"
> folder.
> 
> 3. I run the server again and now both databases appear in the server. ( I
> also took care of creating a config file for this new dataset in
> "Configuration" folder.
> 
> 4. this seems normal from my perspective.
> C:\Programs\apache-jena-fuseki-2.4.1>fuseki-server
> Picked up _JAVA_OPTIONS: -Xms2048m -Xmx4096m
> [2017-01-19 10:23:59] Server INFO  Fuseki 2.4.1
> [2017-01-19 10:23:59] Config INFO
> FUSEKI_HOME=C:\Programs\apache-jena-fuseki-2.4.1\.
> [2017-01-19 10:23:59] Config INFO
> FUSEKI_BASE=C:\Programs\apache-jena-fuseki-2.4.1\run
> [2017-01-19 10:23:59] ServletINFO  Initializing Shiro environment
> [2017-01-19 10:23:59] Config INFO  Shiro file:
> file://C:\Programs\apache-jena-fuseki-2.4.1\run\shiro.ini
> [2017-01-19 10:23:59] Config INFO  Configuration file:
> C:\Programs\apache-jena-fuseki-2.4.1\run\config.ttl
> [2017-01-19 10:23:59] riot   WARN  [line: 5, col: 9 ] Bad IRI:
>  Code:
> 4/UNWISE_CHARACTER in PATH: The character matches no grammar rules of
> URIs/IRIs. These characters are permitted in RDF URI References, XML system
> identifiers, and XML Schema anyURIs.
> [2017-01-19 10:24:00] Config INFO  Load configuration:
> file:///C:/Programs/apache-jena-fuseki-2.4.1/run/configuration/Lexvo.ttl
> [2017-01-19 10:24:01] Config INFO  Load configuration:
> file:///C:/Programs/apache-jena-fuseki-2.4.1/run/configuration/LinkedCT.ttl
> [2017-01-19 10:24:04] Config INFO  Register: /Lexvo
> [2017-01-19 10:24:04] Config INFO  Register: /LinkedCT
> [2017-01-19 10:24:04] Server INFO  Started 2017/01/19 10:24:04 EST on
> port 3030
> 
> 
> 
> 5. When I go to the server, I can query the small Lexo database but not the
> LinkedCT one.
> 
> 
> Regards,
> Reihan
> 
> 
> 
> On Thu, Jan 19, 2017 at 1:40 PM, A. Soroka  wrote:
> 
>>> However, the reasoner probably is not working because I cannot query the
>> data!
>> 
>> This isn't really an effective report of a problem. Can you describe what
>> you did (including the exact sequence of steps you followed to do the
>> load), what you then did to query, what you expected to get, and what you
>> actually got?
>> 
>> ---
>> A. Soroka
>> The University of Virginia Library
>> 
>> 
>> 
>>> On Jan 19, 2017, at 12:03 PM, Reihaneh Amini 
>> wrote:
>>> 
>>> I load the data by TDB loader and then upload them into the server with
>> no
>>> problem this time. However, the reasoner probably is not working because
>> I
>>> cannot query the data!
>>> 
>>> By loading by TDB I got several .dat and .idn file which I loaded them to
>>> fuseki server.
>>> 
>>> Any suggestion?
>>> 
>>> Regards,
>>> Reihan
>>> 
>>> On Thu, Jan 19, 2017 at 11:33 AM, A. Soroka  wrote:
>>> 
 Using the UI is not a good idea for this. You would do _much_ better
 either to work Osma's suggestion or to use the command-line tools.
 
 ---
 A. Soroka
 The University of Virginia Library
 
> On Jan 19, 2017, at 11:32 AM, Reihaneh Amini >> 
 wrote:
> 
> Hi Andy,
> 
> Thanks for your advice!
> I am using UI.
> 
> Do you mean I can still use UI if I split the data?
> By splitting you mean the simple 

Re: 10G loading file to fuseki

2017-01-19 Thread Reihaneh Amini
Sure!
Thanks for helping!

1. TDB laoding:

public static void main(String[] args) {

String file = "./linkedct-live-dump-latest.nt";   //source 10 GB file
   String directory;
   directory = "./Data";
//target TDB files

   Dataset dataset = TDBFactory.createDataset(directory);

   Model model = dataset.getNamedModel("http://nameFile;);

   TDBLoader.loadModel(model, file );


   }

I loaded the big file by using TDB model and finally after 10 hours of
execution, it gave me the Data folder that contains 28 files with .dat and
.idn suffix.

2. I have a directory that I downloaded from download part of fuseki-server
naming: "apache-jena-fuseki-2.4.1". It contains a batch file that by
running that file from command-line I get access to the server by
localhost/3030.
When I get access to the server and upload a small dataset (<100mb) there
named "Lexo", automatically that dataset will be appeared in the
"apache-jena-fuseki-2.4.1/run/databases/lexo". That dataset contains the
.dat and .idn files.

So, by doing the reverse process. First I read my big dataset by step one.
Then I save these generated files into
"apache-jena-fuseki-2.4.1/run/databases/LinkedCT"  path under "LinkedCT"
folder.

3. I run the server again and now both databases appear in the server. ( I
also took care of creating a config file for this new dataset in
"Configuration" folder.

4. this seems normal from my perspective.
C:\Programs\apache-jena-fuseki-2.4.1>fuseki-server
Picked up _JAVA_OPTIONS: -Xms2048m -Xmx4096m
[2017-01-19 10:23:59] Server INFO  Fuseki 2.4.1
[2017-01-19 10:23:59] Config INFO
 FUSEKI_HOME=C:\Programs\apache-jena-fuseki-2.4.1\.
[2017-01-19 10:23:59] Config INFO
 FUSEKI_BASE=C:\Programs\apache-jena-fuseki-2.4.1\run
[2017-01-19 10:23:59] ServletINFO  Initializing Shiro environment
[2017-01-19 10:23:59] Config INFO  Shiro file:
file://C:\Programs\apache-jena-fuseki-2.4.1\run\shiro.ini
[2017-01-19 10:23:59] Config INFO  Configuration file:
C:\Programs\apache-jena-fuseki-2.4.1\run\config.ttl
[2017-01-19 10:23:59] riot   WARN  [line: 5, col: 9 ] Bad IRI:
 Code:
4/UNWISE_CHARACTER in PATH: The character matches no grammar rules of
URIs/IRIs. These characters are permitted in RDF URI References, XML system
identifiers, and XML Schema anyURIs.
[2017-01-19 10:24:00] Config INFO  Load configuration:
file:///C:/Programs/apache-jena-fuseki-2.4.1/run/configuration/Lexvo.ttl
[2017-01-19 10:24:01] Config INFO  Load configuration:
file:///C:/Programs/apache-jena-fuseki-2.4.1/run/configuration/LinkedCT.ttl
[2017-01-19 10:24:04] Config INFO  Register: /Lexvo
[2017-01-19 10:24:04] Config INFO  Register: /LinkedCT
[2017-01-19 10:24:04] Server INFO  Started 2017/01/19 10:24:04 EST on
port 3030



5. When I go to the server, I can query the small Lexo database but not the
LinkedCT one.


Regards,
Reihan



On Thu, Jan 19, 2017 at 1:40 PM, A. Soroka  wrote:

> > However, the reasoner probably is not working because I cannot query the
> data!
>
> This isn't really an effective report of a problem. Can you describe what
> you did (including the exact sequence of steps you followed to do the
> load), what you then did to query, what you expected to get, and what you
> actually got?
>
> ---
> A. Soroka
> The University of Virginia Library
>
>
>
> > On Jan 19, 2017, at 12:03 PM, Reihaneh Amini 
> wrote:
> >
> > I load the data by TDB loader and then upload them into the server with
> no
> > problem this time. However, the reasoner probably is not working because
> I
> > cannot query the data!
> >
> > By loading by TDB I got several .dat and .idn file which I loaded them to
> > fuseki server.
> >
> > Any suggestion?
> >
> > Regards,
> > Reihan
> >
> > On Thu, Jan 19, 2017 at 11:33 AM, A. Soroka  wrote:
> >
> >> Using the UI is not a good idea for this. You would do _much_ better
> >> either to work Osma's suggestion or to use the command-line tools.
> >>
> >> ---
> >> A. Soroka
> >> The University of Virginia Library
> >>
> >>> On Jan 19, 2017, at 11:32 AM, Reihaneh Amini  >
> >> wrote:
> >>>
> >>> Hi Andy,
> >>>
> >>> Thanks for your advice!
> >>> I am using UI.
> >>>
> >>> Do you mean I can still use UI if I split the data?
> >>> By splitting you mean the simple splitting, right?
> >>>
> >>>
> >>> Reihan
> >>
> >>
> >
> >
> > --
> > Regards,
> > -Reihan
>
>


-- 
Regards,
-Reihan


Re: 10G loading file to fuseki

2017-01-19 Thread A. Soroka
> However, the reasoner probably is not working because I cannot query the data!

This isn't really an effective report of a problem. Can you describe what you 
did (including the exact sequence of steps you followed to do the load), what 
you then did to query, what you expected to get, and what you actually got?

---
A. Soroka
The University of Virginia Library



> On Jan 19, 2017, at 12:03 PM, Reihaneh Amini  wrote:
> 
> I load the data by TDB loader and then upload them into the server with no
> problem this time. However, the reasoner probably is not working because I
> cannot query the data!
> 
> By loading by TDB I got several .dat and .idn file which I loaded them to
> fuseki server.
> 
> Any suggestion?
> 
> Regards,
> Reihan
> 
> On Thu, Jan 19, 2017 at 11:33 AM, A. Soroka  wrote:
> 
>> Using the UI is not a good idea for this. You would do _much_ better
>> either to work Osma's suggestion or to use the command-line tools.
>> 
>> ---
>> A. Soroka
>> The University of Virginia Library
>> 
>>> On Jan 19, 2017, at 11:32 AM, Reihaneh Amini 
>> wrote:
>>> 
>>> Hi Andy,
>>> 
>>> Thanks for your advice!
>>> I am using UI.
>>> 
>>> Do you mean I can still use UI if I split the data?
>>> By splitting you mean the simple splitting, right?
>>> 
>>> 
>>> Reihan
>> 
>> 
> 
> 
> -- 
> Regards,
> -Reihan



Re: 10G loading file to fuseki

2017-01-19 Thread Reihaneh Amini
I load the data by TDB loader and then upload them into the server with no
problem this time. However, the reasoner probably is not working because I
cannot query the data!

By loading by TDB I got several .dat and .idn file which I loaded them to
fuseki server.

Any suggestion?

Regards,
Reihan

On Thu, Jan 19, 2017 at 11:33 AM, A. Soroka  wrote:

> Using the UI is not a good idea for this. You would do _much_ better
> either to work Osma's suggestion or to use the command-line tools.
>
> ---
> A. Soroka
> The University of Virginia Library
>
> > On Jan 19, 2017, at 11:32 AM, Reihaneh Amini 
> wrote:
> >
> > Hi Andy,
> >
> > Thanks for your advice!
> > I am using UI.
> >
> > Do you mean I can still use UI if I split the data?
> > By splitting you mean the simple splitting, right?
> >
> >
> > Reihan
>
>


-- 
Regards,
-Reihan


Re: 10G loading file to fuseki

2017-01-19 Thread A. Soroka
Using the UI is not a good idea for this. You would do _much_ better either to 
work Osma's suggestion or to use the command-line tools.

---
A. Soroka
The University of Virginia Library

> On Jan 19, 2017, at 11:32 AM, Reihaneh Amini  wrote:
> 
> Hi Andy,
> 
> Thanks for your advice!
> I am using UI.
> 
> Do you mean I can still use UI if I split the data?
> By splitting you mean the simple splitting, right?
> 
> 
> Reihan



10G loading file to fuseki

2017-01-19 Thread Reihaneh Amini
Hi Andy,

Thanks for your advice!
I am using UI.

Do you mean I can still use UI if I split the data?
By splitting you mean the simple splitting, right?


Reihan


Re: 303 See Other, Riot

2017-01-19 Thread Andy Seaborne



On 19/01/17 12:16, Jean-Marc Vanel wrote:

Yes Andy, the look ahead parser is definitely for a different method,
usable by applications as a fallback to be used in exception catching; for
durably incorrect sources like dbPedia.

About read RDF/XML , I guess tolerant reading is not difficult ?


:-)

errors happen at different level: you had a token-level error (bad 
prefix name) which needs skipping to some recovery point.  Other kinds 
of errors can be handled as addition grammar rules, these give nice 
error messages.


For RDF/XML, Jena uses a standard XML parser then has a grammar for RDF 
over that.


If the XML is broken, we are entirely dependent on the XML parser 
(Apache Xerces, not the forked on in the JDK).  XML parsers tend to be 
written to be careful and correct, not recovery (think business process 
documents - any error is a problem). If a tag is wrong, they don't recover.


Errors in the RDF rules over parsed XML are done - they tend to be 
"warning".


Is it "not difficult?" Well, do you want to write an XML parser? :-) its 
a fairly simple language - it's dealing with the details of character 
sets, entities, and providing the standard API.


Jena uses SAX for streaming - recovering from tag errors is hard in SAX 
- e.g. the parse has seen the start  ... then finds a mismatch with 
. But the API is based on pairing start-finish tag.



Aside, you can ask for a different format and hope that's not broken - I 
thought that DBpedia parsed all their files for correctness these days 
but it seems they don't.


Unicode x2013 is en-dash - the Turtle grammar goes back to XML's 
NameChar production which is what derived SPARQL and Turtle.  IIRC its 
because is looks like a plain dash hence XML security worries.


Andy





2017-01-19 13:10 GMT+01:00 Andy Seaborne :




On 19/01/17 11:47, Jean-Marc Vanel wrote:


FIX typo

2017-01-19 12:45 GMT+01:00 Jean-Marc Vanel :

There is, however, a possible improvement in Jena parser.

It could skip over the faulty triple, and output a non empty graph with
the correct ones.

Since it should also report the faulty input, I guess this would be in
another new method.

I guess also that writing a fault tolerant parser is not easy ...




Not for Turtle specially when the basic token is broken.(prefix name -
they don't have simple delimiters like <>).

The code (TokenizerText.readSegment) may be able to deal with some cases
better.

N-triples would be much easier because of scanning to end of line and the
tokens of the language have delimiters is recovery.

What to avoid is having to read ahead then reread to parse when in normal,
non-error mode.  That will slow down parsing measurably - tokenizing is on
the critical time path for throughput. For example, using JavaCC, which has
a more pwerful (expressive) tokenizer, came out significantly slower (near
50% for N-triples IIRC).

Andy




2017-01-19 11:23 GMT+01:00 Jean-Marc Vanel :

Vielen Dank Lorenz


Thanks for the accurate diagnosis and the bug report to Virtuoso.

I was aware of the issue;
I was testing from my semantic_forms application,
were the exception catching has gone wrong recently (and Scala language
does not require to catch exceptions).



2017-01-19 10:05 GMT+01:00 Lorenz B. 
:

Hi,


can you clarify what doesn't work?

I tried your example and it would work, but I'm getting a parse
exception because DBpedia (resp. Virtuoso) still returns illegal data:

   Graph g = RDFDataMgr.loadGraph("http://dbpedia.org/resource/Rome;);
   System.out.println(g.size());


[line: 1863, col: 13] Failed to find a prefix name or keyword:
–(8211;0x2013)
Exception in thread "main" org.apache.jena.riot.RiotException: [line:
1863, col: 13] Failed to find a prefix name or keyword: –(8211;0x2013)
at
org.apache.jena.riot.system.ErrorHandlerFactory$ErrorHandler
Std.fatal(ErrorHandlerFactory.java:136)
at
org.apache.jena.riot.lang.LangEngine.raiseException(LangEngi
ne.java:165)
at org.apache.jena.riot.lang.LangEngine.nextToken(LangEngine.ja
va:108)
at
org.apache.jena.riot.lang.LangTurtleBase.triples(LangTurtleB
ase.java:248)
at
org.apache.jena.riot.lang.LangTurtleBase.triplesSameSubject(
LangTurtleBase.java:190)
at
org.apache.jena.riot.lang.LangTurtle.oneTopLevelElement(Lang
Turtle.java:46)
at
org.apache.jena.riot.lang.LangTurtleBase.runParser(LangTurtl
eBase.java:89)
at org.apache.jena.riot.lang.LangBase.parse(LangBase.java:42)
at
org.apache.jena.riot.RDFParserRegistry$ReaderRIOTLang.read(R
DFParserRegistry.java:179)
at org.apache.jena.riot.RDFDataMgr.process(RDFDataMgr.java:861)
at org.apache.jena.riot.RDFDataMgr.parse(RDFDataMgr.java:667)
at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:212)
at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:105)
at org.apache.jena.riot.RDFDataMgr.loadGraph(RDFDataMgr.java:346)




If there is no 

Re: 303 See Other, Riot

2017-01-19 Thread Jean-Marc Vanel
Yes Andy, the look ahead parser is definitely for a different method,
usable by applications as a fallback to be used in exception catching; for
durably incorrect sources like dbPedia.

About read RDF/XML , I guess tolerant reading is not difficult ?



2017-01-19 13:10 GMT+01:00 Andy Seaborne :

>
>
> On 19/01/17 11:47, Jean-Marc Vanel wrote:
>
>> FIX typo
>>
>> 2017-01-19 12:45 GMT+01:00 Jean-Marc Vanel :
>>
>> There is, however, a possible improvement in Jena parser.
>>> It could skip over the faulty triple, and output a non empty graph with
>>> the correct ones.
>>>
>>> Since it should also report the faulty input, I guess this would be in
>>> another new method.
>>>
>>> I guess also that writing a fault tolerant parser is not easy ...
>>>
>>
> Not for Turtle specially when the basic token is broken.(prefix name -
> they don't have simple delimiters like <>).
>
> The code (TokenizerText.readSegment) may be able to deal with some cases
> better.
>
> N-triples would be much easier because of scanning to end of line and the
> tokens of the language have delimiters is recovery.
>
> What to avoid is having to read ahead then reread to parse when in normal,
> non-error mode.  That will slow down parsing measurably - tokenizing is on
> the critical time path for throughput. For example, using JavaCC, which has
> a more pwerful (expressive) tokenizer, came out significantly slower (near
> 50% for N-triples IIRC).
>
> Andy
>
>
>>>
>>> 2017-01-19 11:23 GMT+01:00 Jean-Marc Vanel :
>>>
>>> Vielen Dank Lorenz

 Thanks for the accurate diagnosis and the bug report to Virtuoso.

 I was aware of the issue;
 I was testing from my semantic_forms application,
 were the exception catching has gone wrong recently (and Scala language
 does not require to catch exceptions).



 2017-01-19 10:05 GMT+01:00 Lorenz B. 
 :

 Hi,
>
> can you clarify what doesn't work?
>
> I tried your example and it would work, but I'm getting a parse
> exception because DBpedia (resp. Virtuoso) still returns illegal data:
>
>Graph g = RDFDataMgr.loadGraph("http://dbpedia.org/resource/Rome;);
>System.out.println(g.size());
>
>
> [line: 1863, col: 13] Failed to find a prefix name or keyword:
> –(8211;0x2013)
> Exception in thread "main" org.apache.jena.riot.RiotException: [line:
> 1863, col: 13] Failed to find a prefix name or keyword: –(8211;0x2013)
> at
> org.apache.jena.riot.system.ErrorHandlerFactory$ErrorHandler
> Std.fatal(ErrorHandlerFactory.java:136)
> at
> org.apache.jena.riot.lang.LangEngine.raiseException(LangEngi
> ne.java:165)
> at org.apache.jena.riot.lang.LangEngine.nextToken(LangEngine.ja
> va:108)
> at
> org.apache.jena.riot.lang.LangTurtleBase.triples(LangTurtleB
> ase.java:248)
> at
> org.apache.jena.riot.lang.LangTurtleBase.triplesSameSubject(
> LangTurtleBase.java:190)
> at
> org.apache.jena.riot.lang.LangTurtle.oneTopLevelElement(Lang
> Turtle.java:46)
> at
> org.apache.jena.riot.lang.LangTurtleBase.runParser(LangTurtl
> eBase.java:89)
> at org.apache.jena.riot.lang.LangBase.parse(LangBase.java:42)
> at
> org.apache.jena.riot.RDFParserRegistry$ReaderRIOTLang.read(R
> DFParserRegistry.java:179)
> at org.apache.jena.riot.RDFDataMgr.process(RDFDataMgr.java:861)
> at org.apache.jena.riot.RDFDataMgr.parse(RDFDataMgr.java:667)
> at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:212)
> at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:105)
> at org.apache.jena.riot.RDFDataMgr.loadGraph(RDFDataMgr.java:346)
>
>
>
>
> If there is no parsing error (e.g.http://dbpedia.org/resource/Mars
> works
> for me)  the result is as expected:
>
>
>Graph g = RDFDataMgr.loadGraph("http://dbpedia.org/resource/Mars;);
>System.out.println(g.size());
>
>Output: 347
>
>
> The issue was already reported by me, see [1], and [2]
>
> [1] https://github.com/openlink/virtuoso-opensource/issues/567
> [2] https://github.com/openlink/virtuoso-opensource/issues/569
>
>
>
> Kind regards,
> Lorenz
>
> Reading a dbPedia resource with e.g. RDFDataMgr.loadGraph() does not
>> currently work (it used to work with Jena 3.1.1 ).
>> Apparently this is because of the 303 redirection.
>> Is there another call in Jena API to handle redirections and accepting
>>
> RDF
>
>> MIME types ?
>>
>> wget --save-headers --header='Accept: application/rdf+xml'
>> http://dbpedia.org/resource/Rome
>> --2017-01-19 09:30:08--  http://dbpedia.org/resource/Rome
>> Résolution de dbpedia.org (dbpedia.org)… 194.109.129.58

Re: 303 See Other, Riot

2017-01-19 Thread Lorenz B.
I think there was some discussion regarding this extension [1] and
somebody already started implemented something. But I can't find it

[1]
http://mail-archives.apache.org/mod_mbox/jena-users/201607.mbox/%3CCAE35VmxXruBMy7tJM%2B4QBV3K2XnmgAue3enGkfEVcXY_RmNgkQ%40mail.gmail.com%3E

> There is, however, a possible improvement in Jena parser.
> It could skip over the faulty triple, and output a non empty graph with the
> correct one.
>
> Since it should also report the faulty input, I guess this would be in
> another new method.
>
> I guess also that writing a fault tolerant parser is not easy ...
>
>
> 2017-01-19 11:23 GMT+01:00 Jean-Marc Vanel :
>
>> Vielen Dank Lorenz
>>
>> Thanks for the accurate diagnosis and the bug report to Virtuoso.
>>
>> I was aware of the issue;
>> I was testing from my semantic_forms application,
>> were the exception catching has gone wrong recently (and Scala language
>> does not require to catch exceptions).
>>
>>
>>
>> 2017-01-19 10:05 GMT+01:00 Lorenz B. :
>>
>>> Hi,
>>>
>>> can you clarify what doesn't work?
>>>
>>> I tried your example and it would work, but I'm getting a parse
>>> exception because DBpedia (resp. Virtuoso) still returns illegal data:
>>>
>>>Graph g = RDFDataMgr.loadGraph("http://dbpedia.org/resource/Rome;);
>>>System.out.println(g.size());
>>>
>>>
>>> [line: 1863, col: 13] Failed to find a prefix name or keyword:
>>> –(8211;0x2013)
>>> Exception in thread "main" org.apache.jena.riot.RiotException: [line:
>>> 1863, col: 13] Failed to find a prefix name or keyword: –(8211;0x2013)
>>> at
>>> org.apache.jena.riot.system.ErrorHandlerFactory$ErrorHandler
>>> Std.fatal(ErrorHandlerFactory.java:136)
>>> at
>>> org.apache.jena.riot.lang.LangEngine.raiseException(LangEngine.java:165)
>>> at org.apache.jena.riot.lang.LangEngine.nextToken(LangEngine.
>>> java:108)
>>> at
>>> org.apache.jena.riot.lang.LangTurtleBase.triples(LangTurtleBase.java:248)
>>> at
>>> org.apache.jena.riot.lang.LangTurtleBase.triplesSameSubject(
>>> LangTurtleBase.java:190)
>>> at
>>> org.apache.jena.riot.lang.LangTurtle.oneTopLevelElement(Lang
>>> Turtle.java:46)
>>> at
>>> org.apache.jena.riot.lang.LangTurtleBase.runParser(LangTurtl
>>> eBase.java:89)
>>> at org.apache.jena.riot.lang.LangBase.parse(LangBase.java:42)
>>> at
>>> org.apache.jena.riot.RDFParserRegistry$ReaderRIOTLang.read(R
>>> DFParserRegistry.java:179)
>>> at org.apache.jena.riot.RDFDataMgr.process(RDFDataMgr.java:861)
>>> at org.apache.jena.riot.RDFDataMgr.parse(RDFDataMgr.java:667)
>>> at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:212)
>>> at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:105)
>>> at org.apache.jena.riot.RDFDataMgr.loadGraph(RDFDataMgr.java:346)
>>>
>>>
>>>
>>>
>>> If there is no parsing error (e.g.http://dbpedia.org/resource/Mars works
>>> for me)  the result is as expected:
>>>
>>>
>>>Graph g = RDFDataMgr.loadGraph("http://dbpedia.org/resource/Mars;);
>>>System.out.println(g.size());
>>>
>>>Output: 347
>>>
>>>
>>> The issue was already reported by me, see [1], and [2]
>>>
>>> [1] https://github.com/openlink/virtuoso-opensource/issues/567
>>> [2] https://github.com/openlink/virtuoso-opensource/issues/569
>>>
>>>
>>>
>>> Kind regards,
>>> Lorenz
>>>
 Reading a dbPedia resource with e.g. RDFDataMgr.loadGraph() does not
 currently work (it used to work with Jena 3.1.1 ).
 Apparently this is because of the 303 redirection.
 Is there another call in Jena API to handle redirections and accepting
>>> RDF
 MIME types ?

 wget --save-headers --header='Accept: application/rdf+xml'
 http://dbpedia.org/resource/Rome
 --2017-01-19 09:30:08--  http://dbpedia.org/resource/Rome
 Résolution de dbpedia.org (dbpedia.org)… 194.109.129.58
 Connexion à dbpedia.org (dbpedia.org)|194.109.129.58|:80… connecté.
 requête HTTP transmise, en attente de la réponse… *303 See Other*
 Emplacement : http://dbpedia.org/data/Rome.xml [suivant]
 --2017-01-19 09:30:08--  http://dbpedia.org/data/Rome.xml
 Réutilisation de la connexion existante à dbpedia.org:80.
 requête HTTP transmise, en attente de la réponse… 200 OK
 Taille : 1003627 (980K) [application/rdf+xml]
 Enregistre : «Rome.2»

 less Rome.2
 HTTP/1.1 200 OK
 Date: Thu, 19 Jan 2017 08:30:08 GMT
 Content-Type: application/rdf+xml; charset=UTF-8
 Content-Length: 1003627
 Connection: keep-alive
 Vary: Accept-Encoding
 Server: Virtuoso/07.20.3217 (Linux) i686-generic-linux-glibc212-64  VDB
 Expires: Thu, 26 Jan 2017 08:30:08 GMT
 Link: ;rel="license",<
 http://dbpedia.org/data/Rome.n3>; rel="alternate"; type="text/n3";
 title="Structured Descriptor Document (N3/Turtle format)", <
 http://dbpedia.org/data/Rome.json>; rel="alternate";
 type="application/json"; 

Re: 303 See Other, Riot

2017-01-19 Thread Andy Seaborne



On 19/01/17 11:47, Jean-Marc Vanel wrote:

FIX typo

2017-01-19 12:45 GMT+01:00 Jean-Marc Vanel :


There is, however, a possible improvement in Jena parser.
It could skip over the faulty triple, and output a non empty graph with
the correct ones.

Since it should also report the faulty input, I guess this would be in
another new method.

I guess also that writing a fault tolerant parser is not easy ...


Not for Turtle specially when the basic token is broken.(prefix name - 
they don't have simple delimiters like <>).


The code (TokenizerText.readSegment) may be able to deal with some cases 
better.


N-triples would be much easier because of scanning to end of line and 
the tokens of the language have delimiters is recovery.


What to avoid is having to read ahead then reread to parse when in 
normal, non-error mode.  That will slow down parsing measurably - 
tokenizing is on the critical time path for throughput. For example, 
using JavaCC, which has a more pwerful (expressive) tokenizer, came out 
significantly slower (near 50% for N-triples IIRC).


Andy




2017-01-19 11:23 GMT+01:00 Jean-Marc Vanel :


Vielen Dank Lorenz

Thanks for the accurate diagnosis and the bug report to Virtuoso.

I was aware of the issue;
I was testing from my semantic_forms application,
were the exception catching has gone wrong recently (and Scala language
does not require to catch exceptions).



2017-01-19 10:05 GMT+01:00 Lorenz B. 
:


Hi,

can you clarify what doesn't work?

I tried your example and it would work, but I'm getting a parse
exception because DBpedia (resp. Virtuoso) still returns illegal data:

   Graph g = RDFDataMgr.loadGraph("http://dbpedia.org/resource/Rome;);
   System.out.println(g.size());


[line: 1863, col: 13] Failed to find a prefix name or keyword:
–(8211;0x2013)
Exception in thread "main" org.apache.jena.riot.RiotException: [line:
1863, col: 13] Failed to find a prefix name or keyword: –(8211;0x2013)
at
org.apache.jena.riot.system.ErrorHandlerFactory$ErrorHandler
Std.fatal(ErrorHandlerFactory.java:136)
at
org.apache.jena.riot.lang.LangEngine.raiseException(LangEngine.java:165)
at org.apache.jena.riot.lang.LangEngine.nextToken(LangEngine.ja
va:108)
at
org.apache.jena.riot.lang.LangTurtleBase.triples(LangTurtleB
ase.java:248)
at
org.apache.jena.riot.lang.LangTurtleBase.triplesSameSubject(
LangTurtleBase.java:190)
at
org.apache.jena.riot.lang.LangTurtle.oneTopLevelElement(Lang
Turtle.java:46)
at
org.apache.jena.riot.lang.LangTurtleBase.runParser(LangTurtl
eBase.java:89)
at org.apache.jena.riot.lang.LangBase.parse(LangBase.java:42)
at
org.apache.jena.riot.RDFParserRegistry$ReaderRIOTLang.read(R
DFParserRegistry.java:179)
at org.apache.jena.riot.RDFDataMgr.process(RDFDataMgr.java:861)
at org.apache.jena.riot.RDFDataMgr.parse(RDFDataMgr.java:667)
at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:212)
at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:105)
at org.apache.jena.riot.RDFDataMgr.loadGraph(RDFDataMgr.java:346)




If there is no parsing error (e.g.http://dbpedia.org/resource/Mars works
for me)  the result is as expected:


   Graph g = RDFDataMgr.loadGraph("http://dbpedia.org/resource/Mars;);
   System.out.println(g.size());

   Output: 347


The issue was already reported by me, see [1], and [2]

[1] https://github.com/openlink/virtuoso-opensource/issues/567
[2] https://github.com/openlink/virtuoso-opensource/issues/569



Kind regards,
Lorenz


Reading a dbPedia resource with e.g. RDFDataMgr.loadGraph() does not
currently work (it used to work with Jena 3.1.1 ).
Apparently this is because of the 303 redirection.
Is there another call in Jena API to handle redirections and accepting

RDF

MIME types ?

wget --save-headers --header='Accept: application/rdf+xml'
http://dbpedia.org/resource/Rome
--2017-01-19 09:30:08--  http://dbpedia.org/resource/Rome
Résolution de dbpedia.org (dbpedia.org)… 194.109.129.58
Connexion à dbpedia.org (dbpedia.org)|194.109.129.58|:80… connecté.
requête HTTP transmise, en attente de la réponse… *303 See Other*
Emplacement : http://dbpedia.org/data/Rome.xml [suivant]
--2017-01-19 09:30:08--  http://dbpedia.org/data/Rome.xml
Réutilisation de la connexion existante à dbpedia.org:80.
requête HTTP transmise, en attente de la réponse… 200 OK
Taille : 1003627 (980K) [application/rdf+xml]
Enregistre : «Rome.2»

less Rome.2
HTTP/1.1 200 OK
Date: Thu, 19 Jan 2017 08:30:08 GMT
Content-Type: application/rdf+xml; charset=UTF-8
Content-Length: 1003627
Connection: keep-alive
Vary: Accept-Encoding
Server: Virtuoso/07.20.3217 (Linux) i686-generic-linux-glibc212-64

VDB

Expires: Thu, 26 Jan 2017 08:30:08 GMT
Link: ;rel="license",<
http://dbpedia.org/data/Rome.n3>; rel="alternate"; type="text/n3";
title="Structured Descriptor Document (N3/Turtle format)", <

Re: 303 See Other, Riot

2017-01-19 Thread Jean-Marc Vanel
FIX typo

2017-01-19 12:45 GMT+01:00 Jean-Marc Vanel :

> There is, however, a possible improvement in Jena parser.
> It could skip over the faulty triple, and output a non empty graph with
> the correct ones.
>
> Since it should also report the faulty input, I guess this would be in
> another new method.
>
> I guess also that writing a fault tolerant parser is not easy ...
>
>
> 2017-01-19 11:23 GMT+01:00 Jean-Marc Vanel :
>
>> Vielen Dank Lorenz
>>
>> Thanks for the accurate diagnosis and the bug report to Virtuoso.
>>
>> I was aware of the issue;
>> I was testing from my semantic_forms application,
>> were the exception catching has gone wrong recently (and Scala language
>> does not require to catch exceptions).
>>
>>
>>
>> 2017-01-19 10:05 GMT+01:00 Lorenz B. 
>> :
>>
>>> Hi,
>>>
>>> can you clarify what doesn't work?
>>>
>>> I tried your example and it would work, but I'm getting a parse
>>> exception because DBpedia (resp. Virtuoso) still returns illegal data:
>>>
>>>Graph g = RDFDataMgr.loadGraph("http://dbpedia.org/resource/Rome;);
>>>System.out.println(g.size());
>>>
>>>
>>> [line: 1863, col: 13] Failed to find a prefix name or keyword:
>>> –(8211;0x2013)
>>> Exception in thread "main" org.apache.jena.riot.RiotException: [line:
>>> 1863, col: 13] Failed to find a prefix name or keyword: –(8211;0x2013)
>>> at
>>> org.apache.jena.riot.system.ErrorHandlerFactory$ErrorHandler
>>> Std.fatal(ErrorHandlerFactory.java:136)
>>> at
>>> org.apache.jena.riot.lang.LangEngine.raiseException(LangEngine.java:165)
>>> at org.apache.jena.riot.lang.LangEngine.nextToken(LangEngine.ja
>>> va:108)
>>> at
>>> org.apache.jena.riot.lang.LangTurtleBase.triples(LangTurtleB
>>> ase.java:248)
>>> at
>>> org.apache.jena.riot.lang.LangTurtleBase.triplesSameSubject(
>>> LangTurtleBase.java:190)
>>> at
>>> org.apache.jena.riot.lang.LangTurtle.oneTopLevelElement(Lang
>>> Turtle.java:46)
>>> at
>>> org.apache.jena.riot.lang.LangTurtleBase.runParser(LangTurtl
>>> eBase.java:89)
>>> at org.apache.jena.riot.lang.LangBase.parse(LangBase.java:42)
>>> at
>>> org.apache.jena.riot.RDFParserRegistry$ReaderRIOTLang.read(R
>>> DFParserRegistry.java:179)
>>> at org.apache.jena.riot.RDFDataMgr.process(RDFDataMgr.java:861)
>>> at org.apache.jena.riot.RDFDataMgr.parse(RDFDataMgr.java:667)
>>> at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:212)
>>> at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:105)
>>> at org.apache.jena.riot.RDFDataMgr.loadGraph(RDFDataMgr.java:346)
>>>
>>>
>>>
>>>
>>> If there is no parsing error (e.g.http://dbpedia.org/resource/Mars works
>>> for me)  the result is as expected:
>>>
>>>
>>>Graph g = RDFDataMgr.loadGraph("http://dbpedia.org/resource/Mars;);
>>>System.out.println(g.size());
>>>
>>>Output: 347
>>>
>>>
>>> The issue was already reported by me, see [1], and [2]
>>>
>>> [1] https://github.com/openlink/virtuoso-opensource/issues/567
>>> [2] https://github.com/openlink/virtuoso-opensource/issues/569
>>>
>>>
>>>
>>> Kind regards,
>>> Lorenz
>>>
>>> > Reading a dbPedia resource with e.g. RDFDataMgr.loadGraph() does not
>>> > currently work (it used to work with Jena 3.1.1 ).
>>> > Apparently this is because of the 303 redirection.
>>> > Is there another call in Jena API to handle redirections and accepting
>>> RDF
>>> > MIME types ?
>>> >
>>> > wget --save-headers --header='Accept: application/rdf+xml'
>>> > http://dbpedia.org/resource/Rome
>>> > --2017-01-19 09:30:08--  http://dbpedia.org/resource/Rome
>>> > Résolution de dbpedia.org (dbpedia.org)… 194.109.129.58
>>> > Connexion à dbpedia.org (dbpedia.org)|194.109.129.58|:80… connecté.
>>> > requête HTTP transmise, en attente de la réponse… *303 See Other*
>>> > Emplacement : http://dbpedia.org/data/Rome.xml [suivant]
>>> > --2017-01-19 09:30:08--  http://dbpedia.org/data/Rome.xml
>>> > Réutilisation de la connexion existante à dbpedia.org:80.
>>> > requête HTTP transmise, en attente de la réponse… 200 OK
>>> > Taille : 1003627 (980K) [application/rdf+xml]
>>> > Enregistre : «Rome.2»
>>> >
>>> > less Rome.2
>>> > HTTP/1.1 200 OK
>>> > Date: Thu, 19 Jan 2017 08:30:08 GMT
>>> > Content-Type: application/rdf+xml; charset=UTF-8
>>> > Content-Length: 1003627
>>> > Connection: keep-alive
>>> > Vary: Accept-Encoding
>>> > Server: Virtuoso/07.20.3217 (Linux) i686-generic-linux-glibc212-64
>>> VDB
>>> > Expires: Thu, 26 Jan 2017 08:30:08 GMT
>>> > Link: ;rel="license",<
>>> > http://dbpedia.org/data/Rome.n3>; rel="alternate"; type="text/n3";
>>> > title="Structured Descriptor Document (N3/Turtle format)", <
>>> > http://dbpedia.org/data/Rome.json>; rel="alternate";
>>> > type="application/json"; title="Structured Descriptor Document
>>> (RDF/JSON
>>> > format)", ; rel="alternate";
>>> > type="application/atom+xml"; 

Re: 303 See Other, Riot

2017-01-19 Thread Jean-Marc Vanel
There is, however, a possible improvement in Jena parser.
It could skip over the faulty triple, and output a non empty graph with the
correct one.

Since it should also report the faulty input, I guess this would be in
another new method.

I guess also that writing a fault tolerant parser is not easy ...


2017-01-19 11:23 GMT+01:00 Jean-Marc Vanel :

> Vielen Dank Lorenz
>
> Thanks for the accurate diagnosis and the bug report to Virtuoso.
>
> I was aware of the issue;
> I was testing from my semantic_forms application,
> were the exception catching has gone wrong recently (and Scala language
> does not require to catch exceptions).
>
>
>
> 2017-01-19 10:05 GMT+01:00 Lorenz B. :
>
>> Hi,
>>
>> can you clarify what doesn't work?
>>
>> I tried your example and it would work, but I'm getting a parse
>> exception because DBpedia (resp. Virtuoso) still returns illegal data:
>>
>>Graph g = RDFDataMgr.loadGraph("http://dbpedia.org/resource/Rome;);
>>System.out.println(g.size());
>>
>>
>> [line: 1863, col: 13] Failed to find a prefix name or keyword:
>> –(8211;0x2013)
>> Exception in thread "main" org.apache.jena.riot.RiotException: [line:
>> 1863, col: 13] Failed to find a prefix name or keyword: –(8211;0x2013)
>> at
>> org.apache.jena.riot.system.ErrorHandlerFactory$ErrorHandler
>> Std.fatal(ErrorHandlerFactory.java:136)
>> at
>> org.apache.jena.riot.lang.LangEngine.raiseException(LangEngine.java:165)
>> at org.apache.jena.riot.lang.LangEngine.nextToken(LangEngine.
>> java:108)
>> at
>> org.apache.jena.riot.lang.LangTurtleBase.triples(LangTurtleBase.java:248)
>> at
>> org.apache.jena.riot.lang.LangTurtleBase.triplesSameSubject(
>> LangTurtleBase.java:190)
>> at
>> org.apache.jena.riot.lang.LangTurtle.oneTopLevelElement(Lang
>> Turtle.java:46)
>> at
>> org.apache.jena.riot.lang.LangTurtleBase.runParser(LangTurtl
>> eBase.java:89)
>> at org.apache.jena.riot.lang.LangBase.parse(LangBase.java:42)
>> at
>> org.apache.jena.riot.RDFParserRegistry$ReaderRIOTLang.read(R
>> DFParserRegistry.java:179)
>> at org.apache.jena.riot.RDFDataMgr.process(RDFDataMgr.java:861)
>> at org.apache.jena.riot.RDFDataMgr.parse(RDFDataMgr.java:667)
>> at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:212)
>> at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:105)
>> at org.apache.jena.riot.RDFDataMgr.loadGraph(RDFDataMgr.java:346)
>>
>>
>>
>>
>> If there is no parsing error (e.g.http://dbpedia.org/resource/Mars works
>> for me)  the result is as expected:
>>
>>
>>Graph g = RDFDataMgr.loadGraph("http://dbpedia.org/resource/Mars;);
>>System.out.println(g.size());
>>
>>Output: 347
>>
>>
>> The issue was already reported by me, see [1], and [2]
>>
>> [1] https://github.com/openlink/virtuoso-opensource/issues/567
>> [2] https://github.com/openlink/virtuoso-opensource/issues/569
>>
>>
>>
>> Kind regards,
>> Lorenz
>>
>> > Reading a dbPedia resource with e.g. RDFDataMgr.loadGraph() does not
>> > currently work (it used to work with Jena 3.1.1 ).
>> > Apparently this is because of the 303 redirection.
>> > Is there another call in Jena API to handle redirections and accepting
>> RDF
>> > MIME types ?
>> >
>> > wget --save-headers --header='Accept: application/rdf+xml'
>> > http://dbpedia.org/resource/Rome
>> > --2017-01-19 09:30:08--  http://dbpedia.org/resource/Rome
>> > Résolution de dbpedia.org (dbpedia.org)… 194.109.129.58
>> > Connexion à dbpedia.org (dbpedia.org)|194.109.129.58|:80… connecté.
>> > requête HTTP transmise, en attente de la réponse… *303 See Other*
>> > Emplacement : http://dbpedia.org/data/Rome.xml [suivant]
>> > --2017-01-19 09:30:08--  http://dbpedia.org/data/Rome.xml
>> > Réutilisation de la connexion existante à dbpedia.org:80.
>> > requête HTTP transmise, en attente de la réponse… 200 OK
>> > Taille : 1003627 (980K) [application/rdf+xml]
>> > Enregistre : «Rome.2»
>> >
>> > less Rome.2
>> > HTTP/1.1 200 OK
>> > Date: Thu, 19 Jan 2017 08:30:08 GMT
>> > Content-Type: application/rdf+xml; charset=UTF-8
>> > Content-Length: 1003627
>> > Connection: keep-alive
>> > Vary: Accept-Encoding
>> > Server: Virtuoso/07.20.3217 (Linux) i686-generic-linux-glibc212-64  VDB
>> > Expires: Thu, 26 Jan 2017 08:30:08 GMT
>> > Link: ;rel="license",<
>> > http://dbpedia.org/data/Rome.n3>; rel="alternate"; type="text/n3";
>> > title="Structured Descriptor Document (N3/Turtle format)", <
>> > http://dbpedia.org/data/Rome.json>; rel="alternate";
>> > type="application/json"; title="Structured Descriptor Document (RDF/JSON
>> > format)", ; rel="alternate";
>> > type="application/atom+xml"; title="OData (Atom+Feed format)", <
>> > http://dbpedia.org/data/Rome.jsod>; rel="alternate";
>> > type="application/odata+json"; title="OData (JSON format)", <
>> > http://dbpedia.org/page/Rome>; rel="alternate"; type="text/html";
>> 

Re: 303 See Other, Riot

2017-01-19 Thread Jean-Marc Vanel
Vielen Dank Lorenz

Thanks for the accurate diagnosis and the bug report to Virtuoso.

I was aware of the issue;
I was testing from my semantic_forms application,
were the exception catching has gone wrong recently (and Scala language
does not require to catch exceptions).



2017-01-19 10:05 GMT+01:00 Lorenz B. :

> Hi,
>
> can you clarify what doesn't work?
>
> I tried your example and it would work, but I'm getting a parse
> exception because DBpedia (resp. Virtuoso) still returns illegal data:
>
>Graph g = RDFDataMgr.loadGraph("http://dbpedia.org/resource/Rome;);
>System.out.println(g.size());
>
>
> [line: 1863, col: 13] Failed to find a prefix name or keyword:
> –(8211;0x2013)
> Exception in thread "main" org.apache.jena.riot.RiotException: [line:
> 1863, col: 13] Failed to find a prefix name or keyword: –(8211;0x2013)
> at
> org.apache.jena.riot.system.ErrorHandlerFactory$ErrorHandlerStd.fatal(
> ErrorHandlerFactory.java:136)
> at
> org.apache.jena.riot.lang.LangEngine.raiseException(LangEngine.java:165)
> at org.apache.jena.riot.lang.LangEngine.nextToken(LangEngine.java:108)
> at
> org.apache.jena.riot.lang.LangTurtleBase.triples(LangTurtleBase.java:248)
> at
> org.apache.jena.riot.lang.LangTurtleBase.triplesSameSubject(
> LangTurtleBase.java:190)
> at
> org.apache.jena.riot.lang.LangTurtle.oneTopLevelElement(
> LangTurtle.java:46)
> at
> org.apache.jena.riot.lang.LangTurtleBase.runParser(LangTurtleBase.java:89)
> at org.apache.jena.riot.lang.LangBase.parse(LangBase.java:42)
> at
> org.apache.jena.riot.RDFParserRegistry$ReaderRIOTLang.read(
> RDFParserRegistry.java:179)
> at org.apache.jena.riot.RDFDataMgr.process(RDFDataMgr.java:861)
> at org.apache.jena.riot.RDFDataMgr.parse(RDFDataMgr.java:667)
> at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:212)
> at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:105)
> at org.apache.jena.riot.RDFDataMgr.loadGraph(RDFDataMgr.java:346)
>
>
>
>
> If there is no parsing error (e.g.http://dbpedia.org/resource/Mars works
> for me)  the result is as expected:
>
>
>Graph g = RDFDataMgr.loadGraph("http://dbpedia.org/resource/Mars;);
>System.out.println(g.size());
>
>Output: 347
>
>
> The issue was already reported by me, see [1], and [2]
>
> [1] https://github.com/openlink/virtuoso-opensource/issues/567
> [2] https://github.com/openlink/virtuoso-opensource/issues/569
>
>
>
> Kind regards,
> Lorenz
>
> > Reading a dbPedia resource with e.g. RDFDataMgr.loadGraph() does not
> > currently work (it used to work with Jena 3.1.1 ).
> > Apparently this is because of the 303 redirection.
> > Is there another call in Jena API to handle redirections and accepting
> RDF
> > MIME types ?
> >
> > wget --save-headers --header='Accept: application/rdf+xml'
> > http://dbpedia.org/resource/Rome
> > --2017-01-19 09:30:08--  http://dbpedia.org/resource/Rome
> > Résolution de dbpedia.org (dbpedia.org)… 194.109.129.58
> > Connexion à dbpedia.org (dbpedia.org)|194.109.129.58|:80… connecté.
> > requête HTTP transmise, en attente de la réponse… *303 See Other*
> > Emplacement : http://dbpedia.org/data/Rome.xml [suivant]
> > --2017-01-19 09:30:08--  http://dbpedia.org/data/Rome.xml
> > Réutilisation de la connexion existante à dbpedia.org:80.
> > requête HTTP transmise, en attente de la réponse… 200 OK
> > Taille : 1003627 (980K) [application/rdf+xml]
> > Enregistre : «Rome.2»
> >
> > less Rome.2
> > HTTP/1.1 200 OK
> > Date: Thu, 19 Jan 2017 08:30:08 GMT
> > Content-Type: application/rdf+xml; charset=UTF-8
> > Content-Length: 1003627
> > Connection: keep-alive
> > Vary: Accept-Encoding
> > Server: Virtuoso/07.20.3217 (Linux) i686-generic-linux-glibc212-64  VDB
> > Expires: Thu, 26 Jan 2017 08:30:08 GMT
> > Link: ;rel="license",<
> > http://dbpedia.org/data/Rome.n3>; rel="alternate"; type="text/n3";
> > title="Structured Descriptor Document (N3/Turtle format)", <
> > http://dbpedia.org/data/Rome.json>; rel="alternate";
> > type="application/json"; title="Structured Descriptor Document (RDF/JSON
> > format)", ; rel="alternate";
> > type="application/atom+xml"; title="OData (Atom+Feed format)", <
> > http://dbpedia.org/data/Rome.jsod>; rel="alternate";
> > type="application/odata+json"; title="OData (JSON format)", <
> > http://dbpedia.org/page/Rome>; rel="alternate"; type="text/html";
> > title="XHTML+RDFa", ; rel="
> > http://xmlns.com/foaf/0.1/primaryTopic;,  Rome>;
> > rev="describedby", <
> > http://mementoarchive.lanl.gov/dbpedia/timegate/http://
> dbpedia.org/data/Rome.xml>;
> > rel="timegate"
> > X-SPARQL-default-graph: http://dbpedia.org
> > Cache-Control: max-age=604800
> > Access-Control-Allow-Origin: *
> > Access-Control-Allow-Credentials: true
> > Access-Control-Allow-Methods: GET, POST, OPTIONS
> > 

Re: 303 See Other, Riot

2017-01-19 Thread Lorenz B.
Hi,

can you clarify what doesn't work?

I tried your example and it would work, but I'm getting a parse
exception because DBpedia (resp. Virtuoso) still returns illegal data:

   Graph g = RDFDataMgr.loadGraph("http://dbpedia.org/resource/Rome;);
   System.out.println(g.size());


[line: 1863, col: 13] Failed to find a prefix name or keyword:
–(8211;0x2013)
Exception in thread "main" org.apache.jena.riot.RiotException: [line:
1863, col: 13] Failed to find a prefix name or keyword: –(8211;0x2013)
at
org.apache.jena.riot.system.ErrorHandlerFactory$ErrorHandlerStd.fatal(ErrorHandlerFactory.java:136)
at
org.apache.jena.riot.lang.LangEngine.raiseException(LangEngine.java:165)
at org.apache.jena.riot.lang.LangEngine.nextToken(LangEngine.java:108)
at
org.apache.jena.riot.lang.LangTurtleBase.triples(LangTurtleBase.java:248)
at
org.apache.jena.riot.lang.LangTurtleBase.triplesSameSubject(LangTurtleBase.java:190)
at
org.apache.jena.riot.lang.LangTurtle.oneTopLevelElement(LangTurtle.java:46)
at
org.apache.jena.riot.lang.LangTurtleBase.runParser(LangTurtleBase.java:89)
at org.apache.jena.riot.lang.LangBase.parse(LangBase.java:42)
at
org.apache.jena.riot.RDFParserRegistry$ReaderRIOTLang.read(RDFParserRegistry.java:179)
at org.apache.jena.riot.RDFDataMgr.process(RDFDataMgr.java:861)
at org.apache.jena.riot.RDFDataMgr.parse(RDFDataMgr.java:667)
at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:212)
at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:105)
at org.apache.jena.riot.RDFDataMgr.loadGraph(RDFDataMgr.java:346)

 


If there is no parsing error (e.g.http://dbpedia.org/resource/Mars works
for me)  the result is as expected:


   Graph g = RDFDataMgr.loadGraph("http://dbpedia.org/resource/Mars;);
   System.out.println(g.size());

   Output: 347


The issue was already reported by me, see [1], and [2]

[1] https://github.com/openlink/virtuoso-opensource/issues/567
[2] https://github.com/openlink/virtuoso-opensource/issues/569



Kind regards,
Lorenz

> Reading a dbPedia resource with e.g. RDFDataMgr.loadGraph() does not
> currently work (it used to work with Jena 3.1.1 ).
> Apparently this is because of the 303 redirection.
> Is there another call in Jena API to handle redirections and accepting RDF
> MIME types ?
>
> wget --save-headers --header='Accept: application/rdf+xml'
> http://dbpedia.org/resource/Rome
> --2017-01-19 09:30:08--  http://dbpedia.org/resource/Rome
> Résolution de dbpedia.org (dbpedia.org)… 194.109.129.58
> Connexion à dbpedia.org (dbpedia.org)|194.109.129.58|:80… connecté.
> requête HTTP transmise, en attente de la réponse… *303 See Other*
> Emplacement : http://dbpedia.org/data/Rome.xml [suivant]
> --2017-01-19 09:30:08--  http://dbpedia.org/data/Rome.xml
> Réutilisation de la connexion existante à dbpedia.org:80.
> requête HTTP transmise, en attente de la réponse… 200 OK
> Taille : 1003627 (980K) [application/rdf+xml]
> Enregistre : «Rome.2»
>
> less Rome.2
> HTTP/1.1 200 OK
> Date: Thu, 19 Jan 2017 08:30:08 GMT
> Content-Type: application/rdf+xml; charset=UTF-8
> Content-Length: 1003627
> Connection: keep-alive
> Vary: Accept-Encoding
> Server: Virtuoso/07.20.3217 (Linux) i686-generic-linux-glibc212-64  VDB
> Expires: Thu, 26 Jan 2017 08:30:08 GMT
> Link: ;rel="license",<
> http://dbpedia.org/data/Rome.n3>; rel="alternate"; type="text/n3";
> title="Structured Descriptor Document (N3/Turtle format)", <
> http://dbpedia.org/data/Rome.json>; rel="alternate";
> type="application/json"; title="Structured Descriptor Document (RDF/JSON
> format)", ; rel="alternate";
> type="application/atom+xml"; title="OData (Atom+Feed format)", <
> http://dbpedia.org/data/Rome.jsod>; rel="alternate";
> type="application/odata+json"; title="OData (JSON format)", <
> http://dbpedia.org/page/Rome>; rel="alternate"; type="text/html";
> title="XHTML+RDFa", ; rel="
> http://xmlns.com/foaf/0.1/primaryTopic;, ;
> rev="describedby", <
> http://mementoarchive.lanl.gov/dbpedia/timegate/http://dbpedia.org/data/Rome.xml>;
> rel="timegate"
> X-SPARQL-default-graph: http://dbpedia.org
> Cache-Control: max-age=604800
> Access-Control-Allow-Origin: *
> Access-Control-Allow-Credentials: true
> Access-Control-Allow-Methods: GET, POST, OPTIONS
> Access-Control-Allow-Headers:
> DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Accept-Encoding
> Accept-Ranges: bytes
>
> 
>  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#;
> ...
>
-- 
Lorenz Bühmann
AKSW group, University of Leipzig
Group: http://aksw.org - semantic web research center



Re: How I handle "Null Pointer Exception"

2017-01-19 Thread Lorenz B.
Ah right, the String matching will also fail because of the wrong
operator - but remember, IN ADDITION to the problem that the property is
an object property and therefore the value is a resource which is
identified by a URI

> You need to learn the difference between == and .equals().
>
> Please read up on basic Java skills! These questions should be asked on the
> Jena user group...
>
>
> On 18 Jan 2017 1:14 pm, "Sidra shah"  wrote:
>
> Hello Lorenz, its not giving me the exception now but it does not display
> the message JOption,. It does not read the  * if (s1=="CatPhysics")*
>
>
> RDFNode phFav=indiv.getPropertyValue(favcat);
>  if (phFav!=null){
>   RDFNode l1=phFav.asResource();
>
>
>   String s1=l1.toString();
>   }
>
> if (s1=="CatPhysics"){
>  JOptionPane.showMessageDialog(null, "Phyics category");
>   }
>
>
>
> On Wed, Jan 18, 2017 at 2:12 PM, Sidra shah  wrote:
>
>> Thank you Lorenz, let me read the document you mention here. I will come
>> back after reading and applying.
>>
>> Best regards
>>
>> On Wed, Jan 18, 2017 at 1:46 PM, Lorenz B. > leipzig.de> wrote:
>>
>>> What is for you the "value of a resource"? The URI?
>>>
>>> There is only one good source for developers, and that's Javadoc [1] -
>>> that's why we always refer to if people have questions.
>>>
>>> asResource() converts the RDFNode object to a resource
>>>
>>> [1]
>>> https://jena.apache.org/documentation/javadoc/jena/org/
>>> apache/jena/rdf/model/RDFNode.html
>>>
 Hello Lorenz, this was the question I was expected to ask? I mean
>>> values of
 BestCategory are resources.
 Kindly if you can guide me how to get the value, I searched it on the
>>> web
 but could not found any related resources.

 Kind regards

 On Wed, Jan 18, 2017 at 10:57 AM, Lorenz B. <
 buehm...@informatik.uni-leipzig.de> wrote:

>> OntModel model2=ModelFactory.createOntologyModel(
> OntModelSpec.OWL_DL_MEM);
>>InputStream in =FileManager.get().open("F://20-8.owl");
>> if (in==null) {
>> throw new IllegalArgumentException( "File: " +  " not
>> found");
>> }  model2.read(in,"");
>>
>>  String ns="
>> http://www.semanticweb.org/t/ontologies/2016/7/myOWL#;;
>>
>>OntProperty favcat=model2.getOntProperty(ns+ "BestCategory");
>> String  name=jTextField1.getText();
>> Individual indiv = user1.createIndividual(ns + name);
>>   RDFNode phFav=indiv.getPropertyValue(favcat);
>>  if (phFav!=null){
>>   Literal l1=phFav.asLiteral();
> If BestCategory is an object property, why do you cast the value as
> literal?!
>>s1=l1.toString(); }
>>  }
>> if (s1=="CatPhysics"){
>>  JOptionPane.showMessageDialog(null, "Physics");
>>   }
>>
>> The rule itself is
>>
>> String rule ="[rule1: ( ?x http://www.semanticweb.org/
>> t/ontologies/2016/7/myOWL#Physics_Preferred_Category  ?cat1 )" +
>>  "( ?x http://www.semanticweb.org/t/ontologies/2016/7/myOWL#
>> Chem_Preferred_Category  ?cat2 )" +
>> "( ?x http://www.semanticweb.org/t/o
>>> ntologies/2016/7/myOWL#Geo_
>> Preferred_Category  ?cat3 )" +
>> "greaterThan(?cat1,?cat2), greaterThan(?cat1,?cat3)"
>>  + " ->  (?x  http://www.semanticweb.org/t/
>> ontologies/2016/7/myOWL#BestCategory   http://www.semanticweb.org/t/
>> ontologies/2016/7/myOWL#BestCategory#Physics   )]";
>>
>>
>> The BestCategory is object property.
>>
>> Regards
>>
>>
>> On Tue, Jan 17, 2017 at 8:16 PM, Andy Seaborne 
>>> wrote:
>>> A Complete, Minimal Example please.
>>>
>>>
>>> Partial code, no data is not complete.
>>> It must compile and run to be complete.
>>>
>>> Minimal means only what is necessary to ask the question not the
>>> whole
>>> data or whole application.
>>>
>>> Andy
>>>
>>> On 17/01/17 17:14, Sidra shah wrote:
>>>
 I am surprise that when there is no value in BestCategory, it gives
>>> me
> no
 error and when the rule executes and value comes in BestCategory,
> it
> gives
 me now *"RequiredLiteralException*"

 The code I used here is

  OntProperty favcat=model2.getOntProperty(ns+ "BestCategory");

 RDFNode phFav=indiv.getPropertyValue(favcat);
  if (phFav!=null){
   Literal l1=phFav.asLiteral();

s1=l1.toString();}

 if (s1=="CatPhysics"){
  JOptionPane.showMessageDialog(null, "Physics");
   }

 Best 

303 See Other, Riot

2017-01-19 Thread Jean-Marc Vanel
Reading a dbPedia resource with e.g. RDFDataMgr.loadGraph() does not
currently work (it used to work with Jena 3.1.1 ).
Apparently this is because of the 303 redirection.
Is there another call in Jena API to handle redirections and accepting RDF
MIME types ?

wget --save-headers --header='Accept: application/rdf+xml'
http://dbpedia.org/resource/Rome
--2017-01-19 09:30:08--  http://dbpedia.org/resource/Rome
Résolution de dbpedia.org (dbpedia.org)… 194.109.129.58
Connexion à dbpedia.org (dbpedia.org)|194.109.129.58|:80… connecté.
requête HTTP transmise, en attente de la réponse… *303 See Other*
Emplacement : http://dbpedia.org/data/Rome.xml [suivant]
--2017-01-19 09:30:08--  http://dbpedia.org/data/Rome.xml
Réutilisation de la connexion existante à dbpedia.org:80.
requête HTTP transmise, en attente de la réponse… 200 OK
Taille : 1003627 (980K) [application/rdf+xml]
Enregistre : «Rome.2»

less Rome.2
HTTP/1.1 200 OK
Date: Thu, 19 Jan 2017 08:30:08 GMT
Content-Type: application/rdf+xml; charset=UTF-8
Content-Length: 1003627
Connection: keep-alive
Vary: Accept-Encoding
Server: Virtuoso/07.20.3217 (Linux) i686-generic-linux-glibc212-64  VDB
Expires: Thu, 26 Jan 2017 08:30:08 GMT
Link: ;rel="license",<
http://dbpedia.org/data/Rome.n3>; rel="alternate"; type="text/n3";
title="Structured Descriptor Document (N3/Turtle format)", <
http://dbpedia.org/data/Rome.json>; rel="alternate";
type="application/json"; title="Structured Descriptor Document (RDF/JSON
format)", ; rel="alternate";
type="application/atom+xml"; title="OData (Atom+Feed format)", <
http://dbpedia.org/data/Rome.jsod>; rel="alternate";
type="application/odata+json"; title="OData (JSON format)", <
http://dbpedia.org/page/Rome>; rel="alternate"; type="text/html";
title="XHTML+RDFa", ; rel="
http://xmlns.com/foaf/0.1/primaryTopic;, ;
rev="describedby", <
http://mementoarchive.lanl.gov/dbpedia/timegate/http://dbpedia.org/data/Rome.xml>;
rel="timegate"
X-SPARQL-default-graph: http://dbpedia.org
Cache-Control: max-age=604800
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Allow-Headers:
DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Accept-Encoding
Accept-Ranges: bytes


http://www.w3.org/1999/02/22-rdf-syntax-ns#;
...

-- 
Jean-Marc Vanel
Profil:
http://163.172.179.125:9111/display?displayuri=http%3A%2F%2Fjmvanel.free.fr%2Fjmv.rdf%23me
Déductions SARL - Consulting, services, training,
Rule-based programming, Semantic Web
+33 (0)6 89 16 29 52
Twitter: @jmvanel , @jmvanel_fr ; chat: irc://irc.freenode.net#eulergui


TDB support/training/courses

2017-01-19 Thread Laurent Rucquoy
Hello,

We are searching support/training/courses about TDB (modelling, database
optimization, ...)
Do you know a company providing such services ?

Thank you in advance,
Laurent