On 16/06/15 09:06, Qihong Lin wrote:
Hi,

Thanks! I just marked <GRAPH> mandatory, and it worked without
producing the warnings. I'll look into the details later.

By the way, if the new parser is ready, how to test it? I mean, where
to drop the unit test code and the query strings to be tested? I'm
confused with org.apache.jena.sparql.junit.QueryTest (is that what I
need to deal with?). Any guideline or documentation for arq test?

regards,
Qihong

Most testing of queries is by externally defined manifest files (manifest.ttl)

jena-arq/testing/ARQ

For now, keep it clean and start a new directory

jena-arq/testing/ARQ/ConstructQuads

with both syntax and execution tests. This is just to keep everything in one place for now.


See jena-arq/testing/ARQ/Syntax/Syntax-ARQ/manifest.ttl and
jena-arq/testing/ARQ/Construct/manifest.ttl.

A manifest can have syntax and execution tests - it so happens that they are in separate places in the current test suite which was input the the working group.

A syntax test looks like:

:test_1 rdf:type   mfx:PositiveSyntaxTestARQ ;
   dawgt:approval dawgt:NotClassified ;
   mf:name    "syntax-select-expr-01.arq" ;
   mf:action  <syntax-select-expr-01.arq> ;.

to parse syntax-select-expr-01.arq, expecting it to be good, and an execution test is an action and a result:

:someExecutionTest rdf:type   mfx:TestQuery ;
    mf:name    "Construct Quads 1" ;
    mf:action
         [ qt:query  <q-construct-1.rq> ;
           qt:data   <data-1.ttl> ] ;
    mf:result  <results-construct-1.ttl>
    .

an action is a query and a data file.

There are different styles of layout in different places. The test suite has grown incrementally over the years of SPARQL 1.0 and SPARQL 1.1. Some test come from outside the project.

You can test from the command line using the arq.qparse tool.
See other message.

There is a command qtest for running manifests.

Background FYI:

You won't need this when put everything in jena-arq/testing/ARQ/ConstructQuads but to explain: the main test syntax suites are auto-generated by "syn.sh"

Part of that is "syn-arq.sh".

But hand writing syntax easier for now.

        Andy

Reply via email to