Skip to content

Commit

Permalink
(fix) adds missing handling of DataUnionOf in RDF and OWX readers.
Browse files Browse the repository at this point in the history
  • Loading branch information
filippodebortoli committed Mar 8, 2024
1 parent 9da51a6 commit 6222654
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
5 changes: 5 additions & 0 deletions src/io/owx/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1025,6 +1025,11 @@ from_start! {
till_end(r, b"DataIntersectionOf")?
)
}
b"DataUnionOf" => {
DataRange::DataUnionOf(
till_end(r, b"DataUnionOf")?
)
}
b"DataComplementOf" => {
DataRange::DataComplementOf(
Box::new(from_next(r)?)
Expand Down
19 changes: 14 additions & 5 deletions src/io/rdf/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,15 @@ impl<'a, A: ForIRI, AA: ForIndex<A>> OntologyParser<'a, A, AA> {
)
}
}
[[_, Term::OWL(VOWL::UnionOf), Term::BNode(bnodeid)],//: rustfmt hard line!
[_, Term::RDF(VRDF::Type), Term::RDFS(VRDFS::Datatype)]] =>
{
ok_some! {
DataRange::DataUnionOf(
self.fetch_dr_seq(bnodeid)?
)
}
}
[[_, Term::OWL(VOWL::DatatypeComplementOf), term],//:
[_, Term::RDF(VRDF::Type), Term::RDFS(VRDFS::Datatype)]] =>
{
Expand Down Expand Up @@ -2329,11 +2338,6 @@ mod test {
assert_eq!(amont.i().declare_class().count(), 1);
}

#[test]
fn datatype() {
compare("datatype");
}

#[test]
fn object_has_value() {
compare("object-has-value");
Expand Down Expand Up @@ -2369,6 +2373,11 @@ mod test {
compare("object-exact-cardinality");
}

#[test]
fn datatype() {
compare("datatype");
}

#[test]
fn datatype_alias() {
compare("datatype-alias");
Expand Down

0 comments on commit 6222654

Please sign in to comment.