BIBFRAME to Schema.org Linked Data
Most commercial search engines like Google and Microsoft Bing, accept another linked-data vocabulary for indexing called schema.org for structuring descriptions that are typically embedded into a web page.
For this example we will use the BIBFRAME RDF that was generated from the MODS to BIBFRAME example and convert it to schema.org linked data that could be embedded in an HTML page.
Creating another SPARQLProcessor
instance, this time we will use
the bf-to-schema.ttl
RML rules file and original BIBFRAME Lean
graph we generated with the first rml_processor
.
>>> bf2schema_processor = processor.SPARQLProcessor(
rml_rules=['bf-to-schema.ttl'],
triplestore=rml_processor.output)
Using the same instance_iri and item_iri as before, we will now run the processor.
>>> bf2schema_processor.run(
instance='http://example.org/8383316#Instance')
Displaying the Schema.org as Turtle
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix schema: <http://schema.org/>
<http://example.org/8383316#Instance> a schema:CreativeWork ;
schema:contributor "Austen, Jane, 1775-1817.",
"C. Scribner's sons",
"Howells, William Dean, 1837-1920." ;
schema:datePublished "1918"^^<http://id.loc.gov/datatypes/edtf>,
"c1918" ;
schema:name "Pride and prejudice /" ;
schema:publisher "New York, Chicago [etc.] : C. Scribner's sons, [c1918]"
The final exercise in this section will be creating a new RML TriplesMap
and
including that rule when running an existing mapping workflow.