Code Monkey home page Code Monkey logo

shacl-plugin's Introduction

SHACL4Protege v1.2.0

A SHACL constraint validation plugin for Protégé Desktop [1].

Screenshot of SHACL Editor

The plugin provides a tab, in which you can open and edit a SHACL file (see B), to validate the ontology that is loaded in Protégé (see A).

Further, you can filter the result table by the classes and individuals of the ontology (see C).

About

The plugin is tried and tested using Protege 5.5.0 on and Mac OSX Sonoma (14.4) with OpenJDK Temurin 8.

The plugin developed using TopBraid SHACL Engine 1.3.2 [2] and Apache Jena 3.17.0 [3].

The plugin was developed by Xiashuo Lin (@xlin) and Fajar Ekaputra (@fekaputra) at TU Wien. Later on, André Wolski (@locke) contributed significantly to clean up the old code and added several features.

How to use

  1. Open Protégé Desktop
    • Select File -> Check for plugins... to get the list of available plugins. Select "SHACL4Protege Constraint Validator" and "Install" it
    • Alternatively: Download the latest jar file from the latest release and copy it into the /plugins folder of your Protégé Desktop installation
  2. Restart Protégé Desktop
  3. (optional) Download the example file example3-data.owl
    • open it in Protégé Desktop
  4. Open Window -> Tabs -> SHACL Editor
    • By default, the SHACL Editor has pre-loaded SHACL constraints for the example ontology of step 3
    • You can modify the constraints, or load a different SHACL file into the editor
    • Click the "Validate" button below the SHACL editor to validate the ontology that is loaded in Protégé against the shapes defined in the SHACL editor
  5. (alternative) Open Window -> Tabs -> Minimal SHACL Editor
    • Click the "Validate" button below the SHACL editor to validate the ontology that is loaded in Protégé against the shapes defined in the SHACL editor

[1] https://protege.stanford.edu/
[2] https://github.com/TopQuadrant/shacl
[3] https://github.com/apache/jena

shacl-plugin's People

Contributors

dependabot[bot] avatar fajarjuang212 avatar fekaputra avatar johardi avatar jvendetti avatar locke avatar matthewhorridge avatar mosfet80 avatar x-lin avatar xristy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

shacl-plugin's Issues

Validating imported triplets

Hi!

I am trying to validate an owl ontolgy (default), that imports an other owl ontology (kavoc). At some point I have the following property shape:

sh:property [
	sh:path kavoc:typeOfDefinition ;
	sh:class kavoc:PsiDefinitionType;
	sh:minCount 1 ;
	sh:maxCount 1 ;
] ;

Now, the instances of the class kavoc:PsiDefinitionType are also defined in the kavoc ontology, and the SHACL engine drops me a validation error: "Value must be an instance of kavoc:PsiDefinitionType". If I move the instances to the default ontology, it works no problem.

The SHACL specification says: "The data graph is expected to include all the ontology axioms related to the data...", so I suppose the SHACL engine ignores any imported triplets. Is this the expected behavior?

Is there any way to include the imported ontology in the validation process?

Thank you in advance!

Regards,

Attila

SHACL File for example3-data?

I'm creating a revised version of the Pizza tutorial, the extended one here: http://mowl-power.cs.man.ac.uk/protegeowltutorial/resources/ProtegeOWLTutorialP4_v1_3.pdf

I always thought this was the best one but it is a little out of date with the current Protege UI. I also want to add new sections for SPARQL, SWRL, and SHACL. I know the first two very well but am just getting started with SHACL. I added some employees to the Pizza tutorial and then used the existing example in the validator window with ssn as a template to define constraints for employee ssn data properties.

However, then I noticed that there was an example3-data.owl file. I downloaded that and ran the validation. I may just not be understanding how SHACL works but my understanding is that there are separate files for the SHACL shapes. That's what I did with my Pizza example. However, I don't see a shapes file for the example3 owl file and when I looked in the owl file also didn't see any SHACL shapes. But there seems to be constraints about the hasFather property which aren't defined in the sample shapes file that is the default when I start the plugin tab.

I don't understand where the validator is getting those father shape constraints from.

Missing License

Hi, I'd love to use this plugin, maybe even contribute but there needs to be a license specified so we can determine if it can be used. Therefore can you please add a license to this repository?

Example file?

#3 in the Readme file is a bit unclear. It says, "(optional) Download the owl file from the latest release" but if I go to the latest release I see no OWL file. Is it supposed to be in the JAR file? In the Source file? Please provide a working demo use case.

needs document

Is there any document available help me to ues this plugin?
I have found this paper SHACL4P: SHACL constraints validation within Protégé ontology editor, but I have no access to full text.

Constaint Tree: error

When loading the SHACL plugin I get an error within Protege in the constraint tree view.

An error occurred whilst creating the view ClassNotFoundException:
at.ac.tuwien.shacl.plugin.ShaclConstraintTreeViewComponent not found by at.ac.tuwien.shacl.plugin [2 1]

screen shot 2018-09-18 at 8 16 59 pm

Proposal to consider releasing a version for RDF Protege (a Jena based Protege fork).

Why?

  • I think, SHACL is more about RDF, not OWL.
    And there is a solution which offers RDF support out-of-the box: RDF Protege.
    I think it is a little bit more appropriate platform, then the original OWLAPIv4-based Protege.

  • at.ac.tuwien.shacl.plugin.syntax.JenaOwlConverter is actually a bit buggy, inefficient and limited solution (sure, this is obvious).
    There is a RDF-centric OWLAPI-v5 implementation that offers direct reading OWL without any converting.

I think that the described subject could be interesting if not to the authors of this repository,
then at least to those who are faced with the limitations of the classic converters-like solutions.

Thanks for attention

SHACL-SPARQL

Hi guys, is it possible to express SPARQL-based constraints within SHACL4P?

Improve undo/redo

Currently the undo/redo functionality is implemented so that the text pane needs focus and captures key strokes.

I see two possibilities to improve the user experience:

  1. add buttons for undo/redo above the text pane / after the Open/Save/Validate buttons.

  2. Protégé has a separate functionality for undo/redo, that is available in the Edit menu. It might be possible to integrate with this, however I fear this could get complicated.

image

SHACL rule example in Protege

Hi, I tried to replicate the example in Section 8.1:
https://w3c.github.io/shacl/shacl-af/
to try out sh:rule in Protege and the SHACL plugin (with the Pellet reasoner running).

Unfortunately, I could not replicate the results (that is, a new axiom is inferred for the ex:SquareRectangle)

I used the below ontology/data file and the first example shapes graph (in green) in Section 8.1

Any ideas??

Cheers - Renato

=========

@Prefix rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# .
@Prefix xsd: http://www.w3.org/2001/XMLSchema# .
@Prefix rdfs: http://www.w3.org/2000/01/rdf-schema# .
@Prefix ex: http://www.example.org/# .

ex:onto rdf:type owl:Ontology ;
rdfs:label "Test" .

ex:Rectangle rdf:type owl:Class ;
rdfs:label "Rectangle" .

ex:height rdf:type owl:DatatypeProperty ;
rdfs:range xsd:integer .

ex:width rdf:type owl:DatatypeProperty ;
rdfs:range xsd:integer .

ex:InvalidRectangle
a ex:Rectangle .

ex:NonSquareRectangle
a ex:Rectangle ;
ex:height 2 ;
ex:width 3 .

ex:SquareRectangle
a ex:Rectangle ;
ex:height 4 ;
ex:width 4 .

usage across different windows

When working with multiple Protégé windows (i.e. open one ontology, then open second one and select "No" to open that second one in a new window) the validation results are shared across both windows / clicking validate in one window updates the table in the other window as well.

image

image

NOTE: I have not debugged this yet, but want to record the behavior as a reminder to do so (or for anybody else who might want to investigate).
I assume that the same ShaclValidation Observable is used from both ShaclConstraintViolationPanels.
The described issue might not be the only problem when working with multiple windows.

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.