Skip to main content

RDF Validation Extension

Abstract

RDF Validation Extension

You may simply turn on for every DPU RDF Validation extension by inserting the following fragment to your main DPU class:

 @ExtensionInitializer.Init
 public RdfValidation rdfValidation;

As a result, after importing such DPU to UnifiedViews (2.X), pipeline designer may decide to check output produced by certain output RDF data unit. In particular, pipeline designer may select which output RDF data unit should be checked and may define SPARQL ASK queries checking the outputted RDF data. If the SPARQL ask query returns false, the given output is INVALID and an error is reported.

24576115.png

Note

You may define only one SPARQL ASK query

if you need to check that graph pattern A OR graph pattern B is satisfied, you may use UNION:

ASK WHERE {

{<http://dbpedia.org/resource/Prague> owl:sameAs <http://mycompany.com/resource/Prague> }

UNION {<http://dbpedia.org/resource/Prague> owl:sameAs <http://mycompany.com/resource/Prag>}

}

If you need to check that pattern A AND pattern B are both satisfied, you may use the following approach:

ASK WHERE {

{<http://dbpedia.org/resource/Prague> owl:sameAs <http://mycompany.com/resource/Prague> }

{<http://dbpedia.org/resource/Prague> owl:sameAs <http://mycompany.com/resource/Prag>}

}

Note

In order to use this extension, you have to build your DPUs with Plugin-devEnv version 2.1.7+. In pom.xml, you have to define:

<parent>
<groupId>eu.unifiedviews</groupId>
<artifactId>uv-pom-dpu</artifactId>
<version>2.1.7</version>
<relativePath />
</parent>

Note

To check the number of triples in the given RDF data unit:

#check there is 197 triples extracted

ASK {

{

SELECT (COUNT(*) as ?count)

WHERE {

?s ?p ?o

}

}

FILTER (?count=197)

}