Skip to content

Commit

Permalink
Review owl:cardinality and owl:maxCardinality
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Nelson <[email protected]>
  • Loading branch information
ajnelson-nist committed Sep 19, 2024
1 parent a30870e commit c3a7a67
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion src/generate_single_stub_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,18 @@ def resolve_max_cardinality(
;\
.\
\
ex:D\
a owl:Class ;\
rdfs:subClassOf\
ex:B ,\
[\
a owl:Restriction ;\
owl:onProperty ex:foo ;\
owl:cardinality "1"^^xsd:nonNegativeInteger ;\
]\
;\
.\
\
ex:foo\
a owl:AnnotationProperty ;\
.\
Expand All @@ -132,6 +144,8 @@ def resolve_max_cardinality(
3
>>> resolve_max_cardinality(g, ns_ex["C"], ns_ex["foo"])
2
>>> resolve_max_cardinality(g, ns_ex["D"], ns_ex["foo"])
1
"""
max_counts: Set[int] = set()
query = """\
Expand All @@ -151,8 +165,18 @@ def resolve_max_cardinality(
?nRestriction
a owl:Restriction ;
owl:onProperty ?nProperty ;
owl:maxCardinality ?lMaxCount ;
.
{
?nRestriction
owl:cardinality ?lMaxCount ;
.
}
UNION
{
?nRestriction
owl:maxCardinality ?lMaxCount ;
.
}
}
}
"""
Expand Down

0 comments on commit c3a7a67

Please sign in to comment.