Liking cljdoc? Tell your friends :D

quoll.raphael.core

A namespace for manually parsing Turtle. Entry point is parse-doc.

A namespace for manually parsing Turtle. Entry point is parse-doc.
raw docstring

*loc*clj/s


add-rangeclj/s

(add-range chars low high)

Adds a range of characters into set. chars - the set of characters. low - the low end of the character range to add, inclusive. high - the high end of the character range to add, inclusive. return - the set with the new range of characters added.

Adds a range of characters into set.
chars - the set of characters.
low - the low end of the character range to add, inclusive.
high - the high end of the character range to add, inclusive.
return - the set with the new range of characters added.
raw docstring

anon-blank-nodeclj/s

(anon-blank-node r c g triples)

Generates a new blank node with no properties. Already passed the opening [ character, and whitespace. This function just steps to the next position. r - The reader to parse from. c - The last character read. This must be a ] g - The generator. triples - An accumulating transient of triples. return: [r node gen triples more?] c - the character immediately after the node node - the new anonymous blank node gen - the updated generator triples - the updated triples sequence enf? - If this is a subject, then is this is not enough and properties are required. Always false.

Generates a new blank node with no properties. Already passed the opening [ character, and whitespace.
This function just steps to the next position.
r - The reader to parse from.
c - The last character read. This must be a ]
g - The generator.
triples - An accumulating transient of triples.
return: [r node gen triples more?]
c - the character immediately after the node
node - the new anonymous blank node
gen - the updated generator
triples - the updated triples sequence
enf? - If this is a subject, then is this is not enough and properties are required. Always false.
raw docstring

dot?clj/s

(dot? c)

echarsclj/s

Maps ascii characters into their escape code

Maps ascii characters into their escape code
raw docstring

end-comment?clj/s


end-list?clj/s


escapeclj/s

(escape r c)

Reads an escaped code from the input starting at the current position. r - the reader to parse from. c - the character after the \ character. return: [c value] c - the character after the escape sequence value - the unescaped character.

Reads an escaped code from the input starting at the current position.
r - the reader to parse from.
c - the character after the \ character.
return: [c value]
c - the character after the escape sequence
value - the unescaped character.
raw docstring

hex?clj/s


int-codeclj/s

(int-code x)

local-chars2?clj/s


local-chars?clj/s


local-esc?clj/s


MAXLINEclj/s


maybe-parse-predicateclj/s

(maybe-parse-predicate r c gen triples)

Parses an IRI as a predicate if one is available. Otherwise return a nil as the IRI. r - The reader to parse from. c - the first character of the iri reference. gen - the current generator triples - the current triples return: [c iri gen triples] c - the last character read. iri - The iri string. gen - the generator. triples - the current triples.

Parses an IRI as a predicate if one is available. Otherwise return a nil as the IRI.
r - The reader to parse from.
c - the first character of the iri reference.
gen - the current generator
triples - the current triples
return: [c iri gen triples]
c - the last character read.
iri - The iri string.
gen - the generator.
triples - the current triples.
raw docstring

new-generatorclj/s

(new-generator)

newline?clj/s

(newline? c)

NodeGeneratorclj/sprotocol

rdf-typeclj/s

(rdf-type generator)

Returns the rdf:type qname

Returns the rdf:type qname

add-prefixclj/s

(add-prefix generator prefix iri)

Adds a prefix/iri pair to the namespace map

Adds a prefix/iri pair to the namespace map

new-iriclj/s

(new-iri generator iri)

Returns an IRI object.

Returns an IRI object.

rdf-firstclj/s

(rdf-first generator)

Returns the rdf:first qname

Returns the rdf:first qname

new-literalclj/s

(new-literal generator s)
(new-literal generator s t)

Returns a literal. Either simple, or with a type

Returns a literal. Either simple, or with a type

new-qnameclj/s

(new-qname generator prefix local)

Returns a Qualified Name object.

Returns a Qualified Name object.

get-namespacesclj/s

(get-namespaces generator)

Returns a map of all the namespaces recorded by this generator

Returns a map of all the namespaces recorded by this generator

rdf-restclj/s

(rdf-rest generator)

Returns the rdf:rest qname

Returns the rdf:rest qname

rdf-nilclj/s

(rdf-nil generator)

Returns the rdf:nil qname

Returns the rdf:nil qname

iri-forclj/s

(iri-for generator prefix)

Gets the stored iri for a given prefix

Gets the stored iri for a given prefix

new-lang-stringclj/s

(new-lang-string generator s l)

Returns a string literal, with a language tag

Returns a string literal, with a language tag

new-nodeclj/s

(new-node generator)
(new-node generator label)

Generate a new node, optionally with a label indicating a reusable node. Return the next generator and node

Generate a new node, optionally with a label indicating a reusable node. Return the next generator and node

get-baseclj/s

(get-base generator)

Returns the base of this generator, if one has been set

Returns the base of this generator, if one has been set

add-baseclj/s

(add-base generator iri)

Adds a base iri for the document

Adds a base iri for the document

non-iri-char?clj/s


parseclj/s

(parse in)
(parse in generator)

parse a string as a turtle document in - the string or Reader containing the document. g - an implementation of the Generator protocol for assigning blank nodes, IRIs and Literals, and managing namespaces. Optional. return: {:base <optional IRI> :namespaces <prefixes mapped to IRIs> :triples <vector of 3 element vectors>}

parse a string as a turtle document
in - the string or Reader containing the document.
g - an implementation of the Generator protocol for assigning blank nodes, IRIs and Literals,
    and managing namespaces. Optional.
return: {:base <optional IRI>
         :namespaces <prefixes mapped to IRIs>
         :triples <vector of 3 element vectors>}
raw docstring

parse-ambiguous-eltclj/s

(parse-ambiguous-elt r c gen triples common-text non-iri-op)

Reads an object to the point where ambiguity can be resolved. Processes text as either a prefixed name or the text being searched on. r - The reader to parse from. c - The last character read gen - The current generator. triples - The current triples. common-text - The text that can start either type of line. non-iri-op - The function to use to parse the line if it does not contain triples. This function accepts the string and offset into the string return: [c gen triples] c - The last character read gen - the next generator state. obj - the object generated from parsing this object.

Reads an object to the point where ambiguity can be resolved.
Processes text as either a prefixed name or the text being searched on.
r - The reader to parse from.
c - The last character read
gen - The current generator.
triples - The current triples.
common-text - The text that can start either type of line.
non-iri-op - The function to use to parse the line if it does not contain triples.
                 This function accepts the string and offset into the string
return: [c gen triples]
c - The last character read
gen - the next generator state.
obj - the object generated from parsing this object.
raw docstring

parse-ambiguous-lineclj/s

(parse-ambiguous-line r c gen triples common-text non-triples-op)

Reads a line up to the point where ambiguity can be resolved. Processes the line as either the beginning of triples, or a provided operation. r - The reader to parse from. c - The last character read. (Optional: can be inferred) gen - The current generator. triples - The current triples. common-text - The text that can start either type of line. non-triples-op - The function to use to parse the line if it does not contain triples. This function accepts the incoming char. return: [c gen triples] c - The last character read. gen - the next generator state. triples - the triples generated from parsing this line.

Reads a line up to the point where ambiguity can be resolved.
Processes the line as either the beginning of triples, or a provided operation.
r - The reader to parse from.
c - The last character read. (Optional: can be inferred)
gen - The current generator.
triples - The current triples.
common-text - The text that can start either type of line.
non-triples-op - The function to use to parse the line if it does not contain triples.
                 This function accepts the incoming char.
return: [c gen triples]
c - The last character read.
gen - the next generator state.
triples - the triples generated from parsing this line.
raw docstring

parse-base-endclj/s

(parse-base-end r gen end-char)
(parse-base-end r c gen end-char)

Parse an iri and the end-char for the end of the line. NOTE: THE FIRST ARITY OF THIS FUNCTION DOES NOT USE AN INCOMING CHARACTER r - The reader to parse from. c - [optional] The incoming character. gen - The generator to update. end-char - A test for the final character return: [c gen] c - character at position n gen - the new generator.

Parse an iri and the end-char for the end of the line.
NOTE: THE FIRST ARITY OF THIS FUNCTION DOES NOT USE AN INCOMING CHARACTER
r - The reader to parse from.
c - [optional] The incoming character.
gen - The generator to update.
end-char - A test for the final character
return: [c gen]
c - character at position n
gen - the new generator.
raw docstring

parse-blank-nodeclj/s

(parse-blank-node r c gen triples)

Parses a blank node label. r - The reader to parse from. n - The offset to parse from. c - the first character of the blank node gen - the current generator triples - the current triples return: [c node gen triples] n - The offset immediately after the prefix. c - the character at offset n. node - The blank node. gen - the generator. triples - the current triples.

Parses a blank node label.
r - The reader to parse from.
n - The offset to parse from.
c - the first character of the blank node
gen - the current generator
triples - the current triples
return: [c node gen triples]
n - The offset immediately after the prefix.
c - the character at offset n.
node - The blank node.
gen - the generator.
triples - the current triples.
raw docstring

parse-blank-node-entityclj/s

(parse-blank-node-entity r c gen triples)

Parse a blank node property/value list. Already past the opening [ character and whitespace. s - The reader to parse from c - The last character read gen - The generator for blank nodes and namespace resolution triples - An accumulating transient of triples. return [c node gen triples] c - The last character read node - the root blank node that is being parsed gen - the updated generator triples - the updated triples sequence enf? - is this enough if this is a subject? A predicateObject sequence is not needed. true.

Parse a blank node property/value list. Already past the opening [ character and whitespace.
s - The reader to parse from
c - The last character read
gen - The generator for blank nodes and namespace resolution
triples - An accumulating transient of triples.
return [c node gen triples]
c - The last character read
node - the root blank node that is being parsed
gen - the updated generator
triples - the updated triples sequence
enf? - is this enough if this is a subject? A predicateObject sequence is not needed. true.
raw docstring

parse-collectionclj/s

(parse-collection r c gen triples)

Parses a collection. This creates a linked list in the triples. r - The parser to parse from. c - the first character of the collection gen - the current generator triples - the current triples return: [c node gen triples] c - the character immediately after the collection. node - The node representing the collection. gen - the generator. triples - the current triples.

Parses a collection. This creates a linked list in the triples.
r - The parser to parse from.
c - the first character of the collection
gen - the current generator
triples - the current triples
return: [c node gen triples]
c - the character immediately after the collection.
node - The node representing the collection.
gen - the generator.
triples - the current triples.
raw docstring

parse-iriclj/s

(parse-iri r c gen triples)

Parse an iri. r - the reader to parse from. c - the char found at position n. gen - the generator to use. triples - the current triples. return: [c iri] c - the character after the iri. iri - the node for the parsed iri. Either an IRI string or an IRI. gen - the updated generator. triples - the triples generated in parsing the node.

Parse an iri.
r - the reader to parse from.
c - the char found at position n.
gen - the generator to use.
triples - the current triples.
return: [c iri]
c - the character after the iri.
iri - the node for the parsed iri. Either an IRI string or an IRI.
gen - the updated generator.
triples - the triples generated in parsing the node.
raw docstring

parse-iri-refclj/s

(parse-iri-ref r c gen triples)

Parse an iri references. This is an iri string surrounded by <> characters. The <> characters are not returned. r - The reader to parse from. c - the first character of the iri reference. gen - the current generator triples - the current triples return: [c iri gen triples] c - the character at offset n. iri - The iri string. gen - the generator. triples - the current triples.

Parse an iri references. This is an iri string surrounded by <> characters. The <> characters are not returned.
r - The reader to parse from.
c - the first character of the iri reference.
gen - the current generator
triples - the current triples
return: [c iri gen triples]
c - the character at offset n.
iri - The iri string.
gen - the generator.
triples - the current triples.
raw docstring

parse-lang-tagclj/s

(parse-lang-tag r c gen triples lit-str)

Parse the language tag from a literal. The @ character has already been parsed. r - the reader to parse from. c - the last char read. gen - the node generator. triples - the current triples. lit-str - the literal string that this tag affects. return: [c literal gen triples] c - the character after the lang tag. literal - the parsed value, as a language literal. gen - the updated generator. triples - the triples generated in parsing the node.

Parse the language tag from a literal. The @ character has already been parsed.
r - the reader to parse from.
c - the last char read.
gen - the node generator.
triples - the current triples.
lit-str - the literal string that this tag affects.
return: [c literal gen triples]
c - the character after the lang tag.
literal - the parsed value, as a language literal.
gen - the updated generator.
triples - the triples generated in parsing the node.
raw docstring

parse-literalclj/s

(parse-literal r quote-c gen triples)

Parse a literal that starts with a quote character. This also includes the triple quote form that allows for raw unescaped strings. r - the reader to parse from. c - the last char read. This is a quote: either ' or " gen - the node generator. triples - the current triples. return: [c value gen triples] c - the first character after the literal. value - the parsed value, in string form if it is plain. gen - the updated generator. triples - the triples generated in parsing the node.

Parse a literal that starts with a quote character. This also includes the
triple quote form that allows for raw unescaped strings.
r - the reader to parse from.
c - the last char read. This is a quote: either ' or "
gen - the node generator.
triples - the current triples.
return: [c value gen triples]
c - the first character after the literal.
value - the parsed value, in string form if it is plain.
gen - the updated generator.
triples - the triples generated in parsing the node.
raw docstring

parse-localclj/s

(parse-local r)

Parse a local into a string. r - The reader to parse from. return: [c local] c - the character after the local string. local - the parsed local name.

Parse a local into a string.
r - The reader to parse from.
return: [c local]
c - the character after the local string.
local - the parsed local name.
raw docstring

parse-long-stringclj/s

(parse-long-string r c end-q)

Parse a triple-quoted string form. Because this is already identified as a triple quote the offset of n and the character represent the first character after the quotes. r - the reader to parse from, after the quotes. c - the first char in the string. end-q - the ending quote character to terminate on, either ' or ". return: [c value] c - the character following the closing quotes. value - the parsed string.

Parse a triple-quoted string form. Because this is already identified as a triple quote
the offset of n and the character represent the first character after the quotes.
r - the reader to parse from, after the quotes.
c - the first char in the string.
end-q - the ending quote character to terminate on, either ' or ".
return: [c value]
c - the character following the closing quotes.
value - the parsed string.
raw docstring

parse-numberclj/s

(parse-number r c gen triples)

Parse a numeric literal. r - the reader to parse from. c - the char found at position n. gen - the node generator. triples - the current triples. return: [c value] c - the character immediately after the number. value - the parsed number. gen - the updated generator triples - the triples generated in parsing the node.

Parse a numeric literal.
r - the reader to parse from.
c - the char found at position n.
gen - the node generator.
triples - the current triples.
return: [c value]
c - the character immediately after the number.
value - the parsed number.
gen - the updated generator
triples - the triples generated in parsing the node.
raw docstring

parse-objectclj/s

(parse-object r c gen triples)

Parse an object entity, including any triples. r - the reader to parse from. c - the char found at position n. gen - the node generator. triples - the current triples. return: [c object gen triples] c - The last character read object - the node for the parsed object. gen - the updated generator. triples - the triples generated in parsing the node. Blank node entities can also return a true at the end of the vector, but this should be ignored.

Parse an object entity, including any triples.
r - the reader to parse from.
c - the char found at position n.
gen - the node generator.
triples - the current triples.
return: [c object gen triples]
c - The last character read
object - the node for the parsed object.
gen - the updated generator.
triples - the triples generated in parsing the node.
Blank node entities can also return a true at the end of the vector, but this should be ignored.
raw docstring

parse-predicateclj/s


parse-predicate-object-listclj/s

(parse-predicate-object-list r c subject gen triples)

Parse a predicate-object list r - The reader to parse from c - The character at position n gen - The generator for blank nodes and namespace resolution triples - An accumulating transient of triples. return [c gen triples] c - last character read gen - the updated generator triples - the updated triples sequence.

Parse a predicate-object list
r - The reader to parse from
c - The character at position n
gen - The generator for blank nodes and namespace resolution
triples - An accumulating transient of triples.
return [c gen triples]
c - last character read
gen - the updated generator
triples - the updated triples sequence.
raw docstring

parse-prefixclj/s

(parse-prefix r c)

Parse a prefix. This is a simple string terminated with a ':'. The : character is not part of the prefix. s - The reader to parse from. c - The last character read. return: [c prefix] c - The character immediately after the prefix. prefix - The prefix string.

Parse a prefix. This is a simple string terminated with a ':'. The : character is not part of the prefix.
s - The reader to parse from.
c - The last character read.
return: [c prefix]
c - The character immediately after the prefix.
prefix - The prefix string.
raw docstring

parse-prefix-iri-endclj/s

(parse-prefix-iri-end r gen end-char)
(parse-prefix-iri-end r c gen end-char)

Parse an iri and a newline for a PREFIX or BASE directive. NOTE: THE FIRST ARITY OF THIS FUNCTION DOES NOT USE AN INCOMING CHARACTER r - The reader to parse from. c - [optional] The incoming character. gen - The generator to update. end-char - A test for the final character return: [c gen] c - character at position n gen - the new generator.

Parse an iri and a newline for a PREFIX or BASE directive.
NOTE: THE FIRST ARITY OF THIS FUNCTION DOES NOT USE AN INCOMING CHARACTER
r - The reader to parse from.
c - [optional] The incoming character.
gen - The generator to update.
end-char - A test for the final character
return: [c gen]
c - character at position n
gen - the new generator.
raw docstring

parse-prefixed-nameclj/s

(parse-prefixed-name r c gen triples)
(parse-prefixed-name r pre c gen triples)

Parse a prefix:local-name pair. r - The reader to parse from. pre - Optional. The initial part of the string that has already been parsed as a string builder. c - the first character of the prefixed name. gen - the generator triples - the current triples. return: [c prefix] c - The character immediately after the prefixed name. qname - The prefixed name as a IRI gen - the updated generator. triples - the triples generated in parsing the node.

Parse a prefix:local-name pair.
r - The reader to parse from.
pre - Optional. The initial part of the string that has already been parsed as a string builder.
c - the first character of the prefixed name.
gen - the generator
triples - the current triples.
return: [c prefix]
c - The character immediately after the prefixed name.
qname - The prefixed name as a IRI
gen - the updated generator.
triples - the triples generated in parsing the node.
raw docstring

parse-statementclj/s

(parse-statement r gen triples)
(parse-statement r c gen triples)

Parse a directive or triples. r - The reader to parse from. c - The last character read. (Optional: can be inferred) gen - The current generator. triples - The current triples. return: [c gen triples] c - The last character read. gen - the next generator state. triples - the triples generated from parsing this line.

Parse a directive or triples.
r - The reader to parse from.
c - The last character read. (Optional: can be inferred)
gen - The current generator.
triples - The current triples.
return: [c gen triples]
c - The last character read.
gen - the next generator state.
triples - the triples generated from parsing this line.
raw docstring

parse-stringclj/s

(parse-string r c end-q)

Parse a single-quoted string form. end-q - the ending quote character to terminate on. r - the reader to parse from. c - the last read char. This is after the opening quote character. return: [c value] c - the character immediately after the string. value - the parsed string.

Parse a single-quoted string form.
end-q - the ending quote character to terminate on.
r - the reader to parse from.
c - the last read char. This is after the opening quote character.
return: [c value]
c - the character immediately after the string.
value - the parsed string. 
raw docstring

parse-subjectclj/s

(parse-subject r c gen triples)

Parse a subject entity, including any triples. r - the reader to parse from. c - the char found at position n. gen - the node generator. triples - the current triples. return: [c subject gen triples] c - The last character read subject - the node for the parsed subject. gen - the updated generator triples - the triples generated in parsing the node. enf? - indicates if this subject is enough and a predicateObject list is not needed. Most types return nil for this (falsey).

Parse a subject entity, including any triples.
r - the reader to parse from.
c - the char found at position n.
gen - the node generator.
triples - the current triples.
return: [c subject gen triples]
c - The last character read
subject - the node for the parsed subject.
gen - the updated generator
triples - the triples generated in parsing the node.
enf? - indicates if this subject is enough and a predicateObject list is not needed.
       Most types return nil for this (falsey).
raw docstring

parse-triplesclj/s

(parse-triples r c gen triples)

Parse a top level triples from a string. r - the reader to parse from. c - the character found at position n. gen - the generator to use for blank nodes. triples - A transient vector of triples. return: [c gen triples] c - The last character read gen - the next generator state. triples - the triples generated from parsing this line.

Parse a top level triples from a string.
r - the reader to parse from.
c - the character found at position n.
gen - the generator to use for blank nodes.
triples - A transient vector of triples.
return: [c gen triples]
c - The last character read
gen - the next generator state.
triples - the triples generated from parsing this line.
raw docstring

parse-u-charclj/s

(parse-u-char r f)

Parse a an unescapped code of uxxxx or Uxxxxxxxx. A preceding \ character was just parsed. r - the reader to parse from. f - the character found at position n. Must be u or U. return: [c char] c - the char immediately after the u-char sequence char - the character code that was parsed, which may be a char, or a string with that char

Parse a an unescapped code of uxxxx or Uxxxxxxxx. A preceding \ character was just parsed.
r - the reader to parse from.
f - the character found at position n. Must be u or U.
return: [c char]
c - the char immediately after the u-char sequence
char - the character code that was parsed, which may be a char, or a string with that char
raw docstring

pn-chars-base?clj/s


pn-chars-dot?clj/s


pn-chars-u?clj/s


pn-chars-ud?clj/s


pn-chars?clj/s


pre-parse-triplesclj/s

(pre-parse-triples r c gen triples pre)

Parse a top level triples from a string, with some of the first triple already parsed as a prefixed stirng. r - the reader to parse from. c - the character found at position n. gen - the generator to use for blank nodes. triples - A transient vector of triples. pre - the previously read prefix of the line in a string builder return: [c gen triples] c - The last character read gen - the next generator state. triples - the triples generated from parsing this line.

Parse a top level triples from a string,
with some of the first triple already parsed as a prefixed stirng.
r - the reader to parse from.
c - the character found at position n.
gen - the generator to use for blank nodes.
triples - A transient vector of triples.
pre - the previously read prefix of the line in a string builder
return: [c gen triples]
c - The last character read
gen - the next generator state.
triples - the triples generated from parsing this line.
raw docstring

relative-iri?clj/s

(relative-iri? s)

Indicates if an IRI is relative.

Indicates if an IRI is relative.
raw docstring

reset-pos!clj/s

(reset-pos!)

scheme-reclj/s


skip-past-dotclj/s

(skip-past-dot r c)

Skip to the terminating dot. If non-whitespace is found, then report an error. r - The reader to parse from. return: c

Skip to the terminating dot. If non-whitespace is found, then report an error.
r - The reader to parse from.
return: c
raw docstring

skip-toclj/s

(skip-to r c end-chars?)

Skip over the whitespace to the required character. If there are nonwhitespace characters, this is an error. r - The reader to parse from. c - The last character read. end-chars? - the set of chars to skip to. return: c c - the first character after the requested ending characters

Skip over the whitespace to the required character. If there are nonwhitespace characters, this is an error.
r - The reader to parse from.
c - The last character read.
end-chars? - the set of chars to skip to.
return: c
c - the first character after the requested ending characters
raw docstring

skip-whitespaceclj/s

(skip-whitespace r c)

Skip over the whitespace starting from a position in a string. r - The reader c - The character at the current position. return: c c - the first non-whitespace character

Skip over the whitespace starting from a position in a string.
r - The reader
c - The character at the current position.
return: c
c - the first non-whitespace character
raw docstring

update-pos!clj/s

(update-pos! r)

whitespace?clj/s

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close