ArticleslgStudy

computer science

Open Packaging Conventions

Open Packaging Conventions is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Open Packaging Conventions rather than just read about it. In short: The Open Packaging Conventions (OPC) is a container-file technology initially created by Microsoft to store a combination of XML and non-XML files that together form a single entity such as an Open XML Paper Specification (OpenXPS) document. OPC-based file formats combine the advantages of leaving the independent file entities embedded in the document intact and resulting in much smaller files compared to normal use…

Open Packaging Conventions — main illustration
Open Packaging Conventions — illustration

Key takeaways

  • Open Packaging Conventions belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Open Packaging Conventions to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Open Packaging Conventions from memory before moving on to harder problems.

Reference excerpt

The Open Packaging Conventions (OPC) is a container-file technology initially created by Microsoft to store a combination of XML and non-XML files that together form a single entity such as an Open XML Paper Specification (OpenXPS) document. OPC-based file formats combine the advantages of leaving the independent file entities embedded in the document intact and resulting in much smaller files compared to normal use of XML.

Specifications The OPC is specified in Part 2 of the Office Open XML standards ISO/IEC 29500:2008 and ECMA-376. The ISO/IEC 29500-2:2008 specification and the second edition of ECMA-376 makes a normative reference to PKWARE, Inc.'s .ZIP File Format Specification version 6.2.0 (2004), and supplements it with a normative set of clarifications. Note: The older first edition of ECMA-376 makes an informative (i.e., non-normative) reference to the newer PKWARE Inc's ".ZIP File Format Specification" version 6.2.1 (2005). The ZIP format is not specified by any international standard but has widespread community and developer acceptance. Microsoft submitted a draft in 2006 to the Internet Engineering Task Force for a "pack" URI Scheme (pack://) to be used for URI references to OPC-based packages. The draft expired in 2009, the specified syntax is incompatible with the Internet Standard for URI schemes (STD 66, RFC 3986). The scheme is now listed as historical. The ISO 19165:1-2018 recommends the use of the Open Packaging Conventions to implement the Geospatial Package defined in the Open Archival Information System.

Usage Both the Open XML Paper Specification (XPS) and Office Open XML (OOXML) use Open Packaging Conventions (OPC), which provide a profile of the common ZIP format. In addition to data and document content in XML markup, files in the ZIP package can include other text and binary files in formats such as PNG, BMP, AVI, PDF, RTF, or even an already packaged ODF file. OPC also defines some naming conventions and an indirection method to allow position independence of binary and XML files in the ZIP archive. OPC files can be opened using common ZIP utilities. OPC allow indirection, chunking and relative indirection.

File formats using the OPC The OPC is the foundation technology for many new file formats:

Programming OPC is natively supported in Microsoft .NET Framework 3.0 by the System.IO.Packaging namespace. Open source libraries exist for other languages. Since Windows 7, OPC is also natively supported in the Windows API through a set of COM interfaces, collectively referred to as Packaging API. Alternatively, ZIP libraries can be used to create and open OPC files, as long as the correct files are included in the ZIP and the conventions followed.

Package, parts, and relationships

In OPC terminology, the term package corresponds to a ZIP archive and the term part corresponds to a file stored within the ZIP. Every part in a package has a unique URI-compliant part name along with a specified content-type expressed in the form of a MIME media type. A part's content-type explicitly defines the type of data stored in the part and reduces duplication and ambiguity issues inherent with file extensions. OPC packages can also include relationships that define associations between the package, parts, and external resources. In addition to a hierarchy of directories and parts, OPC packages commonly use relationships to access content through a directed graph of relationship associations. Relationships are composed of four elements:

an identifier (ID) an optional source (the package or a part within the package) a relationship type (a URI-style expression that defines the type of the relationship) a target (a URI to another part within the package or to an external resource) OPC packages can store parts that contain any type of data (text, images, XML, binary, whatever). The extension ".rels", however, is reserved for storing relationships metadata within "/_rels" subfolders. The subfolder name "_rels", the file extension ".rels" within such directory, and the filename "[Content_Types].xml" in any folder are the only three reserved names for files stored in an OPC package.

/[Content_Types].xml file This file defines the MIME media types for all the parts stored in the package. The "/[Content_Types].xml" file defines default mappings based on file extensions, along with overrides for specific parts with content-types that are different from the file extension defaults. For example, one of these defined MIME types is:

/_rels The root level "/_rels" folder stores the relationships for the package as a whole. The "/_rels" folder normally contains a file named ".rels". "/_rels/.rels" is an XML file where the starting package-level relationships are stored. Normally when opening an OPC-based file, applications start by accessing to the "/_rels/.rels" file to read the starting package-level relationships. [partname].rels Each part may have its own relationships. The _rels folders are where one goes to find the relationships for any given part within the package. To find the relationships for a specific part, one looks in the "_rels" folder that is a sibling of that part: If the part has relationships, the "_rels" folder will contain a file that has one's original part name with a ".rels" appended to it. For example, if the content types part file had any relationships, there would be a file called "[Content_Types].xml.rels" inside the "/_rels" folder. All relationships (including the relations associated to the root package) are represented as XML files. If you open a ".rels" file in a text editor, you can view the actual XML markup that defines all the relationships targeted from that part. A typical relationships file contains XML code like this:

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Open Packaging Conventions

Start with the simplest possible case. Write down what Open Packaging Conventions claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Open Packaging Conventions before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Open Packaging Conventions ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Open Packaging Conventions

In research
Open Packaging Conventions appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Open Packaging Conventions in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Open Packaging Conventions is common in secondary-school and first-year university syllabi. It links to neighbouring topics Computer file formats, Ecma standards, IEC standards, so understanding it makes those chapters shorter.
In everyday life
Look for Open Packaging Conventions outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Open Packaging Conventions in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Open Packaging Conventions means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Open Packaging Conventions out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Open Packaging Conventions in simple terms?

The Open Packaging Conventions (OPC) is a container-file technology initially created by Microsoft to store a combination of XML and non-XML files that together form a single entity such as an Open XML Paper Specification (OpenXPS) document. OPC-based file formats combine the advantages of leaving…

Why does Open Packaging Conventions matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Open Packaging Conventions?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Open Packaging Conventions.

Tags

  • Computer file formats
  • Ecma standards
  • IEC standards
  • ISO standards
  • Microsoft initiatives
  • Office Open XML

Keep exploring