trait RDFParser extends AnyRef
Obtains data from an RDFReader
The approach is similar to parser combinators but instead of sequence of characters, we have RDF graphs available through an RDFReader
- Source
- RDFParser.scala
- Alphabetic
- By Inheritance
- RDFParser
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
anyOf[A](ps: RDFParser[A]*): RDFParser[Seq[A]]
Applies a list of parsers If a parser fails, it continues with the rest of the list
Applies a list of parsers If a parser fails, it continues with the rest of the list
- returns
the list of successful values that can be parsed
-
def
anyOfLs[A](ps: RDFParser[List[A]]*): RDFParser[Seq[A]]
Applies a list of parsers
- def arc[A](pred: IRI, parser: RDFParser[A]): RDFParser[A]
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
- def asLiteral: RDFParser[Literal]
- def asLiterals(ls: List[RDFNode]): RDFParser[List[Literal]]
- def boolean: RDFParser[Boolean]
- def booleanFromPredicate(p: IRI): RDFParser[Boolean]
- def booleanFromPredicateOptional(p: IRI): RDFParser[Option[Boolean]]
- def checkType(expected: RDFNode): RDFParser[Boolean]
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @HotSpotIntrinsicCandidate()
- def collect[A](ps: List[RDFParser[A]]): RDFParser[List[A]]
- def combine[A](p1: RDFParser[Seq[A]], p2: RDFParser[Seq[A]]): RDFParser[Seq[A]]
-
def
combineAll[A](ps: RDFParser[Seq[A]]*): RDFParser[Seq[A]]
Combine a sequence of RDFParsers
- def condition(cond: (RDFNode) ⇒ Boolean, name: String): RDFParser[RDFNode]
-
def
decimalLiteralFromPredicate(p: IRI): RDFParser[DecimalLiteral]
Returns the Decimal literal associated with a predicate
p
Returns the Decimal literal associated with a predicate
p
- p
predicate
- returns
An RDFParser that returns the decimal literal associated with that predicate
- def decimalLiteralFromPredicateOptional(p: IRI): RDFParser[Option[DecimalLiteral]]
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def failIf(cond: Boolean, msg: String): RDFParser[Unit]
-
def
firstOf[A](ps: RDFParser[A]*): RDFParser[A]
If a parser fails, it continues with the rest of the list
If a parser fails, it continues with the rest of the list
- returns
the result of the first parser that succeeds of failure
- def fromEither[A](e: Either[Err, A]): RDFParser[A]
- def fromEitherT[A](e: EitherT[IO, Err, A]): RDFParser[A]
- def fromIO[A](x: IO[A]): RDFParser[A]
- def fromRDFStream[A](r: Stream[IO, A]): RDFParser[Vector[A]]
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def getIntegerLiteral(t: RDFTriple): RDFParser[Int]
- def getNode: RDFParser[RDFNode]
- def getRDF: RDFParser[RDFReader]
-
def
group[A](parser: RDFParser[A], nodes: Seq[RDFNode]): RDFParser[Seq[A]]
Applies a parser over a sequence of nodes
Applies a parser over a sequence of nodes
- parser
parser
- nodes
sequence of nodes
-
def
hasNoRDFType(t: IRI): RDFParser[Boolean]
Returns
true
if the current node does not have a given typeReturns
true
if the current node does not have a given type- t
type to be checked
-
def
hasRDFType(t: IRI): RDFParser[Boolean]
Returns
true
if the current node has a given typeReturns
true
if the current node has a given type- t
type to be checked
-
def
hasSomeRDFType(ts: Set[IRI]): RDFParser[Boolean]
Returns
true
if the current node has a type which belong to a given set of typesReturns
true
if the current node has a type which belong to a given set of types- ts
set of types to be checked
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def info(msg: String): RDFParser[Unit]
- def integer: RDFParser[Int]
-
def
integerLiteralForPredicate(p: IRI): RDFParser[Int]
Obtains an integer literal associated with a predicate in the current node
Obtains an integer literal associated with a predicate in the current node
- p
predicate
- def integerLiteralsForPredicate(p: IRI): RDFParser[List[Int]]
- def io2r[A](x: IO[A]): R[A]
- def iri: RDFParser[IRI]
- def iriFromPredicate(p: IRI): RDFParser[IRI]
- def iriFromPredicateOptional(p: IRI): RDFParser[Option[IRI]]
- def irisFromPredicate(p: IRI): RDFParser[List[IRI]]
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def lift[A](r: R[A]): RDFParser[A]
- def liftIO[A](io: IO[A]): RDFParser[A]
-
def
list1Plus[A](p: RDFParser[A]): RDFParser[List[A]]
Parses a list of values.
Parses a list of values. The list must contain at least one value
- def list1PlusAux[A](p: RDFParser[A], visited: List[RDFNode]): RDFParser[List[A]]
-
def
list2Plus[A](p: RDFParser[A]): RDFParser[List[A]]
Parses a list of values.
Parses a list of values. The list must contain at least two values
- def literalFromPredicate(p: IRI): RDFParser[Literal]
- def literalsFromPredicate(p: IRI): RDFParser[List[Literal]]
- def mapRDFParser[A, B](ls: List[A], p: (A) ⇒ RDFParser[B]): RDFParser[List[B]]
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def nodes2iris(ns: List[RDFNode]): Either[String, List[IRI]]
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
objectFromPredicate(p: IRI): RDFParser[RDFNode]
RDFParser that retrieves the object associated with current node for a given predicate
RDFParser that retrieves the object associated with current node for a given predicate
Fails if there are more than one object
- p
predicate
- def objectFromPredicateOptional(p: IRI): RDFParser[Option[RDFNode]]
-
def
objectsFromPredicate(p: IRI): RDFParser[Set[RDFNode]]
RDFParser that retrieves the set of iriObjects associated with the current node for a given predicate
RDFParser that retrieves the set of iriObjects associated with the current node for a given predicate
- p
predicate
- def objectsFromTriples(triples: Set[RDFTriple]): Set[RDFNode]
- def ok[A](x: A): RDFParser[A]
-
def
oneOf[A](parsers: Seq[RDFParser[A]]): RDFParser[A]
Checks that exactly one of the parsers succeeds on the current node
Checks that exactly one of the parsers succeeds on the current node
- parsers
sequence of parsers
- def opt[A](pred: IRI, parser: RDFParser[A]): RDFParser[Option[A]]
-
def
optional[A](parser: RDFParser[A]): RDFParser[Option[A]]
An RDF parser that parses a value of type
a
if possible - def parse[A](parser: RDFParser[A], node: RDFNode, rdf: RDFReader): IO[Either[Err, A]]
- def parseException[A](e: Throwable): RDFParser[A]
- def parseFail[A](str: String): RDFParser[A]
- def parseNodes[A](nodes: List[RDFNode], parser: RDFParser[A]): RDFParser[List[A]]
- def parseOk[A](x: A): RDFParser[A]
- def parsePredicate[A](p: IRI, maker: (RDFNode) ⇒ A): RDFParser[A]
- def parsePredicateIRI[A](p: IRI, maker: (IRI) ⇒ A): RDFParser[A]
- def parsePredicateIRIList[A](p: IRI, maker: (IRI) ⇒ A): RDFParser[List[A]]
- def parsePredicateInt[A](p: IRI, maker: (Int) ⇒ A): RDFParser[A]
- def parsePredicateIntList[A](p: IRI, maker: (Int) ⇒ A): RDFParser[List[A]]
- def parsePredicateList[A](p: IRI, maker: (RDFNode) ⇒ A): RDFParser[List[A]]
- def parsePredicateLiteral[A](p: IRI, maker: (Literal) ⇒ A): RDFParser[A]
- def parsePredicateLiteralList[A](p: IRI, maker: (Literal) ⇒ A): RDFParser[List[A]]
- def parsePredicateString[A](p: IRI, maker: (String) ⇒ A): RDFParser[A]
- def parseRest[A](visited: List[RDFNode], restNode: RDFNode, parser: RDFParser[A]): RDFParser[List[A]]
-
def
rdfList: RDFParser[List[RDFNode]]
A parser of the RDF List associated with the current node
A parser of the RDF List associated with the current node
Fails if there are more than one iriObjects associated with
rdf_first
orrdf_rest
- def rdfListAux(visited: Vector[RDFNode]): RDFParser[List[RDFNode]]
-
def
rdfListForPredicate(p: IRI): RDFParser[List[RDFNode]]
Obtains the RDF list associated with a predicate for the current node
Obtains the RDF list associated with a predicate for the current node
- p
predicate
-
def
rdfListForPredicateAllowingNone(p: IRI): RDFParser[List[RDFNode]]
Obtains the RDF list associated with a predicate for the current node If there is no value, returns the empty list
Obtains the RDF list associated with a predicate for the current node If there is no value, returns the empty list
- p
predicate
- def rdfListForPredicateOptional(p: IRI): RDFParser[List[RDFNode]]
- def rdfNil[A]: RDFParser[List[A]]
-
def
rdfType: RDFParser[RDFNode]
Returns a parser that obtains the type associated with the current node
Returns a parser that obtains the type associated with the current node
Fails if there are more than one type associated
-
def
rdfTypes: RDFParser[Set[RDFNode]]
Returns a parser that obtains the set of types associated with the current node
- def sequenceEither[E, A](xs: List[Either[E, A]]): Either[E, List[A]]
-
def
someOf[A](ps: RDFParser[A]*): RDFParser[A]
Checks if some of the parsers pass and returns the corresponding value
Checks if some of the parsers pass and returns the corresponding value
- ps
sequence of parsers
- def star[A](pred: IRI, parser: RDFParser[A]): RDFParser[List[A]]
- def starWithNodes[A](pred: IRI, parser: RDFParser[A]): RDFParser[List[(RDFNode, A)]]
- def stream2list[A](st: Stream[IO, A]): IO[Vector[A]]
- def string: RDFParser[String]
-
def
stringFromPredicate(p: IRI): RDFParser[String]
Returns the String associated with a predicate
p
Returns the String associated with a predicate
p
- p
predicate
- returns
An RDFParser that returns the String associated with that predicate
- def stringFromPredicateOptional(p: IRI): RDFParser[Option[String]]
- def subjectsFromTriples(triples: Set[RDFTriple]): Set[RDFNode]
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
- def withNode[A](n: RDFNode, parser: RDFParser[A]): RDFParser[A]
- def withRdf[A](rdf: RDFReader, parser: RDFParser[A]): RDFParser[A]