The ADF Validator allows validating ADF and TTL files.

Downloads

How to see help and get list of current features?

java -jar adf-validator-x.y.z.jar --help

How to validate an ADF file?

java -jar adf-validator-x.y.z.jar --adf “C:\path\to\data.adf” --shapes “C:\path\to\shape.ttl”

The command line above validates the specified ADF file “C:\path\to\data.adf” against the specified shape file “C:\path\to\shape.ttl”.

How to validate an ADF file with external ontologies?

java -jar adf-validator-x.y.z.jar --adf “C:\path\to\data.adf” –-ttl “C:\path\to\ontology.ttl” --shapes “C:\path\to\shape.ttl”

The command line above validates the specified ADF file “C:\path\to\data.adf” against the specified shape file “C:\path\to\shape.ttl” using vocabulary from “C:\path\to\ontology.ttl”.

How to validate an ADF file in a specific context?

Validation of ADF in specific contexts requires shapes to be separated by context in named graphs. You have to specify a root node in your data model that is targeted by a defined root shape. Root shape is specified by parameter –rootshape. Root nodes can be either specified by explicit IRI (parameter –root) or they can be determined dynamically by a SPARQL query (parameter –rootquery). Context of validation is specified with parameter –context.

java -jar adf-validator-x.y.z.jar 
  --adf "C:\path\to\data.adf"
  --ttl "C:\path\to\ontology.ttl" 
  --shapes "C:\path\to\shapes.ttl" 
  --context "ex:ExampleContext" 
  --root "urn:uuid:38192658-92c6-41ae-aeab-aeca2499d3c1"
  --rootshape "ex:ExampleShape"

 

java -jar adf-validator-x.y.z.jar 
  --adf "C:\path\to\data.adf"
  --ttl "C:\path\to\ontology.ttl" 
  --shapes "C:\path\to\shapes.ttl" 
  --context "ex:ExampleContext" 
  --rootquery "select ?root where { ?root a ex:Class . }"
  --rootshape "ex:ExampleShape"

Using the report parameter

java -jar validator.jar --adf “C:\path\to\data.adf” --shapes “C:\path\to\shape.ttl” –-report

By default ADF validator prints validation result that validated model is either valid or invalid. Option –report prints a detailed validation report listing all validation errors.

Using the mapping parameter

java -jar validator.jar --adf “C:\path\to\data.adf” --shapes “C:\path\to\shape.ttl” --mapping “C:\path\to\mapping.ttl” -–report

In order to link data to shape, the specified mapping file explicitly states, which target nodes will be validated by which shape.

Using the ttl parameter

java -jar adf-validator-x.y.z.jar --ttl “C:\path\to\data.ttl” --shapes “C:\path\to\shape.ttl”

The –ttl parameter allows validating a ttl file instead of an ADF file.

Example of instance data in data.adf

<urn:uuid:8ffc7b5f-f86f-4a0c-bdb1-c3068f6db1b4> a af-p:AFP_0000925 ;
       dct:title "detection 1" .

Example of shape.ttl

afs-r:detection-1-shape a shacl:NodeShape ;
 shacl:name "detection 1" ;
 shacl:property [ 
   a shacl:PropertyShape ;
   shacl:hasValue af-p:AFP_0000925 ;
   shacl:minCount "1"^^xsd:int ;
   shacl:nodeKind shacl:IRI ;
   shacl:path ( rdf:type [ shacl:zeroOrMorePath rdfs:subClassOf ] )
 ] ;
 shacl:property [ 
   a shacl:PropertyShape ;
   shacl:datatype xsd:string ;
   shacl:minCount "0"^^xsd:int ;
   shacl:nodeKind shacl:Literal ;
   shacl:path dct:title
 ] .

Example of mapping.ttl

afs-hr:detection-1-shape shacl:targetNode <urn:uuid:8ffc7b5f-f86f-4a0c-bdb1-c3068f6db1b4> .

Expected validation report

[ a shacl:ValidationReport ;
 shacl:conforms true ] .