reimagining serials handout: tips for editing bibframe files
TRANSCRIPT
Tips for editing BIBFRAME files 2/25/15
Graphs generated from BIBFRAME files can be extremely large and a bit overwhelming. If you want to focus on a particular aspect of the file you can edit the BIBFRAME RDF/XML document and remove the parts you are not interested in. When doing so, it is important to keep a few things in mind:
1. Always retain the XML declaration statement • The first line of every RDF/XML file (including BIBFRAME files) is a declaration basically
stating to humans and computers that what follows is an XML file.
2. Always retain the root element, and any namespace declarations contained within it. • The second line of an RDF/XML file is the opening tag for the root element <rdf:RDF>,
and it contains several namespace declarations. The last line of the file is the closing tag for the root element </rdf:RDF>.
3. Always retain the opening and closing tags for the elements you want to focus on. • Similar to #2, if you want to look at a particular part of the file – such as the Work
portion – you need to keep both the opening <bf:Work> and closing </bf:Work> tags for the Work element.
4. An additional note on opening and closing tags: • Not all elements will have distinct opening and closing tags. In these cases, the end of
the element is simply stated with a “/” at the end of the tag.
5. Some data is not found completely inside the element you are looking at. It may refer to a different part of the file where it is more explicitly stated.
• Rather than elaborating, how about an example? If you want to see what the work title is for a particular resource, that data is not fully contained within the Work element. Rather, it simply references a URI that is found further down in the file in a separate Title element.
Brief glossary (terms adapted from Library Juice Academy)
XML Structure: Here's a simple XML fragment as an example.
<?xml version="1.0" encoding="UTF-8"?> <root xmlns:prefix = "namespace URI"> <parent> <child>some text</child> </parent> <parent> <child>some more text</child> </parent> </root>
<?xml version="1.0" encoding="UTF-8"?> <booklist xmlns:dc = "http://purl.org/dc/elements/1.1/"> <book1> <dc:title>The paper mixtape</dc:title> </book1> <book2> <dc:title>Cakeboy</dc:title> </book2> </booklist>
Element: An element consists of an opening tag, a closing tag, and anything in between the opening and closing tag… Example: <message>It was a dark and stormy night.</message> In this segment, the opening tag is <message> and the closing tag is </message>
Attribute: An attribute provides more information about an element. [Note that both element and attribute are terms related to XML, not to linked data. They are only needed because XML is a commonly-used way to represent linked data graphs.]
Root element, parent element, child element: It's useful to think of XML documents as a hierarchical tree. The root element is the first element to appear; the root encloses all other elements. Each XML file must have one and only one root. Below the root are parent, child, and subchild elements.
Declaration: An XML declaration is a processing statement that appear at the top of an XML document. It must remain in any XML document Example: <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
Namespace: XML Namespaces provide a way to create uniquely named elements and attributes in an XML document. Namespaces have two primary uses: to avoid name collisions and to facilitate name recognition. Namespaces are declared by stating the prefix that will be used and a unique URI (commonly, but not exclusively, in the form of a URL).