File scripts/pica2rdf.lua
Tables
Turtle | Simple turtle serializer. |
Functions
authority (rec, ttl) | Transforms PICA+ authority record |
authority_person (rec, ttl) | Transforms a PICA+ authority record about a person |
bibrecord (record, ttl) | Transforms a bibliographic PICA+ record |
fjoin (field, sep, ...) | Collect and join subfield values (you must not use "+" and "*" flags). |
main (record, source) | Main conversion |
trim (s) | Trim a string |
Tables
- Turtle
- Simple turtle serializer. This class provides a handy serializer form a limited subset of RDF/Turtle format. Each instances stores multiple RDF statements with the same subject.
Methods
- Turtle.new Creates a new Turtle serializer.
- Turtle:__tostring Returns a RDF/Turtle document
- Turtle:add Adds a statement with literal as object.
- Turtle:addlink Adds a statement with URI as object.
- Turtle:subject Set the triple's subject.
- Turtle:warn Add a warning message.
Functions
- Turtle.new (subject)
-
Creates a new Turtle serializer.
Parameters
- subject: the subject for all triples
- Turtle:__tostring ()
- Returns a RDF/Turtle document
- Turtle:add (predicate, object, lang_or_type)
-
Adds a statement with literal as object. empty strings as object values are ignored! unknown predicate vocabularies are ignored!
Parameters
- predicate:
- object:
- lang_or_type:
- Turtle:addlink (predicate, uri)
-
Adds a statement with URI as object.
Parameters
- predicate:
- uri:
- Turtle:subject (subject)
-
Set the triple's subject.
Parameters
- subject:
- Turtle:warn (message)
-
Add a warning message.
Parameters
- message: string to add as warning. Trailing whitespaces are removed.
- authority (rec, ttl)
-
Transforms PICA+ authority record
Parameters
- rec:
- ttl:
- authority_person (rec, ttl)
-
Transforms a PICA+ authority record about a person
Parameters
- rec:
- ttl:
- bibrecord (record, ttl)
-
Transforms a bibliographic PICA+ record
Parameters
- record:
- ttl:
- fjoin (field, sep, ...)
-
Collect and join subfield values (you must not use "+" and "*" flags).
Parameters
- field:
- sep:
- ...:
- main (record, source)
-
Main conversion
Parameters
- record: a single record in PICA+ format (UTF-8)
- source:
Return value:
string RDF/Turtle serialization - trim (s)
-
Trim a string
Parameters
- s: