On 09/07/15 15:17, Qihong Lin wrote:
Hi,

I've studied the jena tests. It looks like that the syntax tests are
generated by "syn.sh". But the execution tests are not generated by
scripts, which are written by hand one by one. Is that true?

Yes.


Since I have enough time, I'd like to directly go for the syn.sh and
syn-arq.sh to generate tests for constructing quads. Thanks!

As the syntax extensions are in the ARQ language, you just need to work with syn-arq.sh

syn.sh are the syntax tests for strict SPARQL 1.1 (indeed, the output was the main contribution to the working group syntax tests).

        Andy


regards,
Qihong

On Tue, Jun 16, 2015 at 9:24 PM, Andy Seaborne <a...@apache.org> wrote:
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