Code Monkey home page Code Monkey logo

Comments (2)

jameshowison avatar jameshowison commented on June 12, 2024 1

Spot on, that was the issue. Indeed conforms was true once I printed it (that code was initially from a Notebook hence not having print on the last line). Debug set to false removed that message.

I also tested by defining a Shape for the sh:qualifiedValueShape (so not an anonymous shape anymore). That removes the other warning even with Debug=true.

schema:DocumentShape
    a sh:NodeShape ;
    sh:targetClass schema:Document ;
    sh:property [
        sh:message "At least one Author" ;
        sh:path schema:isTargetOf ;
        sh:qualifiedMinCount 1 ;
        sh:qualifiedValueShape schema:CodeShape ;
    ] ;
.

schema:CodeShape
    a sh:NodeShape ;
    sh:targetClass schema:HasAuthor ;
    sh:property [
        sh:message "code needs a single T/F value for schema:isPresent" ;
        sh:path schema:isPresent ;
        sh:datatype xsd:boolean ;
        sh:maxCount 1 ;
        sh:minCount 1 ;
    ]
.

Anyway I turned debug off (since I don't need it :) but this was helpful anyway for me to understand what's happening in shacl :)

from pyshacl.

ashleysommer avatar ashleysommer commented on June 12, 2024

Hi @jameshowison.

There are three Shacl Shapes defined in that ShapesFile. There's the NodeShape called schema:DocumentShape, an anonymous PropertyShape on its sh:property, and an anonymous NodeShape given on the sh:qualifiedValueShape constraint.

You're not seeing a sh:message because the constraint that is failing is the ClassConstraint in the anonymous shape given on sh:qualifiedValueShape, and that shape doesnt have a sh:message.

The DocumentShape and it's property-shape are both still passing.

What is the value of the conforms variable after the validation result is returned? I believe it will be True becuse the qualifiedValueShape constraint still passes, and your data is still conformant.

You are seeing that extra violation in the command line output because you have debug=True, it will show all violations, even including the ones which do not cause your data to be non-conformant.

from pyshacl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.