--
You received this message because you are subscribed to the Google Groups "RDFUnit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rdfunit+u...@googlegroups.com.
To post to this group, send email to rdf...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rdfunit/f19b7363-5541-4eb9-8492-c55ba6dba9d7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Andrea Agazzone.
--
You received this message because you are subscribed to the Google Groups "RDFUnit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rdfunit+u...@googlegroups.com.
To post to this group, send email to rdf...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rdfunit/7cdc10ab-d1c8-4063-922e-0191f9145d62%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
protected void innerExecute() throws DPUException {
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
String dpuDir = ctx.getExecMasterContext().getDpuContext().getDpuInstanceDirectory();
String rdfUnitDir = dpuDir +"rdfunit/"; // In your example is "dataFolder"
new File(rdfUnitDir).mkdirs();
String schema = classLoader.getResource("schema.csv").getPath(); // This is the path of your "schemaDecl.csv"
String dataset = "/Users/AndreAga/Documents/Sviluppo/Progetti/UnifiedViews/Datasets/FirenzeSinistri.rdf"; // Dataset URI
RDFUnitValidation dataValidator = new RDFUnitValidation(dataset, dataset, schema, rdfUnitDir);
String result = dataValidator.validate();
System.out.println(result);
}
public class RDFUnitValidation {
private String serializationFormat;
private RDFUnitConfiguration configuration;
private TestSuite testSuite;
public RDFUnitValidation(String datasetURI, String rdfDataFile, String schema, String dataFolder) {
serializationFormat = "TURTLE";
final TestCaseExecutionType testCaseExecutionType = TestCaseExecutionType.extendedTestCaseResult;
//RDFUnitUtils.fillSchemaServiceFromLOV(); <--- THIS IS OFFLINE (?)
RDFUnitUtils.fillSchemaServiceFromFile(schema);
configuration = new RDFUnitConfiguration(datasetURI, dataFolder);
// Set the source
File file = new File(rdfDataFile);
configuration.setCustomDereferenceURI(file.getAbsolutePath());
configuration.setTestCaseExecutionType(testCaseExecutionType);
configuration.setAutoSchemataFromQEF(configuration.getTestSource().getExecutionFactory(), true);
// Initialize RDFUnit
org.aksw.rdfunit.RDFUnit rdfUnit = new org.aksw.rdfunit.RDFUnit();
try {
rdfUnit.init();
} catch (RDFReaderException e) {
throw new RuntimeException("Cannot initialize RDFUnit");
}
// Generate TestSuite for current dataset
TestGeneratorExecutor testGeneratorExecutor = new TestGeneratorExecutor(
configuration.isAutoTestsEnabled(),
configuration.isTestCacheEnabled(),
configuration.isManualTestsEnabled());
testSuite = testGeneratorExecutor.generateTestSuite(
configuration.getTestFolder(),
configuration.getTestSource(),
rdfUnit.getAutoGenerators());
}
public String validate() {
final SimpleTestExecutorMonitor testExecutorMonitor = new SimpleTestExecutorMonitor(false);
final TestExecutor testExecutor = TestExecutorFactory.createTestExecutor(configuration.getTestCaseExecutionType());
testExecutor.addTestExecutorMonitor(testExecutorMonitor);
final TestSource testSource = configuration.getTestSource();
testExecutor.execute(testSource, testSuite);
//OutputStream to get the results as string
final ByteArrayOutputStream os = new ByteArrayOutputStream();
try {
new RDFStreamWriter(os, serializationFormat).write(testExecutorMonitor.getModel());
return os.toString();
} catch (RDFWriterException e) {
return null;
}
}
}
[INFO RDFUnitUtils] Loaded 12 schema declarations from: java.io.FileInputStream@7fee8714[WARN DatasetStatistics] Undefined namespace in LOV or schemaDecl.csv: http://www.w3.org/1999/02/22-rdf-syntax-ns#[WARN DatasetStatistics] Undefined namespace in LOV or schemaDecl.csv: http://linkeddata.comune.fi.it:8080/all/[WARN DatasetStatistics] Undefined namespace in LOV or schemaDecl.csv: http://linkeddata.comune.fi.it:8080/resource/data/[WARN DatasetStatistics] Undefined namespace in LOV or schemaDecl.csv: http://linkeddata.comune.fi.it:8080/[WARN DatasetStatistics] Undefined namespace in LOV or schemaDecl.csv: http://www.w3.org/2000/01/rdf-schema#[WARN DatasetStatistics] Undefined namespace in LOV or schemaDecl.csv: http://linkeddata.comune.fi.it:8080/resource/sinistri/[ERROR AbstractDpu] DPU exeution failed!eu.unifiedviews.dpu.DPUException: DPU.innerExecute throws throwable. at eu.unifiedviews.helpers.dpu.exec.AbstractDpu.execute(AbstractDpu.java:125) at cz.cuni.mff.xrg.odcs.dpu.test.TestEnvironment.run(TestEnvironment.java:365) at eu.unifiedviews.plugins.quality.rdfunit.test.RDFUnitTest.executeTestCase(RDFUnitTest.java:43) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283) at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128) at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)Caused by: java.lang.AssertionError at org.aksw.rdfunit.tests.generators.TestGeneratorExecutor.<init>(TestGeneratorExecutor.java:60) at eu.unifiedviews.plugins.quality.rdfunit.RDFUnitValidation.<init>(RDFUnitValidation.java:55) at eu.unifiedviews.plugins.quality.rdfunit.RDFUnit.innerExecute(RDFUnit.java:109) at eu.unifiedviews.helpers.dpu.exec.AbstractDpu.execute(AbstractDpu.java:117) ... 26 moreconfiguration.isManualTestsEnabled());configuration.setAutoTestsEnabled(false);
configuration.setTestCacheEnabled(true);
configuration.setManualTestsEnabled(false);// no auto && no manual tests do not make sense
assert (!useAutoTests && !useManualTests);
// no auto && cache does not make sense TODO fix this
assert (!useAutoTests && loadFromCache);[INFO RDFUnitUtils] Loaded 12 schema declarations from: java.io.FileInputStream@7fee8714[WARN DatasetStatistics] Undefined namespace in LOV or schemaDecl.csv: http://www.w3.org/1999/02/22-rdf-syntax-ns#[WARN DatasetStatistics] Undefined namespace in LOV or schemaDecl.csv: http://linkeddata.comune.fi.it:8080/all/[WARN DatasetStatistics] Undefined namespace in LOV or schemaDecl.csv: http://linkeddata.comune.fi.it:8080/resource/data/[WARN DatasetStatistics] Undefined namespace in LOV or schemaDecl.csv: http://linkeddata.comune.fi.it:8080/[WARN DatasetStatistics] Undefined namespace in LOV or schemaDecl.csv: http://www.w3.org/2000/01/rdf-schema#[WARN DatasetStatistics] Undefined namespace in LOV or schemaDecl.csv: http://linkeddata.comune.fi.it:8080/resource/sinistri/@prefix dsp: <http://dublincore.org/dc-dsp#> .@prefix schema: <http://schema.org/> .@prefix rutg: <http://rdfunit.aksw.org/data/generators#> .@prefix owl: <http://www.w3.org/2002/07/owl#> .@prefix rlog: <http://persistence.uni-leipzig.org/nlp2rdf/ontologies/rlog#> .@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .@prefix rutp: <http://rdfunit.aksw.org/data/patterns#> .@prefix oslc: <http://open-services.net/ns/core#> .@prefix rut: <http://rdfunit.aksw.org/ns/core#> .@prefix rutr: <http://rdfunit.aksw.org/data/results#> .@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .@prefix rutt: <http://rdfunit.aksw.org/data/tests#> .@prefix spin: <http://spinrdf.org/spin#> .@prefix ruts: <http://rdfunit.aksw.org/data/testsuite#> .@prefix dcterms: <http://purl.org/dc/terms/> .@prefix prov: <http://www.w3.org/ns/prov#> .@prefix dc: <http://purl.org/dc/elements/1.1/> .
rutr:1c940c20-2acc-11b2-802b-aed6edfb1580 a rut:TestExecution , prov:Activity ; rut:source </Users/AndreAga/Documents/Sviluppo/Progetti/UnifiedViews/Datasets/FirenzeSinistri.rdf> ; rut:testsError "0"^^xsd:nonNegativeInteger ; rut:testsFailed "0"^^xsd:nonNegativeInteger ; rut:testsRun "0"^^xsd:nonNegativeInteger ; rut:testsSuceedded "0"^^xsd:nonNegativeInteger ; rut:testsTimeout "0"^^xsd:nonNegativeInteger ; rut:totalIndividualErrors "0"^^xsd:nonNegativeInteger ; prov:endedAtTime "2015-03-19T22:15:58.421Z"^^xsd:dateTime ; prov:startedAtTime "2015-03-19T22:15:58.421Z"^^xsd:dateTime ; prov:used ruts:1c940c21-2acc-11b2-802b-aed6edfb1580 ; prov:wasStartedBy <http://localhost/> .
ruts:1c940c21-2acc-11b2-802b-aed6edfb1580 a prov:Collection , rut:TestSuite .I add this three lines to RDFUnitValidation:configuration.setAutoTestsEnabled(false);
configuration.setTestCacheEnabled(true);
configuration.setManualTestsEnabled(false);
In order to fix the assert errors in TestGeneratorExecutor:// no auto && no manual tests do not make sense
assert (!useAutoTests && !useManualTests);
// no auto && cache does not make sense TODO fix this
assert (!useAutoTests && loadFromCache);
--
You received this message because you are subscribed to the Google Groups "RDFUnit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rdfunit+u...@googlegroups.com.
To post to this group, send email to rdf...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rdfunit/a0979ecd-4323-4a4d-9f13-52eb2e096296%40googlegroups.com.
monitor.generationStarted(dataset, sources.size());Caused by: java.lang.AssertionError at org.aksw.rdfunit.tests.generators.TestGeneratorExecutor.<init>(TestGeneratorExecutor.java:63)--
You received this message because you are subscribed to the Google Groups "RDFUnit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rdfunit+u...@googlegroups.com.
To post to this group, send email to rdf...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rdfunit/34b2f28f-2ba1-4774-99ca-c0b350292db2%40googlegroups.com.
RDFUnitUtils.fillSchemaServiceFromLOV();
[INFO RDFUnitUtils] Loaded 12 schema declarations from: java.io.FileInputStream@7fee8714[WARN DatasetStatistics] Undefined namespace in LOV or schemaDecl.csv: [WARN DatasetStatistics] Undefined namespace in LOV or schemaDecl.csv: http://www.w3.org/1999/02/22-rdf-syntax-ns#[WARN DatasetStatistics] Undefined namespace in LOV or schemaDecl.csv: http://schema.org/[WARN DatasetStatistics] Undefined namespace in LOV or schemaDecl.csv: http://www.w3.org/2000/01/rdf-schema#[WARN DatasetStatistics] Undefined namespace in LOV or schemaDecl.csv: http://xmlns.com/foaf/0.1/[WARN DatasetStatistics] Undefined namespace in LOV or schemaDecl.csv: http://comsode.disco.unimib.it/resource/dataset/scuole-infanzia-2010-2011/@prefix dsp: <http://dublincore.org/dc-dsp#> .@prefix schema: <http://schema.org/> .@prefix rutg: <http://rdfunit.aksw.org/data/generators#> .@prefix owl: <http://www.w3.org/2002/07/owl#> .@prefix rlog: <http://persistence.uni-leipzig.org/nlp2rdf/ontologies/rlog#> .@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .@prefix rutp: <http://rdfunit.aksw.org/data/patterns#> .@prefix oslc: <http://open-services.net/ns/core#> .@prefix rut: <http://rdfunit.aksw.org/ns/core#> .@prefix rutr: <http://rdfunit.aksw.org/data/results#> .@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .@prefix rutt: <http://rdfunit.aksw.org/data/tests#> .@prefix spin: <http://spinrdf.org/spin#> .@prefix ruts: <http://rdfunit.aksw.org/data/testsuite#> .@prefix dcterms: <http://purl.org/dc/terms/> .@prefix prov: <http://www.w3.org/ns/prov#> .@prefix dc: <http://purl.org/dc/elements/1.1/> .
rutr:1516fcb8-2acd-11b2-8039-a230238e106f a prov:Activity , rut:TestExecution ; rut:source </Users/AndreAga/Documents/Sviluppo/Progetti/UnifiedViews/Datasets/Scuole.ttl> ; rut:testsError "0"^^xsd:nonNegativeInteger ; rut:testsFailed "0"^^xsd:nonNegativeInteger ; rut:testsRun "0"^^xsd:nonNegativeInteger ; rut:testsSuceedded "0"^^xsd:nonNegativeInteger ; rut:testsTimeout "0"^^xsd:nonNegativeInteger ; rut:totalIndividualErrors "0"^^xsd:nonNegativeInteger ; prov:endedAtTime "2015-03-24T18:04:51.506Z"^^xsd:dateTime ; prov:startedAtTime "2015-03-24T18:04:51.506Z"^^xsd:dateTime ; prov:used ruts:1516fcb9-2acd-11b2-8039-a230238e106f ; prov:wasStartedBy <http://localhost/> .
ruts:1516fcb9-2acd-11b2-8039-a230238e106f a prov:Collection , rut:TestSuite .[WARN DatasetStatistics] Undefined namespace in LOV or schemaDecl.csv: http://www.w3.org/1999/02/22-rdf-syntax-ns#[WARN DatasetStatistics] Undefined namespace in LOV or schemaDecl.csv: http://schema.org/[WARN DatasetStatistics] Undefined namespace in LOV or schemaDecl.csv: http://www.w3.org/2000/01/rdf-schema#[WARN DatasetStatistics] Undefined namespace in LOV or schemaDecl.csv: http://xmlns.com/foaf/0.1/[WARN DatasetStatistics] Undefined namespace in LOV or schemaDecl.csv: http://comsode.disco.unimib.it/resource/dataset/scuole-infanzia-2010-2011/
--
You received this message because you are subscribed to the Google Groups "RDFUnit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rdfunit+u...@googlegroups.com.
To post to this group, send email to rdf...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rdfunit/e02bfaa0-7b61-4152-8ef7-ef73c8840f0f%40googlegroups.com.
[WARN DatasetStatistics] Undefined namespace in LOV or schemaDecl.csv: [WARN DatasetStatistics] Undefined namespace in LOV or schemaDecl.csv: http://comsode.disco.unimib.it/resource/dataset/scuole-infanzia-2010-2011/[INFO TestGeneratorExecutor] Generating tests for: http://schema.org/[INFO TestGeneratorExecutor] http://schema.org/ contains 1380 automatically created testsCaused by: java.lang.NoSuchMethodError: com.fasterxml.jackson.core.JsonFactory.requiresPropertyOrdering()Z
at com.fasterxml.jackson.databind.ObjectMapper.<init>(ObjectMapper.java:445) at com.fasterxml.jackson.databind.ObjectMapper.<init>(ObjectMapper.java:366) at com.github.jsonldjava.utils.JsonUtils.<clinit>(JsonUtils.java:37) at org.apache.jena.riot.lang.JsonLDReader.read(JsonLDReader.java:76) at org.apache.jena.riot.RDFDataMgr.process(RDFDataMgr.java:906) at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:257) at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:243) at org.apache.jena.riot.adapters.RDFReaderRIOT_Web.read(RDFReaderRIOT_Web.java:96) at com.hp.hpl.jena.rdf.model.impl.ModelCom.read(ModelCom.java:235) at com.hp.hpl.jena.ontology.impl.OntModelImpl.readDelegate(OntModelImpl.java:3107) at com.hp.hpl.jena.ontology.impl.OntModelImpl.read(OntModelImpl.java:2198) at com.hp.hpl.jena.ontology.impl.OntModelImpl.read(OntModelImpl.java:2122) at org.aksw.rdfunit.io.reader.RDFDereferenceReader.read(RDFDereferenceReader.java:33) at org.aksw.rdfunit.io.reader.RDFFirstSuccessReader.read(RDFFirstSuccessReader.java:36) at org.aksw.rdfunit.sources.SchemaSource.initQueryFactory(SchemaSource.java:72) at org.aksw.rdfunit.sources.Source.getExecutionFactory(Source.java:113) at org.aksw.rdfunit.tests.TestAutoGenerator.generate(TestAutoGenerator.java:94) at org.aksw.rdfunit.Utils.TestGeneratorUtils.instantiateTestsFromAG(TestGeneratorUtils.java:93) at org.aksw.rdfunit.tests.generators.TestGeneratorExecutor.generateAutoTestsForSchemaSource(TestGeneratorExecutor.java:146) at org.aksw.rdfunit.tests.generators.TestGeneratorExecutor.generateTestSuite(TestGeneratorExecutor.java:105) at eu.unifiedviews.plugins.quality.rdfunit.RDFUnitValidation.<init>(RDFUnitValidation.java:57) at eu.unifiedviews.plugins.quality.rdfunit.RDFUnit.innerExecute(RDFUnit.java:70) at eu.unifiedviews.helpers.dpu.exec.AbstractDpu.execute(AbstractDpu.java:117) ... 26 more
...[INFO TestGeneratorExecutor] Generating tests for: http://purl.org/dc/terms/[INFO TestGeneratorExecutor] http://purl.org/dc/terms/ contains 73 automatically created tests[INFO TestGeneratorExecutor] Generating tests for: http://purl.org/dc/elements/1.1/[INFO TestGeneratorExecutor] http://purl.org/dc/elements/1.1/ contains 0 automatically created tests[INFO TestGeneratorExecutor] Generating tests for: http://www.w3.org/2004/02/skos/core#[INFO TestGeneratorExecutor] http://www.w3.org/2004/02/skos/core# contains 43 automatically created tests[INFO TestGeneratorExecutor] http://www.w3.org/2004/02/skos/core# contains 16 manually created tests[INFO TestGeneratorExecutor] Generating tests for: http://creativecommons.org/ns#[INFO TestGeneratorExecutor] http://creativecommons.org/ns# contains 33 automatically created tests[INFO TestGeneratorExecutor] Generating tests for: http://rdfs.org/ns/void#[INFO TestGeneratorExecutor] http://rdfs.org/ns/void# contains 89 automatically created tests[INFO TestGeneratorExecutor] Generating tests for: http://rdf.myexperiment.org/ontologies/base/[INFO TestGeneratorExecutor] http://rdf.myexperiment.org/ontologies/base/ contains 466 automatically created tests[INFO TestGeneratorExecutor] Generating tests for: http://zbw.eu/namespaces/zbw-extensions/[INFO TestGeneratorExecutor] http://zbw.eu/namespaces/zbw-extensions/ contains 2 automatically created testsCaused by: java.lang.NoSuchMethodError: com.fasterxml.jackson.core.JsonFactory.requiresPropertyOrdering()Z
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.3.3</version>
</dependency>
--
You received this message because you are subscribed to the Google Groups "RDFUnit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rdfunit+u...@googlegroups.com.
To post to this group, send email to rdf...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rdfunit/1b362540-5ff0-4b95-8eea-281f7459cdb0%40googlegroups.com.