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

complex restrictions are added to both table and context #188

Open
keski opened this issue Apr 4, 2023 · 0 comments
Open

complex restrictions are added to both table and context #188

keski opened this issue Apr 4, 2023 · 0 comments

Comments

@keski
Copy link
Contributor

keski commented Apr 4, 2023

In version 3.x, complex restrictions are added to the target table and the context (i.e.doc or body). To reproduce the issue, generate documentation with a restriction of the form:

rdfs:subClassOf [ owl:intersectionOf (
    [ a owl:Restriction ; owl:onProperty ssn:isPropertyOf ; owl:allValuesFrom ex:Class1 ]
    [ a owl:Restriction ; owl:onProperty ssn:isPropertyOf ; owl:allValuesFrom ex:Class2 ]  ) ] ;  

This will list the constraints both within the relevant table, as well as immediately following it. The reason is the list comprehension and string join in _setclass_html in utils.py:

return raw(joining_word.join([mem.render() for mem in class_set]))

Since the elements in class_set are rendered and added only as text to raw they are never actually added to any element and will be added to the context when it closes. From the dominate docs:

When the context is closed, any nodes that were not already added to something get added to the current context.
nicholascar added a commit that referenced this issue Jul 26, 2024
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

1 participant