From Provenance WG Wiki
Jump to: navigation, search

All PROV examples

  • author:

Identify the problem

Should appear in

Hello, xsl,

I'm working on an implementation for W3C's PROV recommendation [1], and I ran into a roadblock that I hope this list can help me with.

If I have the following input document (shortened from [2], available at [3]):


    <prov:entity prov:ref="ex:The-Painter"/>
    <prov:activity prov:ref="ex:crash"/>
    <ex:circumstances>plane accident</ex:circumstances>


I'm trying to access the value "" given the value "ex", without the transform knowing a priori.
To illustrate what I need, I have the following XSL, which needs a new @select on the variable named "magic".

<xsl:output method="text"/>

<xsl:key name="prefix" match="//prov:prefix" use="@prov:id"/>

<xsl:template match="/">

   <xsl:variable name="prefix" select="substring-before(//prov:entity/@prov:ref,':')"/>

   <xsl:variable name="magic" select="concat('magic(',$prefix,')=')"/>

   <!-- Cannot access /prov:document/@xmlns:ex using a variable-constructed XPath.
    xsl:variable name="magic1" select="concat(prov:document/xmlns:',$prefix,')"/

   <!-- These two work, but require an addition of a <prov:prefix> element -->
   <xsl:variable name="magic2" select="//prov:prefix[@prov:id=$prefix]"/>
   <xsl:variable name="magic3" select="key('prefix',$prefix)"/>

   <xsl:value-of select="concat('The full URI of your painting is ',


Some homework that I've done hasn't led me to a solution:

suggests that one can't _write_ an @xmlns.
Which leads me to believe that one can't _read_ one, either.
I think the problem is that I don't ever have an element in the "ex" namespace...

might cover my issue by saying it's "never available", but could someone confirm that?
I think this is the case.

seems to confirm that I can't construct the xpath to access the /prov:document's attribute from a variable
<xsl:value-of select="concat(prov:document/xmlns:',$prefix,')"/>

Given this, I'm inclined to suggest to the PROV-WG that they include something like:
  <prov:prefix prov:id="ex"></prov:prefix>

Thanks for your time and consideration. Am I missing any other alternative?

Tim Lebo


The use of provenance

The PROV example

How PROV is accessed and queried?