Module srdf_parser

Source

Structs§

AndThen
ByRef
Implementation of RDFNodeParse::by_ref
CombineVec
FlatMap
GetFocus
Map
Neighs
Not
Optional
Or
ParseByType
ParseRDFList
ParseTerm
ParserNodes
PropertyValue
PropertyValueDebug
PropertyValues
RDFList
RDFParser
Implements a concrete RDF parser
Satisfy
SetFocus
SubjectsPropertyValue
Then
ThenMut
ThenRef
With

Enums§

RDFParseError

Traits§

FocusRDF
Represents RDF graphs that contain a focus node
RDFNodeParse
By implementing the RDFNodeParse trait a type says that it can be used to parse RDF data which have a focus node. RDF data with a focus node have to implement the FocusRDF trait.
RDFParse
The following code is an attempt to define parser combinators where the input is an RDF graph instead of a sequence of characters Some parts of this code are inspired by Combine

Functions§

and_then
apply
Applies a function and returns its result
apply_rdf
Applies a function over the RDF graph and returns the result of that function
bool
Parses a node as a bool
combine_vec
Combines the results of parsers that return vectors of values
cond
Applies a function and returns its result
equals
fail_msg
Fails with a given massage
flat_map
get_focus
Creates a parser that returns the focus node
has_type
instance_of
Returns the node that is an instance of the expected IRI in the RDF data It moves the focus to point to that node
instances_of
Returns all nodes that are instances of the expected IRI in the RDF data
iri
Checks if the focus node is an IRI
is_iri
Succeeds if current term is the expected IRI
literal
Checks if the focus node is an IRI
map
Applies a function f on the result of a parser
neighs
Creates a parser that returns the value associated with the current focus node for property
not
Not parser succeeds if the parser fails and viceversa Example:
ok
Succeeds with a given value
optional
or
Equivalent to [parser1.or(parser2)].
parse_by_type
Apply a parser to an RDF node associated with the value of it’s rdf:type property
parse_nodes
Applies a parser over a list of nodes and returns the list of values
parse_property_value_as_list
Parses the value of property as an RDF list
parse_rdf_list
Parses a node as an RDF List applying each element of the list a parser
parse_rdf_nil
parse_rdf_type
property_bool
Created a parser that returns the boolean associated with the current focus node for property
property_integer
Returns the integer value of property for the focus node
property_integers
Returns the integer values of property for the focus node
property_iri
Returns the IRI value of property for the focus node
property_list
Parses the RDF list linked from the value of property prop at focus node
property_string
Returns the string value of property for the focus node
property_value
Creates a parser that returns the value associated with the current focus node for property
property_value_debug
Creates a parser that returns the value associated with the current focus node for property
property_values
Returns the values of property for the focus node
property_values_int
Return the integer values of property for the focus node
property_values_iri
Return the IRI values of property for the focus node
property_values_non_empty
Returns the values of property for the focus node
rdf_list
Parses the current focus node as an RDF List
satisfy
Creates a parser that checks if the current node satisfies a predicate
set_focus
Creates a parser that sets the focus node and returns ()
set_focus_subject
subjects_with_property_value
Returns all nodes that are instances of the expected IRI in the RDF data
term
Creates a parser that returns the current focus node as a term
term_as_iri
then
Equivalent to p.then(f).
then_mut
Equivalent to p.then_mut(f).
then_ref
Equivalent to p.then_ref(f).
with
Equivalent to [parser1.with(parser2)]

Type Aliases§

PResult