Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sh:datatype instead of sh:class for schema:URL #11

Open
SvenLieber opened this issue May 19, 2020 · 2 comments
Open

sh:datatype instead of sh:class for schema:URL #11

SvenLieber opened this issue May 19, 2020 · 2 comments

Comments

@SvenLieber
Copy link

I think the lines 227 and 363 of the SHACL shape are incorrect.

According to the shape how it is now the following data would be valid:

@prefix ex: <https://example.org/ns#> .
@prefix dct: <http://purl.org/dc/terms/> .
@prefix schema: <https://schema.org/> .

ex:myDataset a dct:Dataset ;
  schema:image ex:imageURL .

ex:imageURL a schema:URL .

However, according to schema.org schema:URL is a datatype hence data using it should look like this:

@prefix ex: <https://example.org/ns#> .
@prefix dct: <http://purl.org/dc/terms/> .
@prefix schema: <https://schema.org/> .

ex:myDataset a dct:Dataset ;
  schema:image "http://imageURL.com"^^schema:URL .

Thus the shape should state the constraint sh:datatype instead of sh:class in the mentioned lines.

@retog
Copy link
Contributor

retog commented Oct 6, 2020

Hi @SvenLieber , sorry for the late reply. https://schema.org/image accepts as value both schema:URL and schema:ImageObject. The latter would be a (potentially) name resource, I believe this to be the better approach as it allows the image to be the subject of additional triples.

@prefix ex: <https://example.org/ns#> .
@prefix dct: <http://purl.org/dc/terms/> .
@prefix schema: <https://schema.org/> .

ex:myDataset a dct:Dataset ;
  schema:image ex:imageURL .

ex:imageURL schema:caption "An awesome image"@en.

@SvenLieber
Copy link
Author

Hi @retog thanks for your reply.
Indeed, the use of schema:ImageObject allows to add more provenance information.
But in case a data portal uses the schema:URL variant (or both) the snippet below would be compliant to the intended meaning of schema.org.

However, I also just saw now on a more detailed look that in your readme you actually mention that schema:URL is used as a class instead of a datatype because of the underlying eCH-0200 specification. Sorry, I didn't see that remark when opening the issue.
Thus, feel free to close the issue :-)

  sh:property [
      sh:path schema:image ;
      sh:maxCount 3 ;
      sh:severity sh:Violation ;
      sh:or (
            [
                sh:datatype schema:URL ;
            ]
            [
                sh:class schema:ImageObject ;
            ]
        )
    ] ;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants