Hi Andy!
Follow in attached the configuration file.

Em sex, 10 de ago de 2018 às 09:35, Andy Seaborne <a...@apache.org>
escreveu:

> Alysson,
>
> It needs to be a fuseki configuration file for -conf, not just use the
> daatset .
>
>
> http://jena.apache.org/documentation/query/text-query.html#working-with-fuseki
>
>
> <#service_text> rdf:type fuseki:Service ;
> ....
>      fuseki:dataset                  :text_dataset ;
>
> ### This is the assembler for the text dataset ...
> :text_dataset rdf:type text:TextDataset;
>      text:index ....
>      text:dataset ...
>
>
> If you had that in index.ttl, please post the file so we can see what it
> says.
>
>      Andy
>
>
>
> On 08/08/18 18:19, Alysson Gomes wrote:
> > Rob, I tried to load the configuration file (the index.ttl) in the Fuseki
> > with the following command:
> >
> > ./fuseki-server --conf
> >
> /home/alysson/Documents/PUC-Rio/TestJena/tdb-citation-data-en-fuseki-index/index.ttl
> >
> > but when tried run the query [1] appeared this in the logs:
> >
> > TextQueryPF WARN  Failed to find the text index: tried context and as a
> > text-enabled dataset
> > TextQueryPF WARN  No text index - no text search performed
> >
> > I searched in google, but not appeared nothing useful. Do you have some
> > suggestion?
> >
> > [1] Query
> > PREFIX text: <http://jena.apache.org/text#>
> > SELECT ?s ?o
> > WHERE {
> > ?s text:query( <http://dbpedia.org/property/first> "David") ;
> > <http://dbpedia.org/property/first> ?o
> > }
> >
> >
> > Em ter, 7 de ago de 2018 às 05:46, Rob Vesse <rve...@dotnetrdf.org>
> > escreveu:
> >
> >> Alysson
> >>
> >> It was briefly discussed on the dev list.  The conclusion is that what
> you
> >> are trying to do isn't supported as a pure command line task currently.
> >> You will need to write code or use the Fuseki web server to achieve what
> >> you want
> >>
> >> Rob that
> >>
> >> On 06/08/2018, 18:15, "Alysson Gomes" <alyssonas...@gmail.com> wrote:
> >>
> >>      Hi Rob!
> >>      Still about this problem of indexing, do you have some suggestion?
> >>
> >>      Em qui, 19 de jul de 2018 às 13:59, Alysson Gomes <
> >> alyssonas...@gmail.com>
> >>      escreveu:
> >>
> >>      > I did, but as you told the sparql launched an exception:
> >>      > org.apache.jena.sparql.ARQException: Found two matches: var
> ?root ->
> >>      > http://localhost/jena_example/#text_dataset,
> >>      >
> >>
> file:///home/alysson/Documents/PUC-Rio/TestJena/tdb-citation-data-en-fuseki-index/index.ttl#dataset
> >>      >
> >>      >
> >>      > Em qui, 19 de jul de 2018 às 13:13, Rob Vesse <
> rve...@dotnetrdf.org>
> >>      > escreveu:
> >>      >
> >>      >> No I can't, the documentation is doing the right thing. A text
> >> dataset is
> >>      >> fundamentally a wrapper around another dataset so any text
> indexing
> >> config
> >>      >> will always require at least two datasets in the configuration
> file.
> >>      >>
> >>      >> Did you try using the sparql tool instead as I suggested?
> >>      >>
> >>      >> Rob
> >>      >>
> >>      >> On 19/07/2018, 15:25, "Alysson Gomes" <alyssonas...@gmail.com>
> >> wrote:
> >>      >>
> >>      >>     Are do you can send an example of a configuration file with
> >> only one
> >>      >>     dataset that contains the index? Because I'm based me in the
> >> examples
> >>      >> of
> >>      >>     the documentation (is must similar to the configuration
> that I'm
> >>      >> using).
> >>      >>
> >>      >>     Em qui, 19 de jul de 2018 às 10:04, Rob Vesse <
> >> rve...@dotnetrdf.org>
> >>      >>     escreveu:
> >>      >>
> >>      >>     > Thanks, so your problem was as I suspected
> >>      >>     >
> >>      >>     > You use tdbquery which does not understand text indexes
> using
> >> it as
> >>      >> you
> >>      >>     > do.  By using --loc you are only querying your base
> dataset,
> >> this
> >>      >> does not
> >>      >>     > include your text index so you don't get any results.
> >>      >>     >
> >>      >>     > I would try using the base sparql tool instead passing in
> your
> >>      >>     > configuration file i.e.
> >>      >>     >
> >>      >>     > sparql --desc=index.ttl --query=queries.rq
> >>      >>     >
> >>      >>     > I am not 100% sure this will work because there are two
> >> datasets
> >>      >> defined
> >>      >>     > in your config file (the base dataset and the text indexed
> >> dataset)
> >>      >> and I
> >>      >>     > am not sure which one the sparql tool will pick by default
> >>      >>     >
> >>      >>     > Rob
> >>      >>     >
> >>      >>     >
> >>      >>     >
> >>      >>     >
> >>      >>     > On 19/07/2018, 13:47, "Alysson Gomes" <
> >> alyssonas...@gmail.com>
> >>      >> wrote:
> >>      >>     >
> >>      >>     >     I'm using the file bin of the Jena:
> >>      >>     >     *tdbquery
> >>      >>     >
> >>      >>
> --loc=/home/alysson/Documents/PUC-Rio/TestJena/tdb-citation-data-en
> >>      >>     >     --query=queries.rq*
> >>      >>     >
> >>      >>     >     file *queries.rq*:
> >>      >>     >     *prefix text: <http://jena.apache.org/text#
> >>      >>     >     <http://jena.apache.org/text#>>select ?s ?owhere{
> ?s
> >>      >> text:query(
> >>      >>     >     <http://dbpedia.org/property/first <
> >>      >> http://dbpedia.org/property/first
> >>      >>     > >>
> >>      >>     >     "David") ;    <http://dbpedia.org/property/first
> >>      >>     >     <http://dbpedia.org/property/first>> ?o}*
> >>      >>     >
> >>      >>     >     Em qui, 19 de jul de 2018 às 05:56, Rob Vesse <
> >>      >> rve...@dotnetrdf.org>
> >>      >>     >     escreveu:
> >>      >>     >
> >>      >>     >     > You still didn’t state how you execute the query,
> you
> >> included
> >>      >>     > commands
> >>      >>     >     > for creating the database and index but not the
> >> command/code
> >>      >> that
> >>      >>     > actually
> >>      >>     >     > makes the query
> >>      >>     >     >
> >>      >>     >     >
> >>      >>     >     >
> >>      >>     >     > Please show exactly how you are submitting your
> query
> >>      >>     >     >
> >>      >>     >     >
> >>      >>     >     >
> >>      >>     >     > Rob
> >>      >>     >     >
> >>      >>     >     >
> >>      >>     >     >
> >>      >>     >     > From: Alysson Gomes <alyssonas...@gmail.com>
> >>      >>     >     > Reply-To: <users@jena.apache.org>
> >>      >>     >     > Date: Wednesday, 18 July 2018 at 20:15
> >>      >>     >     > To: <users@jena.apache.org>
> >>      >>     >     > Subject: Re: Question about indexing in text search
> >>      >>     >     >
> >>      >>     >     >
> >>      >>     >     >
> >>      >>     >     > Are using the following commands:
> >>      >>     >     >
> >>      >>     >     >
> >>      >>     >     >
> >>      >>     >     > Loading dataset
> >>      >>     >     >
> >>      >>     >     > $JENAROOT/bin/tdbloader
> >>      >>     >     >
> >>      >>
> -loc=/home/alysson/Documents/PUC-Rio/TestJena/tdb2-citation-data-en
> >>      >>     >     > tdb_citation.ttl
> >>      >>     >     >
> >>      >>     >     >
> >>      >>     >     >
> >>      >>     >     > Create index:
> >>      >>     >     >
> >>      >>     >     > java -cp
> >>      >>     >     >
> >>      >>     >
> >>      >>
> >>
> /home/alysson/MEGA/Computação/ApacheJena/apache-jena-fuseki-3.8.0/fuseki-server.jar
> >>      >>     >     > jena.textindexer --desc=index.ttl
> >>      >>     >     >
> >>      >>     >     >
> >>      >>     >     >
> >>      >>     >     > While the command above is running appear the
> following
> >>      >> result:
> >>      >>     >     >
> >>      >>     >     >
> >>      >>     >     >
> >>      >>     >     > After the creation of the index, I execute the
> query:
> >>      >>     >     >
> >>      >>     >     >
> >>      >>     >     >
> >>      >>     >     > prefix text: <http://jena.apache.org/text#>
> >>      >>     >     >
> >>      >>     >     > select ?s ?o
> >>      >>     >     >
> >>      >>     >     > where{
> >>      >>     >     >
> >>      >>     >     >     ?s text:query( <
> http://dbpedia.org/property/first>
> >>      >> "David") ;
> >>      >>     >     >
> >>      >>     >     >     <http://dbpedia.org/property/first> ?o
> >>      >>     >     >
> >>      >>     >     > }
> >>      >>     >     >
> >>      >>     >     >
> >>      >>     >     >
> >>      >>     >     > These are all commands that I'm using.
> >>      >>     >     >
> >>      >>     >     >
> >>      >>     >     >
> >>      >>     >     > Em qua, 18 de jul de 2018 às 13:13, Rob Vesse <
> >>      >> rve...@dotnetrdf.org>
> >>      >>     >     > escreveu:
> >>      >>     >     >
> >>      >>     >     > There is nothing obviously wrong with your
> >> configuration.
> >>      >> You still
> >>      >>     >     > haven’t shown the code that you are using with this
> >>      >> configuration to
> >>      >>     > make
> >>      >>     >     > your query.
> >>      >>     >     >
> >>      >>     >     >
> >>      >>     >     >
> >>      >>     >     > My guess would be that perhaps your code is loading
> in
> >> the
> >>      >> base
> >>      >>     > dataset
> >>      >>     >     > without the indexing support i.e. you may be
> querying
> >> the base
> >>      >>     > dataset
> >>      >>     >     > rather than the text dataset, but without having
> seen
> >> your
> >>      >> code
> >>      >>     > that’s only
> >>      >>     >     > a guess.
> >>      >>     >     >
> >>      >>     >     >
> >>      >>     >     >
> >>      >>     >     > Rob
> >>      >>     >     >
> >>      >>     >     >
> >>      >>     >     >
> >>      >>     >     > From: Alysson Gomes <alyssonas...@gmail.com>
> >>      >>     >     > Reply-To: <users@jena.apache.org>
> >>      >>     >     > Date: Wednesday, 18 July 2018 at 14:55
> >>      >>     >     > To: <users@jena.apache.org>
> >>      >>     >     > Subject: Re: Question about indexing in text search
> >>      >>     >     >
> >>      >>     >     >
> >>      >>     >     >
> >>      >>     >     > Hi Rob!
> >>      >>     >     >
> >>      >>     >     > I attached the file with the code of the text index
> >> (file
> >>      >> index.ttl)
> >>      >>     > but
> >>      >>     >     > to facility it, follow the image:
> >>      >>     >     >
> >>      >>     >     >
> >>      >>     >     >
> >>      >>     >     > Error! Filename not specified.
> >>      >>     >     >
> >>      >>     >     > I'm using the same queries of the previous mail.
> Case
> >> has
> >>      >> something
> >>      >>     > wrong,
> >>      >>     >     > please indicate it some solution.
> >>      >>     >     >
> >>      >>     >     >
> >>      >>     >     >
> >>      >>     >     > Em qua, 18 de jul de 2018 às 10:12, Rob Vesse <
> >>      >> rve...@dotnetrdf.org>
> >>      >>     >     > escreveu:
> >>      >>     >     >
> >>      >>     >     > This is a misunderstanding, not a bug.  Property
> >> functions
> >>      >> use the
> >>      >>     > SPARQL
> >>      >>     >     > collection syntax i.e. ( <
> >> http://dbpedia.org/property/first>
> >>      >>     > “David”) to
> >>      >>     >     > pass arguments to the function which is given as the
> >>      >> predicate, in
> >>      >>     > this
> >>      >>     >     > case text:query. The rdf:first/rdf:rest you see in
> the
> >> logs is
> >>      >>     > simply the
> >>      >>     >     > expansion of that into triple patterns which later
> gets
> >>      >> extracted
> >>      >>     > out into
> >>      >>     >     > the actual property function call.  The fact that
> those
> >>      >> happen to be
> >>      >>     >     > similar to the property you’re are trying to search
> on
> >> is
> >>      >> purely
> >>      >>     >     > coincidental.
> >>      >>     >     >
> >>      >>     >     >
> >>      >>     >     >
> >>      >>     >     > If your query is not working as expected then the
> actual
> >>      >> problem is
> >>      >>     >     > elsewhere, likely in the configuration of your text
> >> index.
> >>      >> So you
> >>      >>     > would
> >>      >>     >     > need to share that configuration and show how you
> >> actually
> >>      >> execute
> >>      >>     > your
> >>      >>     >     > query if you want further help with this.
> >>      >>     >     >
> >>      >>     >     >
> >>      >>     >     >
> >>      >>     >     > Regards,
> >>      >>     >     >
> >>      >>     >     >
> >>      >>     >     > Rob
> >>      >>     >     >
> >>      >>     >     >
> >>      >>     >     >
> >>      >>     >     > From: Alysson Gomes <alyssonas...@gmail.com>
> >>      >>     >     > Reply-To: <users@jena.apache.org>
> >>      >>     >     > Date: Wednesday, 18 July 2018 at 13:42
> >>      >>     >     > To: "users@jena.apache.org" <users@jena.apache.org>
> >>      >>     >     > Subject: Question about indexing in text search
> >>      >>     >     >
> >>      >>     >     > Hello, my name is Alysson, I am a master's student
> in
> >> the
> >>      >> Pontifical
> >>      >>     >     > Catholic University of Rio de Janeiro and am having
> >> problems
> >>      >> with the
> >>      >>     >     > indexing in text search.
> >>      >>     >     >
> >>      >>     >     > In the attach 1 contains the assembler that I'm
> using
> >> for to
> >>      >> index
> >>      >>     > the
> >>      >>     >     > triples that contain the predicate <
> >>      >>     > http://dbpedia.org/property/first>.
> >>      >>     >     >
> >>      >>     >     > My goal is to reproduce the query [1] using an
> index,
> >> but the
> >>      >>     > problem is
> >>      >>     >     > that when I execute the query [2] the URI used by
> the
> >> query
> >>      >>     > processor is
> >>      >>     >     > different of the URI that I am using in the
> predicate,
> >> as
> >>      >> show image
> >>      >>     > below:
> >>      >>     >     >
> >>      >>     >     >
> >>      >>     >     > Error! Filename not specified.
> >>      >>     >     >
> >>      >>     >     > As show in the image above, the query processor uses
> >> the URI <
> >>      >>     >     > http://www.w3.org/1999/02/22-rdf-syntax-ns>
> generating
> >> a
> >>      >> result
> >>      >>     >     > incorrect.
> >>      >>     >     >
> >>      >>     >     > I want to know if it is possible to change this or
> if I
> >> am
> >>      >> doing some
> >>      >>     >     > wrong.
> >>      >>     >     >
> >>      >>     >     > Since I thank you for the help.
> >>      >>     >     >
> >>      >>     >     >
> >>      >>     >     >
> >>      >>     >     >
> >>      >>     >     >
> >>      >>     >     > [1]: Query
> >>      >>     >     >
> >>      >>     >     > SELECT ?s ?o
> >>      >>     >     >
> >>      >>     >     > WHERE {
> >>      >>     >     >
> >>      >>     >     > ?s <http://dbpedia.org/property/first> ?o
> >>      >>     >     >
> >>      >>     >     > filter regex(?o, "David", "i")
> >>      >>     >     >
> >>      >>     >     > }
> >>      >>     >     >
> >>      >>     >     >
> >>      >>     >     >
> >>      >>     >     > [2]: Query
> >>      >>     >     >
> >>      >>     >     > PREFIX text: <http://jena.apache.org/text#>
> >>      >>     >     >
> >>      >>     >     > SELECT ?s ?o
> >>      >>     >     >
> >>      >>     >     > WHERE {
> >>      >>     >     >
> >>      >>     >     > ?s text:query( <http://dbpedia.org/property/first>
> >> "David") ;
> >>      >>     >     >
> >>      >>     >     > <http://dbpedia.org/property/first> ?o
> >>      >>     >     >
> >>      >>     >     > }
> >>      >>     >     >
> >>      >>     >     >
> >>      >>     >
> >>      >>     >
> >>      >>     >
> >>      >>     >
> >>      >>     >
> >>      >>     >
> >>      >>
> >>      >>
> >>      >>
> >>      >>
> >>      >>
> >>      >>
> >>
> >>
> >>
> >>
> >>
> >>
> >
>
#java -cp /home/alysson/MEGA/Computação/ApacheJena/apache-jena-fuseki-3.8.0/fuseki-server.jar tdb.tdbloader --tdb=index.ttl tdb_citation_data_en.ttl 
#java -cp /home/alysson/MEGA/Computação/ApacheJena/apache-jena-fuseki-3.8.0/fuseki-server.jar jena.textindexer --desc=index.ttl 


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

<#service_text_tdb> rdf:type fuseki:Service ;
    fuseki:name                     "citation" ;
    fuseki:serviceQuery             "query" ;
    fuseki:serviceQuery             "sparql" ;
    fuseki:serviceUpdate            "update" ;
    fuseki:serviceUpload            "upload" ;
    fuseki:serviceReadGraphStore    "get" ;
    fuseki:serviceReadWriteGraphStore    "data" ;
    fuseki:dataset                  <#database> .

[] ja:loadClass "org.apache.jena.tdb.TDB" .
tdb:DatasetTDB  rdfs:subClassOf  ja:RDFDataset .
tdb:GraphTDB    rdfs:subClassOf  ja:Model .

## Initialize text query
[] ja:loadClass       "org.apache.jena.query.text.TextQuery" .
text:TextDataset      rdfs:subClassOf   ja:RDFDataset .
text:TextIndexLucene  rdfs:subClassOf   text:TextIndex .


:text_dataset rdf:type text:TextDataset ;
    text:dataset   <#database> ;
    text:index     <#indexLucene> ;
    .

<#database> rdf:type tdb:DatasetTDB ;
    tdb:location "/home/alysson/Documents/PUC-Rio/TestJena/tdb-citation-data-en-fuseki-index" ;
    .

# Text index description
<#indexLucene> a text:TextIndexLucene ;
    text:directory <file:/home/alysson/Documents/PUC-Rio/TestJena/tdb-citation-data-en-fuseki-index> ;
    text:entityMap <#entMap> ;
    .

<#entMap> a text:EntityMap ;
    text:defaultField     "first" ;
    text:entityField      "uri" ;
    text:storeValues	true ;
    text:map (
        [ 
        	text:field "first" ; 
           	text:predicate <http://dbpedia.org/property/first>
	]
    ).

Reply via email to