pub struct Field {
pub name: String,
pub iri: String,
pub label: Option<String>,
pub value_type: ValueType,
pub link_target: Option<String>,
pub cardinality: Cardinality,
pub is_builtin: bool,
pub data_model: Option<String>,
}Expand description
A field belonging to a resource-type, as surfaced by dsp vre resource-type describe.
Carries identity (name + iri), server-supplied label, the field’s
value_type (see ValueType), an optional link_target (the target
resource-type local name, Some iff value_type == ValueType::Link),
cardinality, a flag marking system (built-in) fields, and the source
data_model name (for cross-DM tagging). No serde derive: wire
deserialization stays in src/client/http.rs. See ADR-0001 / ADR-0008
and the CONTEXT.md “Field” / “Value Type” / “Cardinality” entries.
Fields§
§name: StringShort name of the field (e.g. hasTitle), derived from the property IRI.
iri: StringFull IRI of the field’s property
(e.g. http://api.dasch.swiss/ontology/0801/beol/v2#hasTitle).
label: Option<String>Server-supplied human label (rdfs:label), if any. None for system
built-in fields whose property node is not fetched, and for fields left
best-effort after a failed sibling-ontology fetch.
value_type: ValueTypeThe kind of value this field holds (text, integer, link, …).
link_target: Option<String>The local name of the link target resource-type (e.g. Book, person).
Some iff value_type == ValueType::Link; None for all other value
types. This invariant is asserted in unit tests — the type does not
enforce it structurally.
cardinality: CardinalityCardinality constraint: how many values the field may / must carry.
is_builtin: booltrue iff the field’s property CURIE prefix is a system namespace
(knora-api, knora-base, rdf, rdfs, owl, salsah-gui,
standoff, xsd). System fields are hidden by default; revealed with
--include-builtins (Decision 3).
data_model: Option<String>Source data-model name for the field’s property. Some with the
data-model short name for project-defined and cross-DM fields
(e.g. Some("biblio") for a biblio: property on a beol class);
None for system built-ins (system-namespace prefix). The renderer
emits a [from <dm>] tag when Some(x) and x differs from
ResourceTypeDetail.data_model (Decision 10).
Trait Implementations§
impl Eq for Field
impl StructuralPartialEq for Field
Auto Trait Implementations§
impl Freeze for Field
impl RefUnwindSafe for Field
impl Send for Field
impl Sync for Field
impl Unpin for Field
impl UnsafeUnpin for Field
impl UnwindSafe for Field
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.