ISAITB / validator-resources-dcat-ap

Validator resources for the DCAT-AP RDF validator.
1 stars 2 forks source link

[dcat:theme and dct:type] Value must be an instance of skos:Concept #2

Closed javicond3 closed 2 years ago

javicond3 commented 3 years ago

I used the https://www.itb.ec.europa.eu/shacl/dcat-ap/upload to validate the following rdf against DCAT-AP 2.0.1 Ranges Zero and DCAT-AP 2.0.1 Ranges

<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF
  xmlns:foaf="http://xmlns.com/foaf/0.1/"
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:dcat="http://www.w3.org/ns/dcat#"
  xmlns:dct="http://purl.org/dc/terms/"
  xmlns:skos="http://www.w3.org/2004/02/skos/core#"
>
  <dcat:Dataset>
    <dcat:theme rdf:resource="http://publications.europa.eu/resource/authority/data-theme/EDUC"/>
    <dcat:distribution>
      <dcat:Distribution>
        <dct:license>
            <dct:LicenseDocument>
                <dct:type rdf:resource="http://purl.org/adms/licencetype/PublicDomain"/>
            </dct:LicenseDocument>
        </dct:license>
      </dcat:Distribution>
    </dcat:distribution>
    <dct:publisher>
      <foaf:Agent>
        <dct:type rdf:resource="http://purl.org/adms/publishertype/Academia-ScientificOrganisation"/>
        <foaf:name>exampleorg</foaf:name>
      </foaf:Agent>
    </dct:publisher>
  </dcat:Dataset>
</rdf:RDF>

I got the following errors:

However, in the three cases the values are tagged as skos:Concept in their original definition <rdf:type rdf:resource="http://www.w3.org/2004/02/skos/core#Concept"/>. Links:

javicond3 commented 3 years ago

It could be solved by wrapping the elements inside <skos:Concept> but it should not be required as in the original source they are already defined as skos:Concept

Example of wrapping to solve but not desirable:

    <dcat:theme>
        <skos:Concept rdf:about="http://publications.europa.eu/resource/authority/data-theme/EDUC"/>
    </dcat:theme>
bertvannuffelen commented 3 years ago

@javicond3 the inclusion of the controlled vocabularies is only done in the option: DCAT-AP 2.0.1 Controlled Vocabularies. (See https://github.com/ISAITB/validator-resources-dcat-ap/blob/master/resources/config.properties#L27)

The reason for this split is two-fold:

As the ranges check for the type, this codelist constrainted properties will probably fail without including the controlled vocabularies as the categorization of being a skos:Concept is part of the codelist. For coherency reasons I included them in the ranges* shape files.

Note that this split in several files is system/application agnostic. The split is based on the constraint type. Unfortunately there is no perfect split possible satisfying all possible usecases.

javicond3 commented 3 years ago

Thanks a lot for the reply, it has all the sense that it is difficult to satisfy all the cases.

However, I have tried to include the controlled vocabularies with the DCAT-AP 2.0.1 Ranges through the DCAT-AP Development option and the problem still remains. The problem is due to that the controlled vocabularies import (https://github.com/ISAITB/validator-resources-dcat-ap/blob/master/resources/config.properties#L29) only imports the http://publications.europa.eu/resource/authority/data-theme definition and not the http://publications.europa.eu/resource/authority/data-theme/EDUC (which is the one that types EDUC as a skos:Concept).

In order to include the controlled vocabularies with the other options I would propose the following alternatives: