BH12.12/SPARQL11test

提供:TogoWiki

(版間での差分)
移動: 案内, 検索
(OWLIM-Lite 5.3.5928)
(AllegroGraph 4.11)
287行: 287行:
  ./bin/rsparql --service 'http://xxx/repositories/colil' --query ${f} --debug >& ../LearningSPARQL2ndEx_AllegroGraph4.11/${a}.txt
  ./bin/rsparql --service 'http://xxx/repositories/colil' --query ${f} --debug >& ../LearningSPARQL2ndEx_AllegroGraph4.11/${a}.txt
  end
  end
 +
 +
$ head -1 *.txt | grep -v '^==>' | sed -ne '/^./p' | sed -e 's/^--*/-/' | sort | uniq -c | sort -nr
 +
    171 -
 +
    33 @prefix :      <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
 +
    11 HTTP Exeception
 +
      3 Ask => No
 +
      2 @prefix dc:    <http://purl.org/dc/elements/1.1/> .

2013年7月16日 (火) 08:34時点における版

Learning SPARQL 2nd Ed.サンプルSPARQLクエリを全て処理させてパーズ可能であるかをテストする。 様々な実装に対して行うことで、実装間の比較が行える。

目次

クエリの問題への対処

まずはApache Jenaについて試してみたところ、幾つかのクエリについてはPREFIX指定が抜けているものがあり、これを修正した。

PREFIX欠落

  • ex025.rq
  • ex048.rq
  • ex049.rq
  • ex114.rq
  • ex269.rq
  • ex528.rq

その他の文法間違い

  • ex067.rq

FILTER が抜けている。

 NOT EXISTS { ?s ab:workTel ?workNum }

ではなくて、

 FILTER NOT EXISTS { ?s ab:workTel ?workNum }

本文中で触れられず

下記の両者ともクエリ未完成

  • ex080.rq
  • ex541.rq

テスト

テストした実装を以下に列挙していくこととする。

Apache Jena 2.10.1

foreach f ( ./LearningSPARQL2ndEx/*.rq )
set a=`basename $f .rq`
./qparse --print=op --explain --file $f > ./LearningSPARQL2ndExParsed/${a}.txt
end
  • ex242.rq
 % ./qparse --print=op --explain --file ./LearningSPARQL2ndEx/ex242.rq
[3,85]: No known symbol for isNumeric: isNumeric

isNumericに未対応。

Virtuoso version 06.01.3127 on Linux

foreach f ( ../LearningSPARQL2ndEx/ex*.rq )
set a=`basename $f .rq`
./bin/rsparql --service 'http://data.allie.dbcls.jp/sparql' --query ${f} --debug >& ../LearningSPARQL2ndEx_Virtuoso06013127/${a}.txt
end

ex427.rqは無限ループに(12時間程度経っても何も得られず)

PREFIX  owl:  <http://www.w3.org/2002/07/owl#>

CONSTRUCT
{ ?resource2 ?property1 ?resource1 . }
WHERE
{  
  ?property1 owl:inverseOf ?property2 .
  ?resource1 ?property2 ?resource2 .
}
$ head -1 *.txt | grep -v '^==>' | sed -ne '/^./p' | sed -e 's/^--*/-/' | sort | uniq -c | sort -nr
   136 -
    59 HTTP Exeception
    21 @prefix rdfs:  <http://www.w3.org/2000/01/rdf-schema#> .
     2 Ask => No
     1 @prefix dc:    <http://purl.org/dc/elements/1.1/> .

下記、Jenaのエラーメッセージにスペルミス(HTTP Exeception)があることに注意。

$ grep -A2 'HTTP Exeception' *.txt | grep 'HttpException' | sed -e 's/^/ /'
ex075.txt-HttpException: 400 Bad Request
ex078.txt-HttpException: 400 Bad Request
ex082.txt-HttpException: 400 Bad Request
ex083.txt-HttpException: 400 Bad Request
ex084.txt-HttpException: 400 Bad Request
ex112.txt-HttpException: 400 Bad Request
ex144.txt-HttpException: 400 Bad Request
ex158.txt-HttpException: 400 Bad Request
ex167.txt-HttpException: 500 SPARQL Request Failed
ex172.txt-HttpException: 500 SPARQL Request Failed
ex178.txt-HttpException: 500 SPARQL Request Failed
ex185.txt-HttpException: 400 Bad Request
ex196.txt-HttpException: 500 SPARQL Request Failed
ex202.txt-HttpException: 400 Bad Request
ex207.txt-HttpException: 400 Bad Request
ex209.txt-HttpException: 400 Bad Request
ex232.txt-HttpException: 400 Bad Request
ex233.txt-HttpException: 400 Bad Request
ex235.txt-HttpException: 400 Bad Request
ex237.txt-HttpException: 400 Bad Request
ex239.txt-HttpException: 400 Bad Request
ex242.txt-HttpException: 400 Bad Request
ex244.txt-HttpException: 400 Bad Request
ex246.txt-HttpException: 400 Bad Request
ex248.txt-HttpException: 400 Bad Request
ex251.txt-HttpException: 400 Bad Request
ex253.txt-HttpException: 400 Bad Request
ex255.txt-HttpException: 400 Bad Request
ex257.txt-HttpException: 400 Bad Request
ex260.txt-HttpException: 400 Bad Request
ex262.txt-HttpException: 400 Bad Request
ex264.txt-HttpException: 400 Bad Request
ex267.txt-HttpException: 400 Bad Request
ex273.txt-HttpException: 400 Bad Request
ex276.txt-HttpException: 400 Bad Request
ex282.txt-HttpException: 400 Bad Request
ex285.txt-HttpException: 400 Bad Request
ex287.txt-HttpException: 400 Bad Request
ex290.txt-HttpException: 400 Bad Request
ex293.txt-HttpException: 400 Bad Request
ex295.txt-HttpException: 400 Bad Request
ex299.txt-HttpException: 400 Bad Request
ex301.txt-HttpException: 400 Bad Request
ex303.txt-HttpException: 400 Bad Request
ex305.txt-HttpException: 400 Bad Request
ex308.txt-HttpException: 400 Bad Request
ex432.txt-HttpException: 400 Bad Request
ex445.txt-HttpException: 400 Bad Request
ex473.txt-HttpException: 502 Proxy Error
ex476.txt-HttpException: 500 SPARQL Request Failed
ex491.txt-HttpException: 400 Bad Request
ex492.txt-HttpException: 400 Bad Request
ex496.txt-HttpException: 400 Bad Request
ex498.txt-HttpException: 400 Bad Request
ex500.txt-HttpException: 400 Bad Request
ex510.txt-HttpException: 500 SPARQL Request Failed
ex511.txt-HttpException: 500 SPARQL Request Failed
ex526.txt-HttpException: 400 Bad Request
ex538.txt-HttpException: 502 Proxy Error
$ grep -A2 'HTTP Exeception' *.txt | grep 'Virtuoso' | sed -e 's/^/ /'
ex075.txt-Virtuoso 37000 Error SP030: SPARQL compiler, line 0: Invalid character in SPARQL expression at '|'
ex078.txt-Virtuoso 37000 Error SP030: SPARQL compiler, line 6: syntax error at '(' before 'c:cites'
ex082.txt-Virtuoso 37000 Error SP030: SPARQL compiler, line 6: syntax error at '(' before 'c:cites'
ex083.txt-Virtuoso 37000 Error SP030: SPARQL compiler, line 0: Invalid character in SPARQL expression at '^'
ex084.txt-Virtuoso 37000 Error SP030: SPARQL compiler, line 0: Invalid character in SPARQL expression at '^'
ex112.txt-Virtuoso 37000 Error SP030: SPARQL compiler, line 8: syntax error at 'NOT' before 'IN'
ex144.txt-Virtuoso 37000 Error SP030: SPARQL compiler, line 7: syntax error at 'BIND' before '('
ex158.txt-Virtuoso 37000 Error SP030: SPARQL compiler, line 3: syntax error at 'GROUP_CONCAT' before '('
ex167.txt-Virtuoso RDFZZ Error DB.DBA.SPARQL_REXEC('http://DBpedia.org/sparql', ...) returned Content-Type 'text/html' status 'HTTP/1.1 502 Bad Gateway
ex172.txt-Virtuoso RDFZZ Error DB.DBA.SPARQL_REXEC('http://DBpedia.org/sparql', ...) returned Content-Type 'text/html' status 'HTTP/1.1 502 Bad Gateway
ex178.txt-Virtuoso RDFZZ Error DB.DBA.SPARQL_REXEC('http://DBpedia.org/sparql', ...) returned Content-Type 'text/html' status 'HTTP/1.1 502 Bad Gateway
ex185.txt-Virtuoso 37000 Error SP030: SPARQL compiler, line 9: syntax error at 'BIND'
ex196.txt-Virtuoso RDFZZ Error DB.DBA.SPARQL_REXEC('http://DBpedia.org/sparql', ...) returned Content-Type 'text/html' status 'HTTP/1.1 502 Bad Gateway
ex202.txt-Virtuoso 37000 Error SP030: SPARQL compiler, line 11: syntax error at 'BIND'
ex207.txt-Virtuoso 37000 Error SP030: SPARQL compiler, line 14: syntax error at 'BIND' before '('
ex209.txt-Virtuoso 37000 Error SP030: SPARQL compiler, line 28: syntax error at 'BIND' before '('
ex232.txt-Virtuoso 37000 Error SP030: SPARQL compiler, line 7: syntax error at 'BIND' before '('
ex233.txt-Virtuoso 37000 Error SP030: SPARQL compiler, line 8: syntax error at 'BIND' before '('
ex235.txt-Virtuoso 37000 Error SP030: SPARQL compiler, line 3: syntax error at 'BIND' before '('
ex237.txt-Virtuoso 37000 Error SP030: SPARQL compiler, line 8: syntax error at 'BIND' before '('
ex239.txt-Virtuoso 37000 Error SP030: SPARQL compiler, line 9: syntax error at 'BIND' before '('
ex242.txt-Virtuoso 37000 Error SP030: SPARQL compiler, line 6: syntax error at 'BIND' before '('
ex244.txt-Virtuoso 37000 Error SP030: SPARQL compiler, line 6: syntax error at 'BIND' before '('
ex246.txt-Virtuoso 37000 Error SP030: SPARQL compiler, line 7: syntax error at 'BIND' before '('
ex248.txt-Virtuoso 37000 Error SP030: SPARQL compiler, line 7: syntax error at 'BIND' before '('
ex251.txt-Virtuoso 37000 Error SP030: SPARQL compiler, line 6: syntax error at 'BIND' before '('
ex253.txt-Virtuoso 37000 Error SP030: SPARQL compiler, line 7: syntax error at 'BIND' before '('
ex255.txt-Virtuoso 37000 Error SP030: SPARQL compiler, line 7: syntax error at 'BIND' before '('
ex257.txt-Virtuoso 37000 Error SP030: SPARQL compiler, line 7: syntax error at 'BIND' before '('
ex260.txt-Virtuoso 37000 Error SP030: SPARQL compiler, line 6: syntax error at 'BIND' before '('
ex262.txt-Virtuoso 37000 Error SP030: SPARQL compiler, line 6: syntax error at 'BIND' before '('
ex264.txt-Virtuoso 37000 Error SP030: SPARQL compiler, line 7: syntax error at 'BIND' before '('
ex267.txt-Virtuoso 37000 Error SP030: SPARQL compiler, line 11: syntax error at 'BIND' before '('
ex273.txt-Virtuoso 37000 Error SP030: SPARQL compiler, line 7: syntax error at 'BIND' before '('
ex276.txt-Virtuoso 37000 Error SP030: SPARQL compiler, line 7: syntax error at 'BIND' before '('
ex282.txt-Virtuoso 37000 Error SP030: SPARQL compiler, line 13: syntax error at 'BIND' before '('
ex285.txt-Virtuoso 37000 Error SP030: SPARQL compiler, line 6: syntax error at 'BIND' before '('
ex287.txt-Virtuoso 37000 Error SP030: SPARQL compiler, line 6: syntax error at 'BIND' before '('
ex290.txt-Virtuoso 37000 Error SP030: SPARQL compiler, line 6: syntax error at 'BIND' before '('
ex293.txt-Virtuoso 37000 Error SP030: SPARQL compiler, line 7: syntax error at 'BIND' before '('
ex295.txt-Virtuoso 37000 Error SP030: SPARQL compiler, line 4: syntax error at 'BIND' before '('
ex299.txt-Virtuoso 37000 Error SP030: SPARQL compiler, line 7: syntax error at 'BIND' before '('
ex301.txt-Virtuoso 37000 Error SP030: SPARQL compiler, line 8: syntax error at 'BIND' before '('
ex303.txt-Virtuoso 37000 Error SP030: SPARQL compiler, line 5: syntax error at 'BIND' before '('
ex305.txt-Virtuoso 37000 Error SP030: SPARQL compiler, line 12: syntax error at 'BIND' before '('
ex308.txt-Virtuoso 37000 Error SP030: SPARQL compiler, line 7: syntax error at 'BIND' before '('
ex432.txt-Virtuoso 37000 Error SP030: SPARQL compiler, line 6: syntax error at '(' before 'rdfs:subPropertyOf'
ex445.txt-Virtuoso 37000 Error SP030: SPARQL compiler, line 7: syntax error at '(' before 'rdfs:subClassOf'
ex476.txt-Virtuoso RDFZZ Error DB.DBA.SPARQL_REXEC('http://DBpedia.org/sparql', ...) returned Content-Type 'text/html' status 'HTTP/1.1 502 Bad Gateway
ex491.txt-Virtuoso 37000 Error SP030: SPARQL compiler, line 15: syntax error at 'BIND' before '('
ex492.txt-Virtuoso 37000 Error SP030: SPARQL compiler, line 6: syntax error at 'VALUES' before '('
ex496.txt-Virtuoso 37000 Error SP030: SPARQL compiler, line 8: syntax error at 'VALUES' before '?description'
ex498.txt-Virtuoso 37000 Error SP030: SPARQL compiler, line 8: syntax error at 'VALUES' before '('
ex500.txt-Virtuoso 37000 Error SP030: SPARQL compiler, line 8: syntax error at 'VALUES' before '('
ex510.txt-Virtuoso 22023 Error SL001: The SPARQL 1.1 function lcase() needs a string value as 1st argument
ex511.txt-Virtuoso 22023 Error SL001: The SPARQL 1.1 function STRENDS() needs a string value as 1st argument
ex526.txt-Virtuoso 37000 Error SP030: SPARQL compiler, line 10: syntax error at 'BIND' before '('

プロパティパスと"NOT IN "、BIND、GROUP_CONCAT、VALUESに未対応。 また、LCASE、STRENDS関数の引数にstring以外の値が来るとエラーになる模様。 BINDの陰で気づかなかったがURI関数にも未対応。

Virtuoso version 07.00.3202 on Linux

foreach f ( ../LearningSPARQL2ndEx/ex*.rq )
set a=`basename $f .rq`
./bin/rsparql --service 'http://colil.dbcls.jp/sparql' --query ${f} --debug >& ../LearningSPARQL2ndEx_Virtuoso07.00.3202/${a}.txt
end
$ head -1 *.txt | grep -v '^==>' | sed -ne '/^./p' | sed -e 's/^--*/-/' | sort | uniq -c | sort -nr
   173 -
    29 @prefix rdfs:  <http://www.w3.org/2000/01/rdf-schema#> .
    14 HTTP Exeception
     3 Ask => No
     1 @prefix dc:    <http://purl.org/dc/elements/1.1/> .
$ grep -A2 'HTTP Exeception' *.txt | grep 'HttpException' | sed -e 's/^/ /'
ex118.txt-HttpException: 500 SPARQL Request Failed
ex237.txt-HttpException: 400 Bad Request
ex246.txt-HttpException: 400 Bad Request
ex248.txt-HttpException: 400 Bad Request
ex253.txt-HttpException: 400 Bad Request
ex255.txt-HttpException: 400 Bad Request
ex262.txt-HttpException: 500 SPARQL Request Failed
ex267.txt-HttpException: 400 Bad Request
ex282.txt-HttpException: 400 Bad Request
ex308.txt-HttpException: 500 SPARQL Request Failed
ex491.txt-HttpException: 400 Bad Request
ex492.txt-HttpException: 500 SPARQL Request Failed
ex510.txt-HttpException: 500 SPARQL Request Failed
ex511.txt-HttpException: 500 SPARQL Request Failed
$ grep -A2 'HTTP Exeception' *.txt | grep 'Virtuoso' | sed -e 's/^/ /'
ex118.txt-Virtuoso 22023 Error SR350: TOP parameter < 0
ex237.txt-Virtuoso 37000 Error SP031: SPARQL compiler: Internal error: Built-in function is not implemented
ex246.txt-Virtuoso 37000 Error SP031: SPARQL compiler: Internal error: Built-in function is not implemented
ex248.txt-Virtuoso 37000 Error SP031: SPARQL compiler: Internal error: Built-in function is not implemented
ex253.txt-Virtuoso 37000 Error SP031: SPARQL compiler: Internal error: Built-in function is not implemented
ex255.txt-Virtuoso 37000 Error SP031: SPARQL compiler: Internal error: Built-in function is not implemented
ex262.txt-Virtuoso 22007 Error DT006: Cannot convert http://www.openlinksw.com/schemas/virtrdf#QuadMapFormat to datetime : Incorrect year delimiter
ex267.txt-Virtuoso 37000 Error SP031: SPARQL compiler: Internal error: Built-in function is not implemented
ex282.txt-Virtuoso 37000 Error SP031: SPARQL compiler: Internal error: Built-in function is not implemented
ex308.txt-Virtuoso 42001 Error SR185: Undefined procedure DB.DBA.http://jena.hpl.hp.com/ARQ/function#localname.
ex491.txt-Virtuoso 37000 Error SP031: SPARQL compiler: Internal error: Built-in function is not implemented
ex492.txt-Virtuoso S0022 Error SQ200: No column color.
ex510.txt-Virtuoso 22023 Error SL001: The SPARQL 1.1 function lcase() needs a string value as 1st argument
ex511.txt-Virtuoso 22023 Error SL001: The SPARQL 1.1 function STRENDS() needs a string value as 1st argument
  • Virtuosoのエラーメッセージは不親切極まりない。"Built-in function is not implemented"と言われても具体的にどの関数に未対応なのかが表示されない。
  • ex118.rqについては、OFFSETだけではどうやらダメらしく、LIMITと同時使用なら問題無し。
  • ex237.rq、ex246.rq、ex248.rq、ex253.rq、ex255.rq、ex267.rq、ex282.rq、ex491.rqについては、URI関数に未対応で、これはVersion6でも同じ。
  • ex308.rqはARQの独自関数利用のためで、ex492.rqについては不明。
  • その他、ex262、ex510、ex511は関数の引数について型が合っていないとエラーになる。
  • VirtuosoではURIは使えないけれど、同機能のIRIは使えるので、そちらを利用する必要あり。

OWLIM-Lite 5.3.5928

foreach f ( ../LearningSPARQL2ndEx/ex*.rq )
set a=`basename $f .rq`
./bin/rsparql --service 'http://beta.dbcls.jp/openrdf-sesame/repositories/RDF_LSD_TEST' --query ${f} --debug >& ../LearningSPARQL2ndEx_OWLIM-Lite_5.3.5928/${a}.txt
end
$ head -1 *.txt | grep -v '^==>' | sed -ne '/^./p' | sed -e 's/^--*/-/' | sort | uniq -c | sort -nr
   168 -
    30 @prefix rdfs:  <http://www.w3.org/2000/01/rdf-schema#> .
    12 HTTP Exeception
     3 Ask => No
     2 @prefix :      <http://purl.org/dc/terms/> .
     1 @prefix v:     <http://www.w3.org/2006/vcard/ns#> .
     1 @prefix dc:    <http://purl.org/dc/elements/1.1/> .
     1 @prefix :      <http://xmlns.com/foaf/0.1/> .
     1 @prefix :      <http://dbpedia.org/property/> .
$ grep -A2 'HTTP Exeception' *.txt | grep -v 'HTTP Exeception' | grep -v '^--' | grep -v 'HttpException' | sed -e 's/^/ /'
ex007.txt-MALFORMED QUERY: Not a valid (absolute) URI: ex002.ttl
ex123.txt-MALFORMED QUERY: Not a valid (absolute) URI: ex069.ttl
ex126.txt-MALFORMED QUERY: Not a valid (absolute) URI: ex125.ttl
ex128.txt-MALFORMED QUERY: Not a valid (absolute) URI: ex125.ttl
ex130.txt-MALFORMED QUERY: Not a valid (absolute) URI: ex069.ttl
ex135.txt-MALFORMED QUERY: Not a valid (absolute) URI: ex134.ttl
ex180.txt-MALFORMED QUERY: Not a valid (absolute) URI: ex125.ttl
ex308.txt-<html>
ex492.txt-MALFORMED QUERY: Lexical error at line 6, column 7.  Encountered: " " (32), after : "VALUES"
ex496.txt-MALFORMED QUERY: Lexical error at line 8, column 11.  Encountered: " " (32), after : "VALUES"
ex498.txt-MALFORMED QUERY: Lexical error at line 8, column 11.  Encountered: " " (32), after : "VALUES"
ex500.txt-MALFORMED QUERY: Lexical error at line 8, column 11.  Encountered: " " (32), after : "VALUES"

"<ex002.ttl>"といったURIに未対応なのと、VALUESに未対応。 ex308.rqはARQ独自関数利用のため。

AllegroGraph 4.11

foreach f ( ../LearningSPARQL2ndEx/ex*.rq )
set a=`basename $f .rq`
./bin/rsparql --service 'http://xxx/repositories/colil' --query ${f} --debug >& ../LearningSPARQL2ndEx_AllegroGraph4.11/${a}.txt
end
$ head -1 *.txt | grep -v '^==>' | sed -ne '/^./p' | sed -e 's/^--*/-/' | sort | uniq -c | sort -nr
   171 -
    33 @prefix :      <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
    11 HTTP Exeception
     3 Ask => No
     2 @prefix dc:    <http://purl.org/dc/elements/1.1/> .
個人用ツール