diff --git a/ontology/graphofliberty.ttl b/ontology/graphofliberty.ttl index fcccc2c..aa348ba 100644 --- a/ontology/graphofliberty.ttl +++ b/ontology/graphofliberty.ttl @@ -151,6 +151,12 @@ xsd:unsignedShort rdf:type rdfs:Datatype ; # Classes ################################################################# +### https://graphofliberty.org/2026/04/ont/DerivationMethodology +:DerivationMethodology rdf:type owl:Class ; + rdfs:comment "The methodology used to derive content. Individuals of this class should provide enough information to replicate the process by which the content was generated. For example, if Whisper was used derive captions for an audio book, the precise model used (e.g. large v3), a link to the source code (e.g. HuggingFace) and/or a paper should be provided."@en ; + rdfs:label "Derivation Methodology"@en . + + ### https://graphofliberty.org/2026/04/ont/Entity :Entity rdf:type owl:Class ; rdfs:comment "An Entity is a first-class citizen of the Graph of Liberty catalog. It is the class of all cultural artifacts which are to be preserved."@en ; diff --git a/publish/src/app.rs b/publish/src/app.rs index 6338016..ac39336 100644 --- a/publish/src/app.rs +++ b/publish/src/app.rs @@ -70,6 +70,7 @@ pub(crate) enum Message { NavigateBack, NavigateForward, ResetState, + SetReadOnly(bool), } #[derive(Default, Debug, Clone)] @@ -103,6 +104,7 @@ pub(crate) struct Publisher { url_input_valid: bool, navigator: Navigator, document: RdfSource>, + show_read_only: bool, hovered_row: Option, search_state: Option, index: SearchIndex, @@ -161,6 +163,7 @@ impl Publisher { url_input_valid: true, navigator, document, + show_read_only: false, hovered_row: None, search_state: None, index, @@ -278,11 +281,12 @@ impl Publisher { self.url_input = value; } Message::URLInputSubmitted => { - let url = Url::parse(&self.url_input).expect("Invalid URL"); - if &url != self.navigator.current() { - self.navigator.goto(url.clone()); + if let Ok(url) = Url::parse(&self.url_input) { + if &url != self.navigator.current() { + self.navigator.goto(url.clone()); + } + task = Task::done(Message::NavigateTo(url)); } - task = Task::done(Message::NavigateTo(url)); } Message::NavigateTo(url) => { task = Task::done(Message::DeleteAllRows) @@ -609,6 +613,9 @@ impl Publisher { task = Task::done(Message::URLInputChanged(url.to_string())) .chain(Task::done(Message::NavigateTo(url))); } + Message::SetReadOnly(value) => { + self.show_read_only = value; + } _ => {} } task @@ -883,6 +890,7 @@ impl Publisher { .document .dataset() .iter_both() + .filter(|(_, _, state)| self.show_read_only || !state.read_only) .map(|(key, quad, state)| self.view_row(key, quad, state)) .collect(); @@ -901,6 +909,15 @@ impl Publisher { save_button_base }; + let read_only_toggle = toggler(self.show_read_only) + .on_toggle(Message::SetReadOnly); + + let footer = row![ + space::horizontal(), + text("Show Read Only Triples"), + read_only_toggle + ]; + let content = navigation_area(column![ row![ reindex_ontology_button, @@ -912,6 +929,7 @@ impl Publisher { ], scrollable(body), space::vertical(), + footer, ]) .on_back_click(Message::NavigateBack) .on_forward_click(Message::NavigateForward); diff --git a/publish/src/rdf/term_helper.rs b/publish/src/rdf/term_helper.rs index bc1d18f..371edad 100644 --- a/publish/src/rdf/term_helper.rs +++ b/publish/src/rdf/term_helper.rs @@ -15,7 +15,8 @@ impl<'a> TermHelper<'a> { match self.term.as_ref() { TermRef::Literal(literal) => literal.value(), TermRef::NamedNode(node) => node.as_str(), - _ => unimplemented!(), + TermRef::BlankNode(node) => node.as_str(), + TermRef::Triple(_) => "«triple»", } } @@ -162,6 +163,7 @@ impl<'a> TermHelperMut<'a> { *self.term = Term::Literal(new_literal) } TermRef::NamedNode(_) => *self.term = Term::NamedNode(NamedNode::new_unchecked(value)), + TermRef::BlankNode(_) => *self.term = Term::NamedNode(NamedNode::new_unchecked(value)), _ => unimplemented!(), } }