This commit is contained in:
2026-08-23 14:20:48 -04:00
parent e28cfd1c53
commit 8f6e2b3ac6
8 changed files with 82 additions and 132 deletions
+5 -3
View File
@@ -118,15 +118,17 @@ impl<'a> Indexer<'a> {
results
}
pub fn ontology(&self, entities: HashMap<NamedNode, (NamedNode, ResourceDescription)>) -> Vec<HashMap<Field, OwnedValue>> {
pub fn ontology(&self, entities: HashMap<NamedNode, ResourceDescription>) -> Vec<HashMap<Field, OwnedValue>> {
let label_field = Schema::field("label", self.language.primary_language());
let definition_field = Schema::field("definition", self.language.primary_language());
entities.iter()
.map(|(subject, (class, description))| {
.map(|(subject, description)| {
let mut document = HashMap::with_capacity(4);
let discriminant = Class::try_from_named_node(class)
let discriminant = description.class
.as_ref()
.and_then(|node| Class::try_from_named_node(node.as_ref()))
.map(|doc_type| doc_type as u64)
.map(OwnedValue::U64)
.unwrap_or(OwnedValue::Null);