Run w3c SPARQL SERVICE testsuite

pull/46/head
Tpt 4 years ago
parent 19e96c73ce
commit f569bbc2a1
  1. 77
      testsuite/tests/sparql.rs

@ -2,8 +2,8 @@ use anyhow::Result;
use oxigraph_testsuite::manifest::TestManifest;
use oxigraph_testsuite::sparql_evaluator::evaluate_sparql_tests;
fn run_testsuite(manifest_urls: Vec<&str>, ignored_tests: Vec<&str>) -> Result<()> {
let manifest = TestManifest::new(manifest_urls);
fn run_testsuite(manifest_url: &str, ignored_tests: Vec<&str>) -> Result<()> {
let manifest = TestManifest::new(vec![manifest_url]);
let results = evaluate_sparql_tests(manifest)?;
let mut errors = Vec::default();
@ -20,41 +20,31 @@ fn run_testsuite(manifest_urls: Vec<&str>, ignored_tests: Vec<&str>) -> Result<(
}
#[test]
fn sparql10_w3c_query_evaluation_testsuite() -> Result<()> {
let manifest_urls = vec![
fn sparql10_w3c_query_syntax_testsuite() -> Result<()> {
run_testsuite(
"http://www.w3.org/2001/sw/DataAccess/tests/data-r2/manifest-syntax.ttl",
"http://www.w3.org/2001/sw/DataAccess/tests/data-r2/algebra/manifest.ttl",
"http://www.w3.org/2001/sw/DataAccess/tests/data-r2/ask/manifest.ttl",
"http://www.w3.org/2001/sw/DataAccess/tests/data-r2/basic/manifest.ttl",
"http://www.w3.org/2001/sw/DataAccess/tests/data-r2/bnode-coreference/manifest.ttl",
"http://www.w3.org/2001/sw/DataAccess/tests/data-r2/boolean-effective-value/manifest.ttl",
"http://www.w3.org/2001/sw/DataAccess/tests/data-r2/bound/manifest.ttl",
"http://www.w3.org/2001/sw/DataAccess/tests/data-r2/cast/manifest.ttl",
"http://www.w3.org/2001/sw/DataAccess/tests/data-r2/construct/manifest.ttl",
//TODO FROM and FROM NAMED "http://www.w3.org/2001/sw/DataAccess/tests/data-r2/construct/manifest.ttl",
"http://www.w3.org/2001/sw/DataAccess/tests/data-r2/distinct/manifest.ttl",
"http://www.w3.org/2001/sw/DataAccess/tests/data-r2/expr-builtin/manifest.ttl",
"http://www.w3.org/2001/sw/DataAccess/tests/data-r2/expr-equals/manifest.ttl",
"http://www.w3.org/2001/sw/DataAccess/tests/data-r2/expr-ops/manifest.ttl",
"http://www.w3.org/2001/sw/DataAccess/tests/data-r2/graph/manifest.ttl",
"http://www.w3.org/2001/sw/DataAccess/tests/data-r2/i18n/manifest.ttl",
"http://www.w3.org/2001/sw/DataAccess/tests/data-r2/open-world/manifest.ttl",
"http://www.w3.org/2001/sw/DataAccess/tests/data-r2/optional/manifest.ttl",
"http://www.w3.org/2001/sw/DataAccess/tests/data-r2/optional-filter/manifest.ttl",
"http://www.w3.org/2001/sw/DataAccess/tests/data-r2/reduced/manifest.ttl",
"http://www.w3.org/2001/sw/DataAccess/tests/data-r2/regex/manifest.ttl",
"http://www.w3.org/2001/sw/DataAccess/tests/data-r2/solution-seq/manifest.ttl",
"http://www.w3.org/2001/sw/DataAccess/tests/data-r2/sort/manifest.ttl",
"http://www.w3.org/2001/sw/DataAccess/tests/data-r2/triple-match/manifest.ttl",
"http://www.w3.org/2001/sw/DataAccess/tests/data-r2/type-promotion/manifest.ttl",
];
let test_blacklist = vec![
vec![
//Bad SPARQL query that should be rejected by the parser
"http://www.w3.org/2001/sw/DataAccess/tests/data-r2/syntax-sparql4/manifest#syn-bad-38",
"http://www.w3.org/2001/sw/DataAccess/tests/data-r2/syntax-sparql4/manifest#syn-bad-34",
"http://www.w3.org/2001/sw/DataAccess/tests/data-r2/syntax-sparql3/manifest#syn-bad-26",
],
)
}
#[test]
fn sparql10_w3c_query_evaluation_testsuite() -> Result<()> {
run_testsuite("http://www.w3.org/2001/sw/DataAccess/tests/data-r2/manifest-evaluation.ttl", vec![
// FROM and FROM name support that is missing
"http://www.w3.org/2001/sw/DataAccess/tests/data-r2/dataset/manifest#dawg-dataset-01",
"http://www.w3.org/2001/sw/DataAccess/tests/data-r2/dataset/manifest#dawg-dataset-03",
"http://www.w3.org/2001/sw/DataAccess/tests/data-r2/dataset/manifest#dawg-dataset-05",
"http://www.w3.org/2001/sw/DataAccess/tests/data-r2/dataset/manifest#dawg-dataset-06",
"http://www.w3.org/2001/sw/DataAccess/tests/data-r2/dataset/manifest#dawg-dataset-07",
"http://www.w3.org/2001/sw/DataAccess/tests/data-r2/dataset/manifest#dawg-dataset-08",
"http://www.w3.org/2001/sw/DataAccess/tests/data-r2/dataset/manifest#dawg-dataset-11",
"http://www.w3.org/2001/sw/DataAccess/tests/data-r2/dataset/manifest#dawg-dataset-11",
"http://www.w3.org/2001/sw/DataAccess/tests/data-r2/dataset/manifest#dawg-dataset-12b",
//Multiple writing of the same xsd:integer. Our system does strong normalization.
"http://www.w3.org/2001/sw/DataAccess/tests/data-r2/distinct/manifest#distinct-1",
"http://www.w3.org/2001/sw/DataAccess/tests/data-r2/distinct/manifest#distinct-9",
@ -81,17 +71,14 @@ fn sparql10_w3c_query_evaluation_testsuite() -> Result<()> {
"http://www.w3.org/2001/sw/DataAccess/tests/data-r2/open-world/manifest#date-2",
// We choose to simplify first the nested group patterns in OPTIONAL
"http://www.w3.org/2001/sw/DataAccess/tests/data-r2/optional-filter/manifest#dawg-optional-filter-005-not-simplified"
];
run_testsuite(manifest_urls, test_blacklist)
])
}
#[test]
fn sparql11_query_w3c_evaluation_testsuite() -> Result<()> {
let manifest_urls =
vec!["http://www.w3.org/2009/sparql/docs/tests/data-sparql11/manifest-sparql11-query.ttl"];
let test_blacklist = vec![
run_testsuite(
"http://www.w3.org/2009/sparql/docs/tests/data-sparql11/manifest-sparql11-query.ttl",
vec![
//Bad SPARQL query that should be rejected by the parser
"http://www.w3.org/2009/sparql/docs/tests/data-sparql11/aggregates/manifest#agg08",
"http://www.w3.org/2009/sparql/docs/tests/data-sparql11/aggregates/manifest#agg09",
@ -119,7 +106,17 @@ fn sparql11_query_w3c_evaluation_testsuite() -> Result<()> {
"http://www.w3.org/2009/sparql/docs/tests/data-sparql11/property-path/manifest#pp35",
//SERVICE name from a BGP
"http://www.w3.org/2009/sparql/docs/tests/data-sparql11/service/manifest#service5"
];
],
)
}
run_testsuite(manifest_urls, test_blacklist)
#[test]
fn sparql11_federation_w3c_evaluation_testsuite() -> Result<()> {
run_testsuite(
"http://www.w3.org/2009/sparql/docs/tests/data-sparql11/manifest-sparql11-fed.ttl",
vec![
// Problem during service evaluation order
"http://www.w3.org/2009/sparql/docs/tests/data-sparql11/service/manifest#service5",
],
)
}

Loading…
Cancel
Save