Re: [Tracker] Is this RDF query correct?



Laurent Aguerreche wrote:
Hello,

I try to use this RDF query:

<rdfq:Condition>
  <rdfq:and>

    <rdfq:or>

      <rdfq:contains>
        <rdfq:Property name="Doc.Title" />
        <rdf:String>opengl</rdf:String>
      </rdfq:contains>

      <rdfq:contains>
        <rdfq:Property name="Doc.Subject" />
        <rdf:String>opengl</rdf:String>
      </rdfq:contains>

      <rdfq:contains>
        <rdfq:Property name="Doc.Keywords" />
        <rdf:String>opengl</rdf:String>
      </rdfq:contains>

      <rdfq:contains>
        <rdfq:Property name="Doc.Comments" />
        <rdf:String>opengl</rdf:String>
      </rdfq:contains>

    </rdfq:or>

    <rdfq:contains>
      <rdfq:Property name="File.Format" />
      <rdf:String>pdf</rdf:String>
    </rdfq:contains>

  </rdfq:and>
</rdfq:Condition>


and it fails with this message :

Error in rdf query parse: Line 12 character 1: CONTAINS element not
expected here


What is the problem? How can I do a OR between numerous 'contains'
encapsulated itself in a AND? Is it legal?

it should be but most likely its a bug.

check start_element_handler in tracker-rdf-query.c

the "state" variable refers to the previous entry on the query stack.

looking at lines 626-628, the fail check is not expecting </rdfq:or> or any logic end state. I would guess adding :

|| is_end_logic (state)

to the failcheck condition should make it okay. This would need to be added to all the operators in that function.

Im afraid the parser checking of rdf query is not as good as it could be.


--
Mr Jamie McCracken
http://jamiemcc.livejournal.com/




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]