Jérôme wrote:
> Le 11/10/11 11:14, Paolo Castagna a écrit :
>>
>> Jérôme wrote:
>>> Le 11/10/11 10:08, Andy Seaborne a écrit :
>>>> Jérôme,
>>>>
>>>> Sorry if you've said this before in previous emails but what's the
>>>> query and what's the data like?  When did you last update LARQ?
>>> Hi Andy,
>>>
>>> I did my last LARQ update 2 days ago. The problem is not about datas,
>>> because the result is the same with the books.ttl file: 0 result with a
>>> very simple query like:
>>>
>>>   PREFIX pf:<http://jena.hpl.hp.com/ARQ/property#>
>>>   SELECT ?doc
>>>   {
>>>     ?lit pf:textMatch 'Potter' .
>>>     ?doc ?p ?lit
>>>   }
>>>> I'm trying to find out if something in the chain of packages has
>>>> changed and whether we've introduced a a regression in ARQ or LARQ.
>>>>
>>>> The only ARQ change I can think of relates to named graphs but you're
>>>> not using named graphs and the change to correctly handle property
>>>> functions would only go from 0 to some results.
>>>>
>>>> You have the same data available via<#books>  and via<#dataset>  --
>>>> does the query work one route and not the other or are both now
>>>> showing 0 results?
>>> No, simple SPARQL queries works fine. I only have problem on the lucene
>>> indexed datas with LARQ queries.
>> The problem is that somehow your Lucene index is empty or non existing.
>>
>> If the /tmp/lucene directory exists and it's empty or it contains an
>> empty Lucene index when you start Fuseki. LARQ will *not* index your
>> data.
>>
>> LARQ will index your data if and only if you point it at a non existing
>> directory. When you start Fuseki, LARQ should create the /tmp/lucene
>> directory for you and index your data.
>>
>> When I need to debug problems involving Lucene indexes I use:
>> http://www.getopt.org/luke/luke-0.9.9/lukemin-0.9.9.jar
>> ... it's very useful to inspect a Lucene index. I suspect yours is
>> empty or non-existing.
>>
>> You can also try to use larq.larqbuilder to build your Lucene index
>> manually at the beginning, but it would be much better if LARQ does
>> automatically this for you (as it should be). Try this:
>>
>>   1. make sure Fuseki or your app is not running
>>   2. java -cp fuseki-0.2.1-SNAPSHOT-sys.jar larq.larqbuilder \
>>      --allow-duplicates --larq=/tmp/lucene \
>>      --desc=/path/to/your/fuseki/config.ttl
>>      (one line!)
>>   3. check your Lucene index in the /tmp/lucene directory
>>   4. start Fuseki as usual
>>
> 
> The larqbuilder command-line failed:
> java -cp target/fuseki-0.2.1-SNAPSHOT-sys.jar larq.larqbuilder
> --allow-duplicates --larq=/tmp/lucene --desc=config.ttl
> com.hp.hpl.jena.sparql.ARQException: More than one: var ?root
>     at
> com.hp.hpl.jena.sparql.util.QueryExecUtils.getOne(QueryExecUtils.java:354)
>     at
> com.hp.hpl.jena.sparql.util.graph.GraphUtils.findRootByType(GraphUtils.java:191)
> 
>     at
> com.hp.hpl.jena.sparql.core.assembler.AssemblerUtils.build(AssemblerUtils.java:97)
> 
>     at arq.cmdline.ModAssembler.create(ModAssembler.java:67)
>     at
> arq.cmdline.ModDatasetAssembler.createDataset(ModDatasetAssembler.java:43)
>     at arq.cmdline.ModDataset.getDataset(ModDataset.java:34)
>     at larq.larqbuilder.exec(larqbuilder.java:84)
>     at arq.cmdline.CmdMain.mainMethod(CmdMain.java:97)
>     at arq.cmdline.CmdMain.mainRun(CmdMain.java:59)
>     at arq.cmdline.CmdMain.mainRun(CmdMain.java:46)
>     at larq.larqbuilder.main(larqbuilder.java:50)

Ok, this is because larq.larqbuilder command does not support multiple datasets
(as they have been introduced only recently in Fuseki's config format).

Could you try to remove this from your config.ttl:

<#books>      rdf:type ja:RDFDataset ;
      rdfs:label "Books" ;
      ja:defaultGraph
        [ rdfs:label "discours_de_la_methode.rdf" ;
          a ja:MemoryModel ;
          ja:content [ja:externalContent<file:Data/file.rdf>   ] ;
        ] ;
      .

And, make sure you have only one dataset (i.e. <#dataset> rdf:type 
tdb:DatasetTDB)?

Try again:

  1. make sure Fuseki or your app is not running
  2. rm -rf /tmp/lucene
  3. java -cp fuseki-0.2.1-SNAPSHOT-sys.jar larq.larqbuilder \
      --allow-duplicates --larq=/tmp/lucene \
      --desc=/path/to/your/fuseki/config.ttl
      (one line!)
  4. check your Lucene index in the /tmp/lucene directory
  5. start Fuseki as usual


larq.larqbuilder source code is here:
https://svn.apache.org/repos/asf/incubator/jena/Jena2/LARQ/trunk/src/main/java/larq/larqbuilder.java

Once again, ideas on how to improve it (and patches) are welcome!

Paolo

> 
> 
> The /tmp/lucene dir is created, with the empty write.lock file.
> 
>> Does this work for you?
>>
>> Paolo
>>
>>> Jérôme
>>>>      Andy
>>>>
>>>>
>>>>
>>>> On 10/10/11 17:01, Paolo Castagna wrote:
>>>>> Hi Jérôme,
>>>>> first of all, thanks for helping out testing the LARQ
>>>>> 0.2.2-incubating-SNAPSHOT
>>>>> and for your patience. ;-)
>>>>>
>>>>> This hopefully will help to spot problems early one and reduce
>>>>> problems once ARQ
>>>>> and LARQ are released within Apache.
>>>>>
>>>>> Jérôme wrote:
>>>>>> Hi,
>>>>>>
>>>>>> i've recently made an svn up on my LARQ directory.
>>>>>>
>>>>>> Now, my LARQ queries return 0 solution (they returned before).
>>>>>>
>>>>>> I'm using:
>>>>>> - fuseki 0.2.1-SNAPSHOT
>>>>>> -arq 2.8.9-SNAPSHOT
>>>>>> -larq 0.2.2-incubating-SNAPSHOT
>>>>> According to the LARQ's pom.xml file [1], LARQ
>>>>> 0.2.2-incubating-SNAPSHOT now
>>>>> depends on the new ARQ SNAPSHOTs.
>>>>> Precisely, it depends on
>>>>> org.apache.jena:jena-arq:2.8.9-incubating-SNAPSHOT
>>>>> Please note the new groupId and artifactId for ARQ.
>>>>>
>>>>> New ARQ SNAPSHOTs are available here [2].
>>>>>
>>>>>    [1]
>>>>> https://svn.apache.org/repos/asf/incubator/jena/Jena2/LARQ/trunk/pom.xml
>>>>>
>>>>>    [2]
>>>>> https://repository.apache.org/content/repositories/snapshots/org/apache/jena/jena-arq/2.8.9-incubating-SNAPSHOT/
>>>>>
>>>>>
>>>>>
>>>>>> -lucene 3.1.0
>>>>>>
>>>>>> My config.ttl file has not changed:
>>>>>>
>>>>>> [...]
>>>>>> <#books>      rdf:type ja:RDFDataset ;
>>>>>>       rdfs:label "Books" ;
>>>>>>       ja:defaultGraph
>>>>>>         [ rdfs:label "discours_de_la_methode.rdf" ;
>>>>>>           a ja:MemoryModel ;
>>>>>>           ja:content [ja:externalContent<file:Data/file.rdf>   ] ;
>>>>>>         ] ;
>>>>>>       .
>>>>>>
>>>>>> <#dataset>   rdf:type      tdb:DatasetTDB ;
>>>>>>       tdb:location "/tmp/tdb" ;
>>>>>>       ja:textIndex "/tmp/lucene" ;
>>>>>>       # Query timeout on this dataset (milliseconds)
>>>>>>       ja:context [ ja:cxtName "arq:queryTimeout" ;  ja:cxtValue
>>>>>> "1000" ] ;
>>>>>> ##      tdb:unionDefaultGraph true ;
>>>>>>
>>>>>>
>>>>>> Before running the fuseki server, i build my triple store with the
>>>>>> command-line:
>>>>>> java -cp target/fuseki-0.2.1-SNAPSHOT-sys.jar tdb.tdbloader
>>>>>> --loc=/tmp/tdb Data/file.rdf
>>>>> Can you please try:
>>>>>
>>>>>    - stop Fuseki
>>>>>    - delete /tmp/lucence
>>>>>    - restart Fuseki
>>>>>
>>>>> LARQ will now behave like this:
>>>>>
>>>>>    - if the directory exists with a Lucene index, it will leave it
>>>>> untouched
>>>>>    - if the directory does not exists it will create it and index your
>>>>> data
>>>>>
>>>>> What do you have in your /tmp/lucene directory?
>>>>>
>>>>>> So, i've no error - juste 0 result...
>>>>>>
>>>>>> Any ideas?
>>>>>>
>>>>>> Thank you.
>>>>>>
>>>>> Let us know how it goes,
>>>>> Paolo
> 

Reply via email to