Skip to main content

Signals

Struct Signals 

Source
pub struct Signals {
Show 16 fields pub label_predicate: Option<String>, pub default_lang: Option<String>, pub base_iri: Option<String>, pub time_predicates: Vec<String>, pub numeric_predicates: Vec<String>, pub link_predicates: Vec<String>, pub annotation_predicates: Vec<String>, pub quoting_predicates: Vec<String>, pub annotated_statement: Option<(String, String)>, pub geo_wkt: bool, pub geo_latlong: bool, pub temporal_extent: Option<(String, String)>, pub spatial_bbox: Option<[f64; 4]>, pub text_index: Option<TextIndexSignal>, pub permutations: Option<PermutationsSignal>, pub quoted_triples: Option<QuotedTriplesSignal>,
}
Expand description

Detected affordances — the index-free hints a newcomer (or the query-library generator) needs to know what the data supports and how to address it. Every field is optional/empty when the corresponding signal is absent, so geo/time query families are emitted only when the data actually has geometry/time.

Fields§

§label_predicate: Option<String>

Most frequent labelling predicate (rdfs:label/skos:prefLabel/…).

§default_lang: Option<String>

Dominant non-empty language tag over literal objects.

§base_iri: Option<String>

Dominant subject namespace — the dataset’s own base IRI.

§time_predicates: Vec<String>

Temporal predicates, ranked by frequency (most-used first).

§numeric_predicates: Vec<String>

Predicates whose objects are numeric (xsd integer/decimal/double/float), ranked by frequency — candidates for MIN/AVG/MAX value-range queries.

§link_predicates: Vec<String>

Cross-dataset link predicates present (owl:sameAs/skos:exactMatch/…).

§annotation_predicates: Vec<String>

Predicates that make a statement about a statement — the predicate of a statement whose subject is a quoted triple (<< s p o >> :recordedBy :who) — ranked by frequency.

Derived from the triples, and therefore stored, unlike the Signals::quoted_triples presence bit below, which is read off the header at display time. The two answer different questions and neither substitutes for the other: presence says will I meet triple terms in this file, which every already-published file can answer for free; this says which vocabulary annotates statements here, which only a pass over the statements knows and which is what a starter query has to be written in. Empty on the overwhelming majority of datasets, and the whole qt-* query family is gated on it.

§quoting_predicates: Vec<String>

Predicates whose object is a quoted triple (:claim :states << s p o >>) — the other place a triple term can stand — ranked by frequency. A dataset can have one shape and not the other, and a query written for the wrong one returns nothing, so they are counted apart.

§annotated_statement: Option<(String, String)>

The commonest annotated statement shape: (the predicate inside the quoted triple, the predicate that annotates it), for a statement this graph was seen both to assert (s p o) and to annotate (<< s p o >> :about ?v).

The pair is the witness — the same role class_links plays for LABELED_CLASS. annotation_predicates[0] and the commonest quoted predicate are two independent maxima and need not describe the same statement, so a body that pins both is only safe when the derivation saw them together. Assertedness is part of the witness because RDF-star does not entail it: << s p o >> :about ?v says nothing about whether s p o is in the graph, and a coverage query over a relation the graph never asserts would report 0 / 0.

Matched over a sample of the star layer (ANNOTATION_WITNESS_SAMPLE), so a miss can drop the query that needs it but can never ship a broken one.

§geo_wkt: bool

Any geo:asWKT / geo:wktLiteral geometry present.

§geo_latlong: bool

Both wgs84:lat and wgs84:long present.

§temporal_extent: Option<(String, String)>

MIN/MAX lexical extent over the dominant time predicate (same datatype).

§spatial_bbox: Option<[f64; 4]>

[minLon, minLat, maxLon, maxLat] over wgs84 lat/long objects.

§text_index: Option<TextIndexSignal>

Whether the file carries a full-text (TEXT_INDEX) section.

Unlike every other signal this one is not derived from the triples and not stored in the card: it is measured from the file’s section directory by whoever reads the card, and DatasetCard::to_json_bytes strips it before the bytes are written. See TextIndexSignal for why.

None therefore means unknown — a card read out of a saved JSON document, with no file to measure — and never “no index”.

§permutations: Option<PermutationsSignal>

Which index permutations the file stores. Like Signals::text_index, measured from the file at read time and stripped before the card’s bytes are written; None means unknown (a card document with no file behind it), never “the default”.

§quoted_triples: Option<QuotedTriplesSignal>

Whether the file holds any quoted triple, and which export surfaces a consumer can ask for. Like the two signals above, measured from the file at read time and stripped before the card’s bytes are written; None means unknown (a card document with no file behind it), never “no quoted triples”. See QuotedTriplesSignal.

Implementations§

Source§

impl Signals

Source

pub fn is_empty(&self) -> bool

True when no affordance was detected (lets the whole block be omitted).

Trait Implementations§

Source§

impl Clone for Signals

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Signals

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Signals

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Signals

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Signals

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Signals

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Signals

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V