pub struct SammParser { /* private fields */ }Expand description
SAMM Aspect Model parser
Implementations§
Source§impl SammParser
impl SammParser
Sourcepub fn new() -> PhysicsResult<Self>
pub fn new() -> PhysicsResult<Self>
Create a new SAMM parser
Sourcepub fn with_store(store: Arc<RdfStore>) -> Self
pub fn with_store(store: Arc<RdfStore>) -> Self
Create parser with existing store
Sourcepub async fn parse_samm_file(&self, path: &Path) -> PhysicsResult<AspectModel>
pub async fn parse_samm_file(&self, path: &Path) -> PhysicsResult<AspectModel>
Parse SAMM TTL file
Sourcepub async fn parse_samm_string(
&self,
content: &str,
) -> PhysicsResult<AspectModel>
pub async fn parse_samm_string( &self, content: &str, ) -> PhysicsResult<AspectModel>
Parse SAMM from string
Sourcepub async fn extract_entity_types(&self) -> PhysicsResult<Vec<EntityType>>
pub async fn extract_entity_types(&self) -> PhysicsResult<Vec<EntityType>>
Extract entity types from SAMM model
Sourcepub async fn extract_properties(&self) -> PhysicsResult<Vec<PropertyDefinition>>
pub async fn extract_properties(&self) -> PhysicsResult<Vec<PropertyDefinition>>
Extract property definitions
Sourcepub async fn extract_relationships(
&self,
) -> PhysicsResult<Vec<RelationshipDefinition>>
pub async fn extract_relationships( &self, ) -> PhysicsResult<Vec<RelationshipDefinition>>
Extract relationships
Sourcepub async fn extract_constraints(
&self,
) -> PhysicsResult<Vec<ConstraintDefinition>>
pub async fn extract_constraints( &self, ) -> PhysicsResult<Vec<ConstraintDefinition>>
Extract constraints
Sourcepub fn generate_sparql_query(&self, entity_type: &EntityType) -> String
pub fn generate_sparql_query(&self, entity_type: &EntityType) -> String
Generate SPARQL query from entity type
Sourcepub fn validate_data(
&self,
property_values: &HashMap<String, f64>,
constraints: &[ConstraintDefinition],
) -> PhysicsResult<()>
pub fn validate_data( &self, property_values: &HashMap<String, f64>, constraints: &[ConstraintDefinition], ) -> PhysicsResult<()>
Validate data against SAMM model
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SammParser
impl !RefUnwindSafe for SammParser
impl Send for SammParser
impl Sync for SammParser
impl Unpin for SammParser
impl UnsafeUnpin for SammParser
impl !UnwindSafe for SammParser
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
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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