This software performs the validation of DCAT-AP rdf files. Validation is performed via a web form which loads a file (Turtle, RDF/XML, N-triples, JSON-LD) as graph in a triplestore and it queries the triple store with a SPARQL query. The output of the validation can be in XML (HTML with xslt transformation), JSON, Text, CSV, TSV.
The validator is located in the pages folder.The validator is based on the dcat-ap_validator.html file which includes the dcat.js file responsible for loading the SPARQL query (dcat-ap.rq) and contacting the triplestore (Fuseki). If the result of the query is in XML format there is an XSLT stylesheet applied (xml-to-html-dcat-ap).
The SPARQL query contains several rules which are based on those available here: DCAT-AP Final 1.1
All the rules are stored in the rules folder. For almost each rule a test and a test data have been created.
Each rule is indicated with a progressive id number (starting from 0) and stored in a file named with the convention:
rule-id.rq
Therefore, for example, the rule 0 is stored in the file rule-0.rq.
Each rule is a SPARQL query which has been documented with sparql-doc annotations and validated with the online sparql validator.
When a rule is validated it is added to the dcat-ap.rq file (locates inside the pages folder) which is then loaded into the the web form via the dcat-ap_validator.js file.
Test data are located in tests-data folder and they are xml/rdf files to be tested against.Each test data is directly connected to the rule id number and stored in a file named with the convention:
test-rule-id.rdf
Therefore, for example, the test data related to the rule 0 is stored in the file test-rule-0.rdf Not all the test data are implemented, for example literals are not tested.
Tests are located in tests folder and they are Javascript files.A test exists only if the test-data has been created. A test file follows the name convention:
test-rule-id.js
Therefore, for example, the test which will validate again the test-rule-0.rdf will be called simply test-rule-0.js This is important because each test uses the rule number to open the related test data file.
Each tests performs 2 checks:
- The number of results of the validation of test data is the one expected
- The rule ID of the results is the one expected
- The validator uses Fuseki 1 as triple store which you can download from the tools directory (jena-fuseki1-1.1.2-distribution.zip) or from an Apache mirror site.
- Unpack the binary distribution to your a
FUSEKI_HOME
folder of your choice. - Copy the content of the pages folder under the
FUSEKI_HOME
folder. Keep the folder structure in tact. Verify that the file 'dcat-ap_validator.html' is in theFUSEKI_HOME/pages
folder. - Fuseki requires a Java Runtime Environment to be installed on your machine
- Launch Fuseki using the command in 'start_dcat-ap_validator.bat'
- As of version 1.1.0 launch the node server using the command in 'start_dcat-ap_validator-server.bat'
- Direct your browser to http://localhost:3030/dcat-ap_validator.html
- You get this page from Fuseki's internal web server.
- Select one or more RDF files that contain the software metadata to validate. Optionally, also controlled vocabularies can be incldued to verify correct usage of them.
- Optionally, you can set another SPARQL endpoint, output format, or even modify the SPARQL validation query.
- Hit the 'Validate' button. Fuseki returns the validation results within seconds.
- Jenkins 1.6.2.1 to automate the launch of Ant and get the code from Github. Jenkins has been installed with:
- the Github plugin, to download the code from GitHub
- the Violation plugin, to monitor the JSLint errors (inside the lib/csslint/jslint.xml file) and CSSlint erros (inside the lib/jslint/csslint.xml file)
- the Xunit plugin, to monitor the result of the test execution; the Xunit plugin reads the xunit.xml file locatd in tests-execution folder which is generated by casperjs ant task.
- the HTML publisher plugin, to create a link to JSDOC (lib/jsdoc/output/global.html) and Sparql-doc (sparql-doc/index.html) files on the jenkins job.
- Ant 1.9.6, which executes the build.xml to automate all the development process
- jslint4java 2.0.5 which validates the javascript used by the validator accordingly to JSLint rules.
- csslint 0.10.0 (with rhino 1.7.6) to evaluate css errors
- jsdoc3-ant-task-1.0 to generate jsdoc documentation
- sparql-doc 0.0.4 which generates HTML documentation based on rules (SPARQL queries). Sparql-doc is installed on Windows machine after Railsinstaller 2.2.5 for Ruby 1.9 (required by sparql-doc) with the command:
gem install sparql-doc
- YUI compressor to compress css and javascript files
- Jquery UI to display tabs
- Codemirror for syntax highlight in direct input tab and in the SPARQL query text area
- DataTables 1.10 to display results with ordering, pagination and search.
- casperjs 1.1 beta (based on phantomjs 1.9.2) to execute all the tests.
- Node v4.2.1 for server requests with module request.
- JavaScript Cookie v2.0.3 for cookie management.
Action | Priority | Status |
---|---|---|
Add compatibility with virtuoso, see api at: http://virtuoso.openlinksw.com/dataspace/doc/dav/wiki/Main/VirtGraphProtocolCURLExamples | High | Not done |
Add automatic tests for file url and direct input | Medium | Not done |
Improve quality of the tests: parametrize comments, categorization by node (dataset, agent, etc.) | Medium | Not done |
Add toggle columns in the results (in case more data are returned->better queries) | Medium | Not done |
Add possible html compressor such as: https://code.google.com/p/htmlcompressor/ | Low | Not done |
Homogenize css between build.css, dcat-ap_validator.css and dcat-ap_validator-results.css | Low | Not done |
Improve W3C and WCAG 2.0 validation for the results | Low | Not done |