Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
461 changes: 200 additions & 261 deletions Cargo.lock

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions crates/database/src/serializers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,11 @@ pub struct SerializationDataBuffer {
/// Used in cases where multiple elements should refer to a particular instance.
/// E.g. multiple properties referring to the same instance of owl:Thing.
global_element_mappings: HashMap<ElementType, usize>,
/// Canonical synthesized Thing node per resolved domain.
///
/// This lets structurally-defined ranges like complement/union expressions
/// collapse to the same Thing node that direct owl:Thing ranges use.
anchor_thing_map: HashMap<Term, Term>,

/// Stores the edges of a property.
///
Expand Down Expand Up @@ -237,6 +242,7 @@ impl SerializationDataBuffer {
edge_redirection: HashMap::new(),
edges_include_map: HashMap::new(),
global_element_mappings: HashMap::new(),
anchor_thing_map: HashMap::new(),
label_buffer: HashMap::new(),
edge_label_buffer: HashMap::new(),
edge_buffer: HashSet::new(),
Expand Down
746 changes: 554 additions & 192 deletions crates/database/src/serializers/frontend.rs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion crates/sparql_queries/src/assembly.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ impl QueryAssembler {
format!(
r#"
{}
SELECT ?id ?nodeType ?target ?label
SELECT DISTINCT ?id ?nodeType ?target ?label
WHERE {{
{}
BIND(
Expand Down
5 changes: 1 addition & 4 deletions crates/sparql_queries/src/snippets/general.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ pub const COLLECTIONS: &str = r#"{
?intermediate rdf:first ?firstItem .
?intermediate rdf:rest*/rdf:first ?target .
FILTER(?nodeType IN (
owl:intersectionOf,
owl:unionOf,
owl:oneOf,
owl:disjointUnionOf
owl:oneOf
))

# 6. Safety: Remove nil to avoid phantom edges
Expand Down
7 changes: 4 additions & 3 deletions crates/sparql_queries/src/snippets/owl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ impl SparqlSnippet for OwlNode {
}
OwlNode::DisjointUnion => {
r#"{
?id owl:disjointUnionOf ?target .
?id owl:disjointUnionOf/rdf:rest*/rdf:first ?target .
BIND(owl:disjointUnionOf AS ?nodeType)
}"#
}
OwlNode::IntersectionOf => {
r#"{
?id owl:intersectionOf ?target .
?id owl:intersectionOf/rdf:rest*/rdf:first ?target .
BIND(owl:intersectionOf AS ?nodeType)
}"#
}
Expand All @@ -62,7 +62,8 @@ impl SparqlSnippet for OwlNode {
}
OwlNode::UnionOf => {
r#"{
?id owl:unionOf ?list .
?id owl:unionOf/rdf:rest*/rdf:first ?target .
FILTER(?target != rdf:nil)
BIND(owl:unionOf AS ?nodeType)
}"#
}
Expand Down
1 change: 1 addition & 0 deletions crates/sparql_queries/src/snippets/rdfs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ impl SparqlSnippet for RdfsNode {
r#"{
?id a rdfs:Class .
FILTER(?id != owl:Class)
FILTER NOT EXISTS { ?id a owl:Class }
BIND(rdfs:Class AS ?nodeType)
}"#
}
Expand Down
1 change: 1 addition & 0 deletions src/errors.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@