.
This commit is contained in:
+20
-2
@@ -56,6 +56,24 @@ impl<'a> Indexer<'a> {
|
||||
])
|
||||
}
|
||||
|
||||
fn work(&self, graph: &Graph, subject: NamedNodeRef) -> HashMap<Field, OwnedValue> {
|
||||
HashMap::from_iter([
|
||||
(
|
||||
Schema::field("title", self.language.primary_language()),
|
||||
self.extract_string(graph, subject, vocab::rdawd::TITLE_OF_WORK),
|
||||
),
|
||||
])
|
||||
}
|
||||
|
||||
fn expression(&self, graph: &Graph, subject: NamedNodeRef) -> HashMap<Field, OwnedValue> {
|
||||
HashMap::from_iter([
|
||||
(
|
||||
Schema::field("title", self.language.primary_language()),
|
||||
self.extract_string(graph, subject, vocab::rdaed::TITLE_OF_EXPRESSION),
|
||||
),
|
||||
])
|
||||
}
|
||||
|
||||
pub fn graph(&self, graph: &Graph) -> crate::Result<Vec<HashMap<Field, OwnedValue>>> {
|
||||
let mut entities_and_types = HashSet::new();
|
||||
let triples = graph.triples_for_predicate(vocab::rdf::TYPE);
|
||||
@@ -73,10 +91,10 @@ impl<'a> Indexer<'a> {
|
||||
Class::RdfProperty => None,
|
||||
Class::RdfsClass => None,
|
||||
Class::SkosConcept => None,
|
||||
Class::Work => Some(self.person(graph, *subject)),
|
||||
Class::Work => Some(self.work(graph, *subject)),
|
||||
Class::Person => Some(self.person(graph, *subject)),
|
||||
Class::CorporateBody => Some(self.corporate_body(graph, *subject)),
|
||||
Class::Expression => Some(self.person(graph, *subject)),
|
||||
Class::Expression => Some(self.expression(graph, *subject)),
|
||||
Class::Manifestation => Some(self.person(graph, *subject)),
|
||||
}.map(|mut document| {
|
||||
document.insert(Schema::discriminant_field(), OwnedValue::from(class as u64));
|
||||
|
||||
Reference in New Issue
Block a user