1

I've currently tried using the python library pySHACL to validate them. It works if I do not have version 1.1 specific things in it's context.

For example, to validate this data graph:

{
    "@context": {
        "@version": 1.1,
        "@vocab": "http://schema.org/",
        "reproterms": "https://raw.githubusercontent.com/sanuann/schema-standardization/master/terms/",
        "reproschema": "https://raw.githubusercontent.com/sanuann/schema-standardization/master/schemas/",
        "preamble": {
            "@id": "reproterms:preamble",
            "@container": "@language"
        }
    },
    "@id": "https://raw.githubusercontent.com/sanuann/schema-standardization/master/activities/PHQ-9/phq9_schema",
    "@type": "reproschema:Activity",
    "preamble": 123
}

I have written a SHACL shape graph:

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix schema: <http://schema.org/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix dash: <http://datashapes.org/dash#> .
@prefix reproterms: <https://raw.githubusercontent.com/sanuann/schema-standardization/master/terms/> .
@prefix reproschema: <https://raw.githubusercontent.com/sanuann/schema-standardization/master/schemas/> .
schema:ActivityShape
    a sh:NodeShape ;
    sh:targetClass reproschema:Activity ;
    sh:property [
        sh:path reproterms:preamble;
        sh:datatype xsd:string ;
        sh:maxCount 1 ;
    ] .

This works when the @version: 1.1 is removed from context of the data graph but throws error otherwise. (I use PySHACL to validate). How do I validate the data graph without removing the version key?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.