PBCore-AV-Metadata / pbucore

16 stars 7 forks source link

Proposal: Catch-all for attributes? #72

Open mccalluc opened 9 years ago

mccalluc commented 9 years ago

It looks like PBCore may have a lot of optional attributes which EBUCore doesn't worry about. Not sure what the best way of handling this is, but here's one idea. Taking pbcoreDescription as an example:

--- a/lib/pbcore-2-ebucore.xsl
+++ b/lib/pbcore-2-ebucore.xsl
@@ -16,6 +16,7 @@
+    <xsl:include href="lib/includes/attributes.xsl"/>
--- a/lib/includes/pbcoreDescriptionDocument.xsl
+++ b/lib/includes/pbcoreDescriptionDocument.xsl
@@ -41,6 +41,14 @@
+                <pbcore:description>
+                    <rdf:Description>
+                        <xsl:apply-templates select="@*"/>
+                        <pbcorerdf:value>
+                            <xsl:value-of select="."/>
+                        </pbcorerdf:value>
+                    </rdf:Description>
+                </pbcore:description>

attributes.xsl:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:template match="@*">
        <xsl:element name="{name()}" namespace="http://www.pbcore.org/pbcore/pbcore#">
            <xsl:value-of select="."/>
        </xsl:element>
    </xsl:template>
</xsl:stylesheet>

With that in place, given

<pbcoreDescriptionDocument xmlns="http://www.pbcore.org/PBCore/PBCoreNamespace.html">
  <pbcoreDescription 
      annotation="@annotation" 
      descriptionType="@descriptionType" 
      descriptionTypeSource="@descriptionTypeSource"
      descriptionTypeRef="@descriptionTypeRef"
      descriptionTypeVersion="@descriptionTypeVersion" 
      descriptionTypeAnnotation="@descriptionTypeAnnotation" 
      segmentType="@segmentType" 
      segmentTypeSource="@segmentTypeSource" 
      segmentTypeRef="@segmentTypeRef" 
      segmentTypeVersion="@segmentTypeVersion" 
      segmentTypeAnnotation="@segmentTypeAnnotation"
      startTime="@startTime" 
      endTime="@endTime" 
      timeAnnotation="@timeAnnotation">Did the attributes come through?</pbcoreDescription>
</pbcoreDescriptionDocument>

at the other end we get

<> a ebucore:EditorialObject;
   rdfs:label "";
   ebucore:description "Did the attributes come through?";
   pbcore:description [
     pbcorerdf:annotation "@annotation";
     pbcorerdf:descriptionType "@descriptionType";
     pbcorerdf:descriptionTypeAnnotation "@descriptionTypeAnnotation";
     pbcorerdf:descriptionTypeRef "@descriptionTypeRef";
     pbcorerdf:descriptionTypeSource "@descriptionTypeSource";
     pbcorerdf:descriptionTypeVersion "@descriptionTypeVersion";
     pbcorerdf:endTime "@endTime";
     pbcorerdf:segmentType "@segmentType";
     pbcorerdf:segmentTypeAnnotation "@segmentTypeAnnotation";
     pbcorerdf:segmentTypeRef "@segmentTypeRef";
     pbcorerdf:segmentTypeSource "@segmentTypeSource";
     pbcorerdf:segmentTypeVersion "@segmentTypeVersion";
     pbcorerdf:startTime "@startTime";
     pbcorerdf:timeAnnotation "@timeAnnotation";
     pbcorerdf:value "Did the attributes come through?"
   ] .

More generally:

JPEvain commented 9 years ago

Comments:

  1.  General: I have done a mapping from PBCore to EBUCore and there aren’t so many attributes you can’t map. Actually and quantitatively, I believe there are more EBUCore attributes that can’t map into PBCore.
  2.  General:The intention of reusing EBUCore attributes when available and otherwise extend is in the spirit of the discussions we started in Boston. It goes far beyond using ebucore:EditorialObject and redefining a PBCore scheme behind it (which is what the snippet reflects). This is not right.
  3.  General: I have the feeling there is a misunderstanding around the model. Things like parameters related to a segment will apply to segment objects. It is more complex than just a translation from xml to rdf. This also leads to abusive use of blank nodes to mimic xml structures (complexTypes) into RDF. For instance:

a. What is a description type in xml should become another property or sub-property of description

b. All that is related to segment should be attached to segment objects

c. Etc.

If we really want to reuse EBUCore as we declared:

  1.  Create a pbcore ontology (with a better namespace than the one used in the snippet that is not rdf friendly)
  2.  Import ebucore RDF
  3.  Map pbcore properties and classes to ebucore when possible – see mappings started in Boston
  4.  Add pbcore properties and classes when missing.

To my opinion the following snippet is putting us on a wrong track. I am happy to discuss this in more details although not writing pages of email.

<> a ebucore:EditorialObject;

rdfs:label "";

pbcore:description "Did the attributes come through?";

pbcore:description [

 pbcorerdf:annotation "@annotation";

 ebucorerdf:descriptionType "@descriptionType";

 pbcorerdf:descriptionTypeAnnotation "@descriptionTypeAnnotation";

 pbcorerdf:descriptionTypeRef "@descriptionTypeRef";

 pbcorerdf:descriptionTypeSource "@descriptionTypeSource";

 pbcorerdf:descriptionTypeVersion "@descriptionTypeVersion";

 pbcorerdf:endTime "@endTime";

 pbcorerdf:segmentType "@segmentType";

 pbcorerdf:segmentTypeAnnotation "@segmentTypeAnnotation";

 pbcorerdf:segmentTypeRef "@segmentTypeRef";

 pbcorerdf:segmentTypeSource "@segmentTypeSource";

 pbcorerdf:segmentTypeVersion "@segmentTypeVersion";

 pbcorerdf:startTime "@startTime";

 pbcorerdf:timeAnnotation "@timeAnnotation";

 pbcorerdf:value "Did the attributes come through?"

] .

From: mccalluc [mailto:notifications@github.com] Sent: mardi 12 mai 2015 01:31 To: WGBH/pbucore Subject: [pbucore] Proposal: Catch-all for attributes? (#72)

It looks like PBCore may have a lot of optional attributes which EBUCore doesn't worry about. Not sure what the best way of handling this is, but here's one idea. Taking pbcoreDescription as an example:

--- a/lib/pbcore-2-ebucore.xsl

+++ b/lib/pbcore-2-ebucore.xsl

@@ -16,6 +16,7 @@

--- a/lib/includes/pbcoreDescriptionDocument.xsl

+++ b/lib/includes/pbcoreDescriptionDocument.xsl

@@ -41,6 +41,14 @@

attributes.xsl:

``` ``` /xsl:stylesheet With that in place, given Did the attributes come through? ``` at the other end we get <> a ebucore:EditorialObject; rdfs:label ""; ebucore:description "Did the attributes come through?"; pbcore:description [ ``` pbcorerdf:annotation "@annotation"; pbcorerdf:descriptionType "@descriptionType"; pbcorerdf:descriptionTypeAnnotation "@descriptionTypeAnnotation"; pbcorerdf:descriptionTypeRef "@descriptionTypeRef"; pbcorerdf:descriptionTypeSource "@descriptionTypeSource"; pbcorerdf:descriptionTypeVersion "@descriptionTypeVersion"; pbcorerdf:endTime "@endTime"; pbcorerdf:segmentType "@segmentType"; pbcorerdf:segmentTypeAnnotation "@segmentTypeAnnotation"; pbcorerdf:segmentTypeRef "@segmentTypeRef"; pbcorerdf:segmentTypeSource "@segmentTypeSource"; pbcorerdf:segmentTypeVersion "@segmentTypeVersion"; pbcorerdf:startTime "@startTime"; pbcorerdf:timeAnnotation "@timeAnnotation"; pbcorerdf:value "Did the attributes come through?" ``` ] . More generally: - Where EBUCore terms are available, use them. - But also create PBCore terms as necessary to make sure we don't lose information. — ## Reply to this email directly or view it on GitHubhttps://github.com/WGBH/pbucore/issues/72. --- This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error, please notify the system manager. This footnote also confirms that this email message has been swept by the mailgateway ---