Definition of relatinship

MURATA Makoto eb2m-mrt at asahi-net.or.jp
Tue Jan 5 10:02:34 CET 2016


Caroline,

Thank you for (1) reminding us of at least a complete pass through the
Terms and Defs, and (2) demonstrating advantages of adding notes to
terms.

I appear to have confused you by not proposing both (1) a rewrite of
the Terms and Defs and (2) a rewrite of the subclauses for defining
relationships.  Because of (2), I added "source of a relationships
part" that was never used before.

Moreover, I dropped "package relationship", although it was used.  I
thought that this term is confusing, but I am probably wrong.

Here is my complete rewrite.

Regards,
Makoto

Definitions

relationships part
a part of the media type
"application/vnd.openxmlformats-package.relationships+xml"
(Note: Relationship parts are XML documents containing Relationships and
Relationship
elements.)

package relationship
A relationship whose source is the package as a whole
(Note: Package relationships are found in the package relationships part
named “/_rels/.rels”.)

part relationship
A relationship whose source is a part in the package
(Note: Part relationships for a part “/foo/bar.xml” are found in
the relationships part “/foo/_rels/bar.xml.rels”.)

source of a relationships part
a part or an entire package with which the relationship part is associated
by
a file name convention.

relationship
a Relationship element in a relationship part

source of a relationship
the source of the relationship part containing the relationship

target mode of a relationship
either "Interal" or "External" as specified by the value of the
TargetMode attribute of the relationship

target of a relationship
the resource referenced by the Target attribute of the relationship
(Note: when the target mode is internal, the target is a part)

relationship type of a relationship
the value of the Type attribute of a relationship


8.5 Relationships

8.5.1 Overview (non-normative)

The package model introduces a mechanism, namely relationships, to
describe connections from sources to targets, both of which are
typically parts in packages.  Relationships are stored in relationship
parts, which are separate from source parts.

Relationships make connections directly discoverable without looking
at contents of source parts.  Moreover, it is possible to retarget
relationships without changing source parts, by rewriting relationships
parts.

Relationships have identifiers.  Source parts may specify these
identifiers at certain locations as references to relationships, but
are not required to do so.  Relationships have types.  They specify
roles of relationships.

Relationships allow to provide additional information about parts
without modifying their contents. Such addition of information is
particularly useful when parts are encrypted and cannot be decrypted,
or when parts are digitally signed and changing them would invalidate
the signatures.

8.5.2 Relationships Part

A relationship part shall be a part of the media type
"application/vnd.openxmlformats-package.relationships+xml".

Each relationships part in a package shall have a source.  A source is
either a non-relationships part in the same package or the package
itself.  A relationships part shall not be the source of another
relationships part.

There is a naming convention for associating relationships parts with
sources.  If the source of a relationships part is a package, the part
name of this relationships part shall be “/_rels/.rels”.  If the
source of a relationship part is a non-relationship part, the part
name of this relationship part shall be constructed from the part name
of the source part, by first inserting “_rels/” immediately before
the last I18N segment in ps and then appending “.rels”.

[Example: If a source part name is “/foo”, the last I18N segment is
“foo” and the relationship part name is “/_rels/foo.rels”.  If a
source part name is “/foo/bar.xml”, the last I18N segment is
“bar.xml” and the relationship part name is
“/foo/_rels/bar.xml.rels”.]

Note: A relationship part holds the list of relationships from the source
of this relationship part.

8.5.3 Relationship Markup

8.5.3.1 General

The content of a relationships part shall be an XML document.  It
contains an Relationships element and zero or more Relationship
elements.  These elements shall be in the Relationships namespace, as
specified in Annex E.

The XML document in a relationships part shall be valid against
opc-relationships.xsd in Annex C.5 after the removal of any extensions
using the mechanisms in ISO/IEC 29500-3.

8.5.3.2 Relationships element

The root element of a relationships part shall be a Relationships
element.

8.5.3.3 Relationship element

A Relationship element is a child element of a Relationships element.

A relationship shall be a Relationship element.  The source of this
relationship shall be the source of the relationships part containing
this Relationship element.

A package relation shall be a relation having a package as the source.
A part relation shall be a relation having a part as the source.

TargetMode
ST_TargetMode
optional

Permissible values of the TargetMode attribute are Internal and
External.  These values shall indicate whether or not the target
describes a part inside the package or a resource outside the package.
The default value is Internal.

Target
xsd:anyURI
required

This attribute specifies the target of a relationship.
If the value of the TargetMode attribute is Internal, the Target
attribute shall be a relative reference.  If the value of the
TargetMode attribute is External, the Target attribute shall be a
relative reference or an absolute IRI.  Base IRIs for resolving
relative references are defined in 8.3.6.

[Editor's note: In 8.3.6, we have to define base IRIs

Case 1: package relationship
  1) internal
    pack URI for the entire package
  2) external
   the URI of the entire package
Case 2: part relationship
  1) internal
    pack uri for the entire package and the source part
  2) external
    the URI of the entire package
]



Type
xsd:anyURI
required

This attribute specifies the role of a relatinship, relationship type.

Id
xsd:ID
required

This attribute specifies the identifier of a relationship.  The value
of the Id attribute shall be unique within the Relationships part.

8.5.4 Examples (non-normative)

8.5.4.1 Relationship part “/_rels/.rels”

Consider a package, availalbe at http://www.example.com/ex.opc.
Suppose that the package contains a relationship part
“/_rels/.rels”, the source of which is the package.

Also suppose that the content of this relationship part is an XML
document shown below:

<Relationships
   xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
   <Relationship
      Target="./a.xml"
      Id="IDI1"
      Type="http://example.com/relTypeInt1"/>
   <Relationship
      Target="./a.xml"
      TargetMode="External"
      Id="IDE1"
      Type="http://example.com/relTypeExt1"/>
</Relationships>

There are two relationships in this relationship part.  The source of
both relationships is the package.

The mode of the first relationship is Internal (default).  Thus, the base
IRI for resolving "./a.xml" is the pack URI
(pack://http%3c,,www.example.com,ex.opc) created from the IRI of the
package (http://www.example.com/ex.opc).  By resolving "./a.xml", we
have pack://http%3c,,www.example.com,ex.opc/a.xml".  The target of
this relationship is thus the part "/a.xml" in this package.  The
relationship type of this relationship is
"http://example.com/relTypeInt1".  The identifier of this relationship is
"IDI1".

The mode of the second relationship is External.  Thus, the base IRI
for resolving "./a.xml" is the IRI (http://www.example.com/ex.opc) of
the package.  The target of this relationship is thus the resource at
http://www.example.com/a.xml.  The relationship type of this
relationship is "http://example.com/relTypeExt1".  The identifier of
this relationship is "IDE1".

8.5.4.2  Relationships part “/foo_rels/test.xml.rels”

Consider a package, availalbe at http://www.example.com/ex.opc.
Suppose that the package contains a relationship part
“/foo_rels/test.xml.rels”, the source of which is a part
“/foo/test.xml”.

Also suppose that the content of this relationship part is an XML document
shown below:

<Relationships
   xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
   <Relationship
      Target="./b.xml"
      Id="IDI2"
      Type="http://example.com/relTypeInt2"/>
   <Relationship
      Target="./b.xml"
      TargetMode="External"
      Id="IDE2"
      Type="http://example.com/relTypeExt2"/>
</Relationships>

There are two relationships in this relationship part.  The source of
both relationships is the part “/foo/test.xml”.

The mode of the first relationship is Internal (default).  Thus, the
base IRI (“pack://http%3c,,www.example.com,ex.opc/foo/test.xml”) for
resolving "./b.xml" is the pack URI created from the IRI
(http://www.example.com/ex.opc) of the package and the part name
“/foo/test.xml”.  By resolving "./b.xml", we have
“pack://http%3c,,www.example.com,ex.opc/foo/b.xml”.  The target of
this relationship is thus the part "/foo/b.xml" in this package.  The
relationship type of this relationship is
"http://example.com/relTypeInt2".  The identifier of this relationship
is "IDI2".

The mode of the second relationship is External.  Thus, the base IRI for
resolving "./b.xml" is the IRI (http://www.example.com/ex.opc) of the
package.  The target of this relationship is thus the resource at
http://www.example.com/b.xml.  The relationship type of this
relationship is "http://example.com/relTypeExt2".  The identifier of
this relationship is "IDE2".

8.5.4.3  External part by an absolute URI

The following Relationships part specifies a relationship that connects
a part to http://www.custom.com/images/pic1.jpg.

<Relationships
   xmlns="http://schemas.openxmlformats.org/package/2006/relationships"
   <Relationship
      TargetMode="External"
      Id="A9EFC627517BC"
      Target="http://www.custom.com/images/pic1.jpg"
      Type="http://www.custom.com/external-resource"/>
</Relationships>

8.5.4.4  Multiple relations to a single target

The following Relationships part contains two relationships, each
using unique Id values. The relationships share the same Target, but
have different relationship types.

<Relationships
   xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
   <Relationship Target="./Signature.xml"
      Id="A5FFC797514BC"
      Type="http://schemas.openxmlformats.org/package/2006/
         relationships/digital-signature/signature"/>
   <Relationship
      Target="./Signature.xml"
      Id="B5F32797CC4B7"
      Type="http://www.custom.com/internal-resource"/>
</Relationships>


8.5.5 Support for Versioning and Extensibility

To be supplied.




2015-12-31 23:13 GMT+09:00 Arms, Caroline <caar at loc.gov>:

> Happy New Year!
>
>
>
> Murata-san.
>
> There are certainly problems with many of the Terms and Definitions.  Way
> back, Rex made a pass through them to try and make sure that they followed
> the (new?) editorial guidelines.  However, he did not use any Notes, which
> I believe are (a) allowed and (b) often useful, particularly to relate
> abstract concepts to concrete OOXML terminology.  I had been assuming we
> would do a complete pass through the Terms and Definitions at some point.
>
>
>
> However, I have some concerns about your rewrite, which tries to define
> terms that are never used and in my view makes the collection of
> definitions more confusing.  I went back to the published terms and
> definitions in Part 2 rather than starting with the WD.  Then I focused on
> the same terms defined there – since they are certainly used in the text.
> Note that  I have assumed that “source” and “target” are words that do not
> need definition.  And I have assumed that the Internal/External TargetMode
> issue is covered in the spec.   I have changed some occurrences of “the” to
> “a” to address your concerns C and D.
>
>
>
> Here is my attempt:
>
>
>
> package relationship — A relationship whose target is a part and whose
> source is the package as a whole.
>
> (Note: Package relationships are found in the package relationships part
> named “/_rels/.rels”.)
>
>
>
> relationship —A connection between a source, which may be a part in the
> package or the package as a whole and a target, which may be a part in a
> package or an external resource.
>
> (Note: A relationship is represented by a Relationship element in a
> relationships part.)
>
>
>
> relationships part — A part containing an XML representation of
> relationships.
>
> (Note: a relationships part has the media type
> "application/vnd.openxmlformats-package.relationships
>
> +xml")
>
>
>
> relationship type — An absolute IRI used to identify the nature of a
> relationship.
>
> (Note: a relationship type is indicated in the Type attribute of a
> Relationship element)
>
>
>
> source part — A part from which a connection is established by a
> relationship.
>
>
>
> target part — A part referenced by the “Target” attribute of a
> relationship.
>
>
>
>   I hope this helps.
>
>   Caroline
>
>
>
> *From:* eb2mmrt at gmail.com [mailto:eb2mmrt at gmail.com] *On Behalf Of *MURATA
> Makoto
> *Sent:* Wednesday, December 23, 2015 9:29 PM
> *To:* SC34
> *Subject:* Definition of relatinship
>
>
>
> Merry Christmas!
>
>
>
> Here is my present for you.  I thought OOXML experts might like it.
>
>
>
> I am reviewing the definition of relationships in OPC.  Let me report
> some problems.
>
>
>
> A) Circular definitions
>
>
>
> "source part" and "target part" are defined using "relationship", but
> "relationship" is defined using them.
>
>
>
> B) Relationships and package relationships
>
>
>
> In the definition of "relationship", the source is always a part. But
> "package relationship" is defined as a special case of "relationship".
>
>
>
> C) source is not always a part
>
>
>
> In the case of a package relationship, the source is not a part but
> rather a package.
>
>
>
> D) target is not always a part
>
>
>
> When the relationship mode is external, the target of a relationship
> is not a part but rather any external resource.
>
>
>
> E) Some terms are abstract, while others are XMLish
>
>
>
> "relationship" is defined as a connection, which I call abstract.
> Other terms "source part", "target part", and "package relationship"
> are also abstract.  But "relationships part" is defined as an XML
> representation.
>
>
>
> Here is the definitions extracted from the current WD.
>
>
>
> 4.23
> package relationship
> relationship whose target is a part and whose source is the package as a
> whole
>
>
>
> 4.32
> relationship
> connection between a source part and a target part in a package
>
>
>
> 4.33
> relationship type
> absolute IRI for identifying a relationship
>
>
>
> 4.34
> relationships part
> part containing an XML representation of relationships
>
>
>
> 4.39
> source part
> part from which a connection is established by a relationship
>
>
>
> 4.43
> target part
> part to which a connection is established by a relationship
>
>
>
> -------------------------------
>
>
>
> I would like to propose a rewrite.  Am I too worried?
>
>
>
> relationship part
> a part of the media type
> "application/vnd.openxmlformats-package.relationships+xml"
>
>
>
> source of a relationship part
> a part or an entire package with which the relationship part is associated
> by
> a file name convention.
>
>
>
> relationship
> a Relationship element in a relationship part
>
>
>
> source of a relationship
> the source of the relationship part containing the relationship
>
>
>
> target mode of a relationship
> either "Interal" or "External" as specified by the value of the
> TargetMode attribute of the relationship
>
>
>
> target of a relationship
> the resource referenced by the Target attribute of the relationship
> (Note: when the targe mode is internal, the target is a part)
>
>
>
> relationship type of a relationship
> the IRI value of the Type attribute of a relationship
>
>
>
> Requirements
>
>
>
> a relationsip part shall conform to the schema .... after MVC preprocessing
>
>
>
> Regards,
>
> Makoto
>



-- 

Praying for the victims of the Japan Tohoku earthquake

Makoto
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.vse.cz/pipermail/sc34wg4/attachments/20160105/90407b2f/attachment-0001.html>


More information about the sc34wg4 mailing list