-
Notifications
You must be signed in to change notification settings - Fork 52
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
Additional SHACL support to Ontospy/gendocs #107
Additional SHACL support to Ontospy/gendocs #107
Commits on Dec 8, 2021
-
Add module to determine SHACL property constraints
This patch is the first in a series to bring Ontospy's current state of SHACL support up to the level where the Shapes pages are built. Serialization will be handled in a later patch. ontospy/core/shacl_helper.py: * Returns dictionary of SHACL property constraints, given an Ontospy object ontospy/core/ontospy.py: * Imports shacl_helper to build SHACL property constraints * Amends call to build SHACL property constraints at end of build_shapes method - Modifies logic to allow all_shapes to be built Co-authored-by: Dr. Stanley A Bernsteen <sbernste@mitre.org> Signed-off-by: TJ Balon <tbalon@mitre.org>
Configuration menu - View commit details
-
Copy full SHA for fbe099f - Browse repository at this point
Copy the full SHA fbe099fView commit details -
Formatting changes to browser_shapeinfo.html
This patch modifies the browser_shapeinfo.html file to adjust the formatting and provide documentation. The patch has no functional changes. Modifications: * Addition of comments to note logic for panels * Reformat HTML to conventional tag indentation * Remove excess whitespace Co-authored-by: Dr. Stanley A Bernsteen <sbernste@mitre.org> Signed-off-by: TJ Balon <tbalon@mitre.org>
Configuration menu - View commit details
-
Copy full SHA for 5fee4eb - Browse repository at this point
Copy the full SHA 5fee4ebView commit details -
Add shape properties to browser_shapeinfo.html
This modifies the browser_shapeinfo.html file to display the SHACL shape properties based on the OntoShape object that is rendered on the HTML page. Co-authored-by: Dr. Stanley A Bernsteen <sbernste@mitre.org> Signed-off-by: TJ Balon <tbalon@mitre.org>
Configuration menu - View commit details
-
Copy full SHA for 4a6d48c - Browse repository at this point
Copy the full SHA 4a6d48cView commit details -
Function to check if an OWL.Class is SH.NodeShape
This patch adds functionality to the HTML rendering portion of the ontodocs, and includes an additional namespace for rdflib. ontospy/ontodocs/viz/viz_html_multi.py: * Adds function to identify OWL Classes which define themselves as SHACL Node Shapes - shape and class URIs must match - must be of RDF.type: SH.NodeShape - must be of RDF.type: OWL.Class ontospy/core/utils.py: * Imports SH namespace for rdflib Co-authored-by: Alex Nelson <alexander.nelson@nist.gov> Signed-off-by: TJ Balon <tbalon@mitre.org>
Configuration menu - View commit details
-
Copy full SHA for 944e835 - Browse repository at this point
Copy the full SHA 944e835View commit details -
For SHACL NodeShapes, replace tree-diagram in HTML
This patch replaces the tree-diagram in the browser_shapeinfo.html file if the shape is a SHACL NodeShape and OWL Class (with matching URIs). ontospy/ontodocs/viz_factory.py: * Imports Library for django.template * Adds filter to call ontospy.core.utils.slugify() from a django template ontospy/ontodocs/viz/viz_html_multi.py: * Checks shapes to see if they are defined as OWL.Class & SH.NodeShape - Updates parents/children of the entity to the matching class's parents/children for the tree-diagram during template rendering ontospy/../browser/browser_shapeinfo.html: * Replaces hyperlinks in tree-diagram to generalize if a shape/class diagram is build built - links are prefixed with "shape-" - slugs are replaced with qname and a call to the slugify filter Signed-off-by: TJ Balon <tbalon@mitre.org>
Configuration menu - View commit details
-
Copy full SHA for 85dff84 - Browse repository at this point
Copy the full SHA 85dff84View commit details -
Formatting changes to browser_classinfo.html
This patch modifies the browser_classinfo.html file to adjust the formatting and provide documentation. The patch has no functional changes. Modifications: * Addition of comments to note logic for panels * Reformat HTML to conventional tag indentation * Remove excess whitespace Co-authored-by: Dr. Stanley A Bernsteen <sbernste@mitre.org> Signed-off-by: TJ Balon <tbalon@mitre.org>
Configuration menu - View commit details
-
Copy full SHA for a53acec - Browse repository at this point
Copy the full SHA a53acecView commit details
Commits on Dec 9, 2021
-
Add 'Property Shapes' to browser_classinfo.html
This patch modifies the browser_classinfo.html file to display a panel for classes which have associated SHACL property shapes. If an ontology does not implement SHACL, there are no functional changes. Co-authored-by: Dr. Stanley A Bernsteen <sbernste@mitre.org> Signed-off-by: TJ Balon <tbalon@mitre.org>
Configuration menu - View commit details
-
Copy full SHA for 1750e87 - Browse repository at this point
Copy the full SHA 1750e87View commit details -
Adjust notion of "Top-level property" to account for SHACL shapes
This patch addresses a use case where an ontology defines no or few rdfs:domain statements for its properties, instead relating properties to classes via SHACL shapes. If a property is associated to classes via SHACL property shapes within an ontology, it does not seem appropriate to treat the property as universally applicable. Co-authored-by: Alex Nelson <alexander.nelson@nist.gov> Signed-off-by: TJ Balon <tbalon@mitre.org>
Configuration menu - View commit details
-
Copy full SHA for f586950 - Browse repository at this point
Copy the full SHA f586950View commit details -
Configuration menu - View commit details
-
Copy full SHA for 153d5fa - Browse repository at this point
Copy the full SHA 153d5faView commit details
Commits on Dec 16, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 141fe7a - Browse repository at this point
Copy the full SHA 141fe7aView commit details -
Match new query's spelling to getSKOSDirectSupers
This patch should have no functional impact, except possibly some speedup from a braces encapsulation. Signed-off-by: Alex Nelson <alexander.nelson@nist.gov>
Configuration menu - View commit details
-
Copy full SHA for ae42fbf - Browse repository at this point
Copy the full SHA ae42fbfView commit details -
Rely on implied sh:targetClass
Review of the SHACL specification showed the sh:targetClass is not explicitly required under certain conditions, cited in getPropsApplicableByShapes. Signed-off-by: Alex Nelson <alexander.nelson@nist.gov>
Configuration menu - View commit details
-
Copy full SHA for 6fa1b3b - Browse repository at this point
Copy the full SHA 6fa1b3bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1d7e289 - Browse repository at this point
Copy the full SHA 1d7e289View commit details -
Have class-shape confirmation function infer targetClass
The SHACL specification, section 2.1.3.3 "Implicit Class Targets", indicates a reflexive sh:targetClass triple is implied for a SHACL Class that is also a Shape. The function updated in this patch reviewed NodeShapes for being classes based on an explicit sh:targetClass statement. This patch changes the check to rely on that triple being implied under the SHACL specification conditions. Additionally, the "Class" definition is adjusted to being a SHACL Class, which covers RDFS Classes in addition to the prior implementation of only OWL classes. References: * https://www.w3.org/TR/shacl/#implicit-targetClass Signed-off-by: Alex Nelson <alexander.nelson@nist.gov>
Configuration menu - View commit details
-
Copy full SHA for 2eb8543 - Browse repository at this point
Copy the full SHA 2eb8543View commit details
Commits on Jan 20, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 805d237 - Browse repository at this point
Copy the full SHA 805d237View commit details
Commits on Mar 11, 2022
-
Configuration menu - View commit details
-
Copy full SHA for c509dd8 - Browse repository at this point
Copy the full SHA c509dd8View commit details
Commits on Apr 11, 2022
-
Rename variable to prevent package name conflict; start type annotati…
…on review This patch starts a series of type system reviews to diagnose a few similarly-appearing bugs. Signed-off-by: Alex Nelson <alexander.nelson@nist.gov>
Configuration menu - View commit details
-
Copy full SHA for 9c3961b - Browse repository at this point
Copy the full SHA 9c3961bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8217329 - Browse repository at this point
Copy the full SHA 8217329View commit details -
Configuration menu - View commit details
-
Copy full SHA for b4dd695 - Browse repository at this point
Copy the full SHA b4dd695View commit details
Commits on Apr 27, 2022
-
A recent release of UCO triggered a documentation build failure, localized to something in `shacl_helper.py`. Review of the code found a few missed characteristics of the SHACL specification. The build failure came from an assumption that a SHACL PropertyShape would always be a blank node. While in UCO this was previously true, a named SHACL Property Shape was introduced, defeating the assumption in `shacl_helper.py`. The issue proved difficult to diagnose. As an aid, the file received type signature additions, to help separate RDFLib types, from OntoSpy types, from types local to `shacl_helper.py`. Some class-level variables also got promoted to module-level variables, because (1) their usage behavior was effectively as a module-level variable, and (2) the design pattern can lead to nefariously difficult behavior to debug. See [1], searching the page for the phrase "mistaken use of a class variable". For the sake of improving code comprehensibility, some coding patterns that were using nested `DefaultDict`s to assist with RDF triple iteration were replaced with using temporary `rdflib.Graph`s, for the `graph.triples()` iterator. It's fair to note this trade for comprehensibility may have come at some runtime expense. With this patch, `shacl_helper.py` independently passes static type review by running `mypy` (version 0.942). Type errors are reported from other files that were reviewed only as deep as was necessary to review `shacl_helper.py`'s type goals (especially `entities.py`), but we consider reviewing type signatures in those files as out of scope of this pull request. Also with this patch, UCO 0.8.0 documentation once again builds. References: * [1] https://docs.python.org/3/tutorial/classes.html Acked-by: TJ Balon <tbalon@mitre.org> Signed-off-by: Alex Nelson <alexander.nelson@nist.gov>
Configuration menu - View commit details
-
Copy full SHA for 9bad9d9 - Browse repository at this point
Copy the full SHA 9bad9d9View commit details