Hi Andy,

Thank you very much for your enthusiastic help :D

Then the current config is changed to:
```
<#tdb_inf_ds> a ja:RDFDataset ;
    ja:defaultGraph       <#tdb_graph> ;
    .
<#tdb_graph> a tdb:GraphTDB ;
    tdb:dataset <#tdb_ds> .
<#tdb_ds> a tdb:DatasetTDB;
    tdb:location "Data";
    .
:text_dataset a text:TextDataset ;
    text:dataset   <#tdb_inf_ds> ;
    text:index     <#textIndexLucene> ;
    .
```
And we are facing the same error again:
```
[2015-03-16 17:33:57] Fuseki INFO [6] POST /tdb :: 'data' :: [multipart/form-data] ? [2015-03-16 17:33:57] Fuseki INFO [6] Filename: test.ttl, Content-Type=text/turtle, Charset=null => Turtle : Count=6 Triples=6 Quads=0 [2015-03-16 17:33:57] HttpAction WARN Exception during abort (operation attempts to continue): Can't abort a write lock-transaction
[2015-03-16 17:33:57] Fuseki     INFO  [6] 500 Server Error (250 ms)
```

So it is not because of the reasoner, too. It's just because of the wrapping between graph and dataset??

Regards,
Yang

On 03/16/2015 05:13 PM, Andy Seaborne wrote:
Sorry - I was too hasty to asking the question. The text dataset has to be a dataset. There are two in your configuration: <#tdb_inf_ds> and <#tdb_ds>. You said <#tdb_ds> works.

The other case is to still have a general purpose dataset with a single graph in it but skip the RDFS.

Where it has:

<#tdb_inf_ds> a ja:RDFDataset ;
    ja:defaultGraph       <#tdb_inf> ;

if that goes to

<#tdb_inf_ds> a ja:RDFDataset ;
   ja:defaultGraph       <#tdb_graph> ;

instead it bypasses the RDFS you have setup but is still a general purpose dataset with TDB graph in it.

(still not clear why there is an abort which I can track down when I have a test case but I'm wondering if it is updating an unupdatable graph from RDFS ... except then I don't see how it worked with 1.1.1)

    Andy

On 16/03/15 16:03, Yang Yuanzhe wrote:
Hi Andy,

Thank you for the explanation for the updates.

As for the current issue, only :text_dataset -> <#tdb_ds> works.

:text_dataset -> <#tdb_graph> -> <#tdb_ds> will lead to such an exception:

[2015-03-16 15:26:25] Server     ERROR Exception in initialization:
caught: com.hp.hpl.jena.rdf.model.impl.ModelCom cannot be cast to
com.hp.hpl.jena.query.Dataset
[2015-03-16 15:26:25] WebAppContext WARN  Failed startup of context
o.e.j.w.WebAppContext@4c2d5b57{/,file:/home/yyz/apache-jena-fuseki-2.0.0/webapp/,STARTING}

com.hp.hpl.jena.assembler.exceptions.AssemblerException: caught:
com.hp.hpl.jena.rdf.model.impl.ModelCom cannot be cast to
com.hp.hpl.jena.query.Dataset
   doing:
     root:
file:///home/yyz/apache-jena-fuseki-2.0.0/config-tdb.ttl#text_dataset
with type: http://jena.apache.org/text#TextDataset assembler class:
class org.apache.jena.query.text.assembler.TextDatasetAssembler

     at
com.hp.hpl.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.openBySpecificType(AssemblerGroup.java:138)

     at
com.hp.hpl.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.open(AssemblerGroup.java:117)

     at
com.hp.hpl.jena.assembler.assemblers.AssemblerGroup$ExpandingAssemblerGroup.open(AssemblerGroup.java:81)

     at
com.hp.hpl.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:52)

     at
com.hp.hpl.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:48)

     at
org.apache.jena.fuseki.build.Builder.buildDataService(Builder.java:76)
     at
org.apache.jena.fuseki.build.Builder.buildDataAccessPoint(Builder.java:61)
     at
org.apache.jena.fuseki.build.FusekiConfig.servicesAndDatasets(FusekiConfig.java:133)

     at
org.apache.jena.fuseki.build.FusekiConfig.readConfigFile(FusekiConfig.java:75)

     at
org.apache.jena.fuseki.server.FusekiServer.initServerConfiguration(FusekiServer.java:248)

     at
org.apache.jena.fuseki.server.FusekiServer.initializeDataAccessPoints(FusekiServer.java:216)

     at
org.apache.jena.fuseki.server.FusekiServerListener.init(FusekiServerListener.java:70)

     at
org.apache.jena.fuseki.server.FusekiServerListener.contextInitialized(FusekiServerListener.java:45)

     at
org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:799)

     at
org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:446)

     at
org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:791)

     at
org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:296)

     at
org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1347)

     at
org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:743)

     at
org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:492)
     at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:69)

     at
org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:117)

     at org.eclipse.jetty.server.Server.start(Server.java:355)
     at
org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:99)

     at
org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:60)

     at org.eclipse.jetty.server.Server.doStart(Server.java:324)
     at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:69)

     at
org.apache.jena.fuseki.jetty.JettyFuseki.start(JettyFuseki.java:121)
     at
org.apache.jena.fuseki.cmd.FusekiCmd$FusekiCmdInner.exec(FusekiCmd.java:331)

     at arq.cmdline.CmdMain.mainMethod(CmdMain.java:102)
     at arq.cmdline.CmdMain.mainRun(CmdMain.java:63)
     at arq.cmdline.CmdMain.mainRun(CmdMain.java:50)
     at
org.apache.jena.fuseki.cmd.FusekiCmd$FusekiCmdInner.innerMain(FusekiCmd.java:97)

     at org.apache.jena.fuseki.cmd.FusekiCmd.main(FusekiCmd.java:60)
Caused by: java.lang.ClassCastException:
com.hp.hpl.jena.rdf.model.impl.ModelCom cannot be cast to
com.hp.hpl.jena.query.Dataset
     at
org.apache.jena.query.text.assembler.TextDatasetAssembler.open(TextDatasetAssembler.java:62)

     at
org.apache.jena.query.text.assembler.TextDatasetAssembler.open(TextDatasetAssembler.java:41)

     at
com.hp.hpl.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.openBySpecificType(AssemblerGroup.java:130)

     ... 33 more

Regards,
Yang


On 03/16/2015 04:55 PM, Andy Seaborne wrote:
Hi Yang,

That's really useful.

Was in both cases of
   :text_dataset -> <#tdb_graph> -> <#tdb_ds>
and
   :text_dataset -> <#tdb_ds>

or just the latter.



1.1.1 to 1.1.2. is a maintenance update to Fuseki1.

Fuseki2 server is restructured to make the security work, add the
admin operations so it is quite different, and much better structured,
to Fuseki1.  That said, it does reuse lots of code taken from Fuseki1
- it's a separate code base now.  Server-wise it is supposed to be
compatible with Fuseki1 start-up though it has better ways to run as a
server, hopefully making it easier to use in deployment environments.
And it can run as a WAR.

With the new UI, the task of start-create dataset-load data-make query
can be done without config files.  The new UI is new, and not entirely
finished.


    Andy

On 16/03/15 14:44, Yang Yuanzhe wrote:
Hi Andy,

Ha, your suggestion is to the point precisely. It works after removing
RDFS reasoner, in both 1.1.2 and 2! So it seems the problem is from RDFS
side. From 1.1.1 to 2 is a huge leap, but is there also a big
improvement from 1.1.1 to 1.1.2? They collaborated very well before.

Regards,
Yang

On 03/16/2015 02:29 PM, Andy Seaborne wrote:
Thanks - that suggest it is not Fuseki itself but other changes in
this release.

I don't understand why it's aborting at all, uploads aren't supposed
to abort.

One more question:

What happens if there is no RDFS? Either using a dataset directly for
:text_dataset or just removing the RDFS wrapper on the graph
<#tdb_inf_ds> to <#tdb_graph>.

(OK - that's two questions really - sorry to do this
question-by-question but to produce a replicated test case details
matter. There is quite alot of machinery here so a start is to changes
some of that and see if it is still broken.)

    Andy


On 16/03/15 12:55, Yang Yuanzhe wrote:
Hi Andy,

Thanks for your reminder. We are using 1.1.1. But I just gave a try on
1.1.2. The result was almost the same:
```
13:47:38 INFO  [1] Upload: Graph: default (6 triple(s))
13:47:38 WARN  Exception during abort (operation attempts to
continue):
Can't abort a write lock-transaction
13:47:38 INFO  [1] 500 Server Error (222 ms)
```

Regards,
Yang

On 03/16/2015 01:31 PM, Andy Seaborne wrote:
Hi Yang,

One quick question - does your configuration work with Fuseki 1.1.2?
It was released at the same time as Fuseki2 (last Friday).

It would help in knowing if this is a text indexing issue of a Fuseki
server issue.  2.0.0 and 1.1.2 use the same text indexing code.

    Andy

On 16/03/15 12:03, Yang Yuanzhe wrote:
Hi there,

We upgraded to Fuseki 2 as soon as it is released. However the
configuration file we are using for Fuseki 1 is no longer working
(or
compatible?) with Fuseki 2. We spent quite a lot of time to tune it
but
we failed. There is no sufficient reference for this issue on your
website, either. That's why we are writing to you to seek some help.
Sorry to trouble you and thank you very much in advance.

We want to use TDB with RDFS reasoning and full text search, the
corresponding config file used in Fuseki 1 is as follows:

```
@prefix :        <#> .
@prefix fuseki: <http://jena.apache.org/fuseki#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix tdb: <http://jena.hpl.hp.com/2008/tdb#> .
@prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> .
@prefix text: <http://jena.apache.org/text#> .
@prefix spatial: <http://jena.apache.org/spatial#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .

[] a fuseki:Server ;
    fuseki:services (
      <#tdb>
    ) .

# Custom code.
[] ja:loadClass "com.hp.hpl.jena.tdb.TDB" .

# TDB
tdb:DatasetTDB  rdfs:subClassOf  ja:RDFDataset .
tdb:GraphTDB    rdfs:subClassOf  ja:Model .

<#tdb> a fuseki:Service ;
fuseki:name "tdb" ; # http://host/tdb
     fuseki:serviceQuery      "sparql" ;          # SPARQL query
service
     fuseki:serviceQuery      "query" ;
     fuseki:serviceUpdate     "update" ;
     fuseki:serviceUpload     "upload" ;          # Non-SPARQL
upload
service
     fuseki:serviceReadGraphStore    "get" ;
     fuseki:serviceReadWriteGraphStore    "data" ;
     fuseki:dataset           :text_dataset ;
     .

# ---- RDFS Inference models
# These must be incorporate in a dataset in order to use them.
# All in one file.
<#tdb_inf_ds> a ja:RDFDataset ;
     ja:defaultGraph       <#tdb_inf> ;
     .

<#tdb_inf> a ja:InfModel ;
     rdfs:label "RDFS Inference Model" ;
     ja:baseModel <#tdb_graph> ;
     ja:reasoner
          [ ja:reasonerURL
<http://jena.hpl.hp.com/2003/RDFSExptRuleReasoner> ]
     .

<#tdb_graph> a tdb:GraphTDB ;
     tdb:dataset <#tdb_ds> .

# A TDB datset used for RDF storage
<#tdb_ds> a tdb:DatasetTDB;
     tdb:location "Data";
     .

## Initialize text query
[] ja:loadClass "org.apache.jena.query.text.TextQuery" .
# A TextDataset is a regular dataset with a text index.
text:TextDataset      rdfs:subClassOf ja:RDFDataset .
# Lucene index
text:TextIndexLucene  rdfs:subClassOf text:TextIndex .
# Solr index
#text:TextIndexSolr    rdfs:subClassOf text:TextIndex .

:text_dataset a text:TextDataset ;
     text:dataset   <#tdb_inf_ds> ;
     text:index     <#textIndexLucene> ;
     .

<#textIndexLucene> a text:TextIndexLucene ;
     #text:directory <file:Text> ;
     text:directory "mem" ;
     text:entityMap <#entMap> ;
     .

<#entMap> a text:EntityMap ;
     text:entityField      "uri" ;
     text:defaultField     "text" ;
     text:map (
          [ text:field "text" ; text:predicate rdfs:label ]
          ) .
```

Here is some test input:
```
@prefix cc: <http://creativecommons.org/ns#> .
@prefix dct: <http://purl.org/dc/terms/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix locn: <http://www.w3.org/ns/locn#> .
@prefix org: <http://www.w3.org/ns/org#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix pav: <http://purl.org/pav/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix schema: <http://schema.org/> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

<http://id.vlaanderen.be/licentie/open-data-licentie-tegen-billijke-vergoeding-1.2#id>




   rdf:type cc:License ;
   cc:legalcode
<http://opendataforum.info/Docs/licenties/GOD_BV.htm> ;
   dct:title "Modellicentie 3 - Open Data Licentie tegen Billijke
Vergoeding - v1.2"@nl ;
   pav:hasEarlierVersion
<http://id.vlaanderen.be/licentie/open-data-licentie-tegen-billijke-vergoeding#id>



;
   pav:version "1.2"^^xsd:string ;
   rdfs:label "Modellicentie 3 - Open Data Licentie tegen Billijke
Vergoeding"@nl ;
.
```

Delete existing datasets, start a new instance with config file,
upload
the test input to the dataset, and we are stuck:
```
[2015-03-16 12:21:44] Fuseki     INFO  [12] Filename: test.ttl,
Content-Type=text/turtle, Charset=null => Turtle : Count=6 Triples=6
Quads=0
[2015-03-16 12:21:44] HttpAction WARN  Exception during abort
(operation
attempts to continue): Can't abort a write lock-transaction
[2015-03-16 12:21:44] Fuseki     INFO  [12] 500 Server Error (199
ms)
```

If we ask Fuseki to list all triples now, we can discover that the
triple for "rdfs:label" exists, but all other triples are missing.

So we tried an indirect approach: delete the triple for
"rdfs:label",
the upload succeeds; then insert this triple:
```
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
INSERT DATA {
<http://id.vlaanderen.be/licentie/open-data-licentie-tegen-billijke-vergoeding-1.2#id>




rdfs:label "Modellicentie 3 - Open Data Licentie tegen Billijke
Vergoeding"@nl .
}
```

However, we got an exception:
```
[2015-03-16 12:33:37] Fuseki     INFO  [14] POST
http://localhost:3030/tdb/update
[2015-03-16 12:33:37] Fuseki INFO [14] POST /tdb :: 'update' ::
[application/x-www-form-urlencoded charset=UTF-8] ?
[2015-03-16 12:33:37] HttpAction WARN  Exception during abort
(operation
attempts to continue): Can't abort a write lock-transaction
java.lang.NullPointerException
     at
org.apache.jena.query.text.TextDocProducerTriples.change(TextDocProducerTriples.java:66)




     at
com.hp.hpl.jena.sparql.core.DatasetGraphMonitor.record(DatasetGraphMonitor.java:194)




     at
com.hp.hpl.jena.sparql.core.DatasetGraphMonitor.add$(DatasetGraphMonitor.java:120)




     at
com.hp.hpl.jena.sparql.core.DatasetGraphMonitor.add(DatasetGraphMonitor.java:96)




     at
com.hp.hpl.jena.sparql.core.DatasetGraphWrapper.add(DatasetGraphWrapper.java:88)




     at
com.hp.hpl.jena.sparql.modify.UpdateEngineWorker.addToGraphStore(UpdateEngineWorker.java:555)




     at
com.hp.hpl.jena.sparql.modify.UpdateEngineWorker.visit(UpdateEngineWorker.java:315)




     at
com.hp.hpl.jena.sparql.modify.request.UpdateDataInsert.visit(UpdateDataInsert.java:27)




     at
com.hp.hpl.jena.sparql.modify.UpdateVisitorSink.send(UpdateVisitorSink.java:46)




     at
com.hp.hpl.jena.sparql.modify.UpdateVisitorSink.send(UpdateVisitorSink.java:26)




     at
org.apache.jena.atlas.iterator.Iter.sendToSink(Iter.java:695)
     at
org.apache.jena.atlas.iterator.Iter.sendToSink(Iter.java:702)
     at
com.hp.hpl.jena.sparql.modify.UpdateProcessorBase.execute(UpdateProcessorBase.java:61)




     at
com.hp.hpl.jena.update.UpdateAction.execute$(UpdateAction.java:234)
     at
com.hp.hpl.jena.update.UpdateAction.execute(UpdateAction.java:224)
     at
com.hp.hpl.jena.update.UpdateAction.execute(UpdateAction.java:204)
     at
com.hp.hpl.jena.update.UpdateAction.execute(UpdateAction.java:186)
     at
org.apache.jena.fuseki.servlets.SPARQL_Update.execute(SPARQL_Update.java:222)




     at
org.apache.jena.fuseki.servlets.SPARQL_Update.executeForm(SPARQL_Update.java:197)




     at
org.apache.jena.fuseki.servlets.SPARQL_Update.perform(SPARQL_Update.java:105)




     at
org.apache.jena.fuseki.servlets.ActionSPARQL.executeLifecycle(ActionSPARQL.java:130)




     at
org.apache.jena.fuseki.servlets.SPARQL_UberServlet.serviceDispatch(SPARQL_UberServlet.java:324)




     at
org.apache.jena.fuseki.servlets.SPARQL_UberServlet.executeAction(SPARQL_UberServlet.java:236)




     at
org.apache.jena.fuseki.servlets.ActionSPARQL.execCommonWorker(ActionSPARQL.java:84)




     at
org.apache.jena.fuseki.servlets.ActionBase.doCommon(ActionBase.java:81)


     at
org.apache.jena.fuseki.servlets.FusekiFilter.doFilter(FusekiFilter.java:71)



     at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1632)




     at
org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61)




     at
org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)




     at
org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)




     at
org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)




     at
org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)




     at
org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)




     at
org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)




     at
org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)




     at
org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)




     at
org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)




     at
org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)




     at
org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)




     at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1624)




     at
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:550)



     at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)




     at
org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:568)



     at
org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:221)




     at
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1110)




     at
org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:479)



     at
org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:183)




     at
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1044)




     at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)




     at
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)




     at org.eclipse.jetty.server.Server.handle(Server.java:459)
     at
org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:281)
     at
org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:232)



     at
org.eclipse.jetty.io.AbstractConnection$1.run(AbstractConnection.java:505)



     at
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:607)




     at
org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:536)




     at java.lang.Thread.run(Thread.java:745)
[2015-03-16 12:33:37] Fuseki     INFO  [14] 500 Server Error (163
ms)
```

Then we stopped our trials because we can't find more possibilities. Does anybody have any clue about it? Thank you in advance and have a
nice day.

Regards,
Yang









Reply via email to