RDF Mapping Language (RML)
RDF Mapping Language or RML is a specification for creating rules or mappings between different input data sources like XML, JSON, CSV, Relational Databases, and even other RDF triplestores through SPARQL to RDF triples.
RML itself is constructed using RDF so knowing how to write RDF (Turtle is usually easier to write and comprehend for RML maps) allows you to create mappings between the input data and your target RDF.
Each rule is a
TriplesMap class that contains
logicalSourcepredicate containing what type of input data source.
subjectMappredicate that allows you to assign a subject IRI or blank node and to make a RDF Class assignment
- One or more
predicateObjectMapthat allow to assign a predicate to the subject using a number of different methods for matching data from the input as a RDF object.
bibcat.rml.processor submodule has a base RML Processor
>>> import bibcat.rml.processor as processor INFO:rdflib:RDFLib Version: 4.2.2 >>> processor.Processor <class 'bibcat.rml.processor.Processor'>
This class is extended for specific kinds of data sub-classes like CSVRowProcessor for common-separated values data inputs such as spreadsheets
>>> processor.CSVRowProcessor <class 'bibcat.rml.processor.CSVRowProcessor'>
A JSONProcessor for JSON data sources,
>>> processor.JSONProcessor <class 'bibcat.rml.processor.JSONProcessor'>
A SPARQLProcessor for mapping RDF triples to RDF triples,
>>> processor.SPARQLProcessor <class 'bibcat.rml.processor.SPARQLProcessor'>
And a XMLProcessor.
>>> processor.XMLProcessor <class 'bibcat.rml.processor.XMLProcessor'>
In the first example will take the BIBFRAME RDF produced by the
create an instance of the
SPARQLProcessor class to demonstrate the use of
the RML Processor.